.comment-link {margin-left:.6em;}

Wednesday, September 28, 2005

Why I'm a C programmer

I am a C programmer, and hopefully a rather good one. I've seen numerous other languages come and go, and have gleaned ideas from them that I've used in my coding - and in languages I've developed - but haven't seen other languages that I've liked better than C for the sort of programming I prefer: small, high-performance database kernels.

A colleague described the C language as a the "shark" of programming languages, perfectly evolved for what it does, and - despite its extreme age in computer terms - unlikely to evolve in major ways. C isn't a good language for mega-projects - OO languages and higher-level scripting languages are better at that level - but for constrained-environment projects or projects made up of integrated software components where performance actually matters, C still can't be beat.

What about C++?

C++ is ugly: because it got its start by bolting preprocessing front-ends "on top of" C compilers, a culture developed where the language was extended by adding syntax. Now, there's so much syntax that C++ reference manuals look like the NYC white pages. With so much syntax, it is hard to simply look at C++ code and know what it's doing without knowing the coding standards used; C doesn't have this problem. Java is a better OO language, since it adapted the C approach of adding libraries instead of syntax to extend the language.

Comments:
I'd be interested to here your responses to the criticisms of C expressed here in the comment by M Simon about 2/3 down.

Personally, I prefer Python and Ruby and only wish to work in C when absolutely necessary.
 
In my field (embedded database systems), C is basically always necessary. It isn't the best language for lowest-level hardware, as Forth fans point out, but C has the important property that the only higher-level language easily available for new or obscure processors is C.

As for Python, I don't do much work in environments where VM-based languages are available (although I have looked at Java some), so I can't really comment.
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?