Live data from Hacker News

Why do we use C still?

news.ycombinator.com

1–10 of 22 posts

Why do we use C still?

#1
Why do we use C still when there are other languages like Go or C++ or even D? BCPL and B were done away with so quickly, so why do we still use C in our modern society with languages that can do things a lot more efficiently?

Re: Why do we use C still?

#2
C is an adequate language (actually, more than adequate) with a large base of skilled programmers. There is a long history of successful development. And the developer base is aware of the warts that still remain in the language.

Re: Why do we use C still?

#3

C is an adequate language (actually, more than adequate) with a large base of skilled programmers. There is a long history of successful development. And the developer base is aware of the warts that still remain in the language.

But why use C when there are other Systems programming languages like Go, C++, D, etc..

Re: Why do we use C still?

#5
post #3

C is an adequate language (actually, more than adequate) with a large base of skilled programmers. There is a long history of successful development. And the developer base is aware of the warts that still remain in the language.

But why use C when there are other Systems programming languages like Go, C++, D, etc..

One reason would be the massive existing codebases written in C (Linux kernel, anyone?)...

Re: Why do we use C still?

#6
post #3

C is an adequate language (actually, more than adequate) with a large base of skilled programmers. There is a long history of successful development. And the developer base is aware of the warts that still remain in the language.

But why use C when there are other Systems programming languages like Go, C++, D, etc..

You can compile programs with those languages and get something that works, but on a regular basis, some programmer will say something like, "Ok, I'll use Go for project x" and get part of the way into it and then discovers...

...a critical library has not been ported.

...a really useful language feature doesn't exist, or its implementation isn't appropriate for this application.

...a compiler bug appears and causes days to weeks of torment.

...it's difficult to deploy and distribute the result.

...there are fewer tools, debugging aids, etc.

Languages don't live in a "clean room" environment. All of these things add value even when the language itself is unsound. And then you weigh the cost of rolling new tools, fixing the compiler yourself, etc. against building on the old stuff, and the old stuff wins most of the time. Reaching the opposite conclusion is the exception, and to get there, the language usually has to carve out a niche use-case where it has the best library for a certain domain.

Re: Why do we use C still?

#7
post #3

Earlier quoted context omitted.

But why use C when there are other Systems programming languages like Go, C++, D, etc..

One reason would be the massive existing codebases written in C (Linux kernel, anyone?)...

We should all switch to Java/C#. It makes programming much much faster and easier. http://techiest.blogspot.com/.

Re: Why do we use C still?

#8
Generally, the good reasons you'll see for using C are lack of C++ compiler availability and embedded programming.

The bad reasons tend to be variations of developer inertia and the inability to decide which features of C++ ought to be used -- arguing against the STL isn't a good argument against C++ as a whole.

Re: Why do we use C still?

#10
post #8

Generally, the good reasons you'll see for using C are lack of C++ compiler availability and embedded programming. The bad reasons tend to be variations of developer inertia and the inability to decide which features of C++ ought to be used -- arguing against the STL isn't a good argument against C++ as a whole.

On Linux/Mac you have g++ and on Windows you have MinGW/Visual Studio
Post reply on HN