In Defence of C
Some of the criticism of the Blogging Horror article was based on my insistence that knowledge of the C language is essential for all software developers. Some even said I was “bigoted” for such a viewpoint, because there are many other worthy languages out there. And there certainly are. But they are not all created equal.
I had tried to explain my reasons for C’s special place in my list, but maybe I was not clear, so let’s try again.
Here’s the thing: C is everywhere. Recently Tim Bray made basically the same point; all the major operating systems, all the high-level language runtimes, all the databases, and all major productivity applications are written in C. And there are many other categories of software that I haven’t even mentioned, all written in C.
So can you as a developer choose to ignore it? Live in high-level language land for your entire career? I would say almost certainly not. High-level languages often provide abstractions that relieve you from the burden of dealing with the platform on which you’re building. Which is great, but sooner or later a crack is going to open up and the abstraction is going to leak.
Some day you’ll need to go spelunking into the depths of your runtime environment. Maybe you’ll need to call some other C-based API for which you don’t have a convenient wrapper in your high-level language of choice. Like, say, mmap-ing a part of a file instead of the whole thing. Or maybe you’ll just want a bit of a performance boost. And on that day, boy will you wish you knew C.
It’s for this pragmatic and entirely non-bigoted reason that I promoted C to the top of my language pantheon. If you’ve never learned C, it means you’ll never be able to delve too deeply into the foundations your programming environment and find out exactly what is happening under the surface, or to extend it in any way.
Of course there are many other reasons to learn C, such as those discussed in comments previously, but this is main reason why it’s on my essentials list.
50 Comments