In Praise of C

I’ve been lucky to spend almost my entire career working in C. These days, I do more Lisp but for many years, C put bread on the table. Like all earthly things, C is starting to suffer a decline in popularity if not in use. There are many reasons for this. Some of them are stupid: “C is used only by old fogey gray beards and why should I waste my time on that when I can use this shiny new scripting language? Besides, who needs to get close to the machine these days?” One often hears similar remarks about Emacs.

But there are good reasons too. Memory management in C is a mine field and famously able to generate errors. As Perry Metzger says, C also has a large body of undefined behaviors that are apt to bite even the most careful programmer. Still, I love C and enjoy using it. Many folks feel the same.

One of those folks is Christopher Thomas who devotes a post to explaining why he loves coding in C. His reasons are mostly that C lets him get close to the machine when he needs to and that gives him a feeling of power in his programming. His other main point is that C serves as a model for most other “modern” programming languages. C is, he says, an Ur-language.

Many, many years ago most software was written in assembly language and programmers—despite importuning from management—were loath to give it up. A significant reason for C’s ascendancy was the fact that it was the only language that programmers would use without cheating and dropping back to assembly. Current C programmers probably have similar feelings and will only reluctantly be dragged into safer languages.

This entry was posted in Programming and tagged . Bookmark the permalink.