Marcin Bunsch

Lead Software Dev at Groove

< Back to home

C is truth

In a recent article, provocatively named Death to C, Jon Evans proclaimed that we should no longer use C, rather move to Rust for our low level needs.

The author proposes replacing C with Rust, which looks like a great tool to get awesome performance in a production application and sleep well at night not worrying about a segfault, which a tremendous advantage. He also wants to put C and C++ to rest:

Those old warhorses have served us well, but today they are cavalry in an era of tanks. Let us put them out to pasture and move on.

I understand not wanting to hand-write C code in production to minimise risk, but not abandoning it completely. Studying C gives you - as a developer - enormous benefits and skipping it is a mistake. In the introduction to Learn C The Hard Way, Zed Shaw has brilliantly explained why C:

The C programming language's only failing is giving you access to what is really there, and telling you the cold hard raw truth. C gives you the red pill. C pulls the curtain back to show you the wizard. C is truth.

Of this quote, I especially like the "truth" bit - three words, with which Zed has captured the essence of C. It is a simple and elegant language, so simple that you hit the walls of gigantic complexity very early on, because you need to do the basic things yourself. It’s extremely difficult to write good, secure C code, which makes it very dangerous, and to quote Zed again:

Why use C then if it's so dangerous? Because C gives you power over the false reality of abstraction and liberates you from stupidity.

C is the sharp, hurtful reality of how a computer really works, how memory is manipulated and how you’re really just moving bits around. Instead of avoiding it, let’s embrace it. C is difficult, because C is truth.