Linked by MOS6510 on Thu 10th Jan 2013 23:25 UTC
General Development "For years I've tried my damnedest to get away from C. Too simple, too many details to manage, too old and crufty, too low level. I've had intense and torrid love affairs with Java, C++, and Erlang. I've built things I'm proud of with all of them, and yet each has broken my heart. They've made promises they couldn't keep, created cultures that focus on the wrong things, and made devastating tradeoffs that eventually make you suffer painfully. And I keep crawling back to C."
Permalink for comment 548333
To read all comments associated with this story, please click here.
Point by point
by ingraham on Fri 11th Jan 2013 08:53 UTC
Member since:

"Simple and Expressive"

In what way is C simple? Take someone who's got a good background and mind for programming and show them C. See how long it takes them to actually understand how to define a function to pass to qsort() and bsearch() and then get the syntax right for function pointers. Versus .sort() and .find() in any object language, or the array-style dictionaries in Smalltalk or Lua. No way is C more expressive, much less 'simple.'

"Simpler Code, Simpler Types"

Okay, that I sort of agree with. I was bouncing through the JavaFX API docs yesterday, and there sure were a lot of bizarro return types that don't make sense off hand. However, there are entire books written about how to figure out what a damn variable definition means in C. const * char is a pointer to const... I think. Right? Very simple.

"Speed King"


"Faster Build-Run-Debug Cycles"

In what universe? I grant you, C++ takes longer to compile than straight C, normally because it has to compile anything having to do with templates all the way back up the line. But my Java compiles are every bit as fast as C compiles. Maybe faster, since Java often does a better job of figuring out what needs to recompile, vs. 'hmm, maybe I should 'make clean' just to be sure.' And the Build-Run-Debug cycle of ANY scripting language is about a hundred times faster than C. gcc --help takes longer than no compile step at all.

"Ubiquitous Debuggers and Useful Crash Dumps"

Again, I can't argue with that one. Well, C crash dumps aren't always useful, but they're there when you really need them.

"Callable from Anywhere"

Okay. Although I'm not sure there's any real advantage over C++ in this regard.

"Yes. It has Flaws"

Indeed. Of course, every language does. But some of the crap you put up with in C is really just awful. Strings may be a simple, dumb example, but damn it just about every program has to deal with strings constantly. It may be a small grain of sand, but it chafes after a while. And sure, I can get an internationalization library for C. (Or ten of them, and who knows which one is actually the good one.) But in Java it's just there.

A final thought. Would Couchbase have been written at all if it hadn't started in Erlang? Sure, when it got big and successful and they needed speed improvements they re-coded in C. But could they have gotten that far without a higher level language to start with? The whole idea of "rapid prototyping" isn't just good because it makes programmers' lives easier, but also because get up and running with something functional quickly. You have to prove a business case or convince people to join your team, and that point is a lot harder to get to in C.

Reply Score: 9