Why I use C in 2025
In recent years, the Rust programming language has taken over the programming community with its appealing features, most notably memory safety. For this reason, there is a huge movement of people rewriting everything in Rust including tools like GNU's coreutils, grep and even some drivers in the Linux kernel. If we take a look at some of these new rewrites, most of them are actually more performant than their older C alternatives. So is C useless? In my opinion, no.
Why Rust rewrites are faster
Let's take a look at ripgrep: their benchmarks show how in some cases GNU grep is 10 times slower. But how is it possible? Well, simply put, Rust makes it way easier to create "concurrent" software thanks to libraries such as crossbeam and ripgrep makes extensive use of this while grep is single threaded. Not only that, GNU grep was designed in the late 90s when available hardware was very different from today's computers and thus it was designed with that hardware in mind. On the other hand ripgrep uses SIMD and other x86 extensions to accelerate the searching algorithms.
All of this can be done also in C, it's just more complicated since there is no such thing as crossbeam nor all the abstractions Rust provides.
Why should you use C
With that being said, one could ask "why should I bother with C" and that's a valid question. In my opinion, C has some advantages that other languages just can't reach by design, for example:
- C is simple. Take a look at C++, its standard library is one of the most complex and the language itself has a lot of concepts to take into account while writing code. Same goes for other complex languages such as Java, C# and Rust.
- C gives you control. I like to be able to control every aspect of my code, even if some people could claim that's unsafe. Compilers like the Rust one are smart and can catch many different issues for sure, but I think that any experienced programmer often knows better and might want to do some tricks that improve the performance of the program without being contrained with complex abstractions such as borrowing.
- C is safe. Memory safety is not exclusive to Rust. Applying good practices isn't difficult since the basic rules are just free whatever you allocate and handle cases where the program could exit without freeing, using
goto
in the same way some languages like Zig and Go usedefer
. - C is stable. The first version of the C programming language came in the 70s as a companion for the UNIX operating system and it's widely adopted even today since most low level work (but not only that) still relies on it (graphics APIs, kernels, firmwares...) and with over 50 years of history its ecosystem is very mature and modern compilers can produce very good quality machine code for many architectures.
- C is here to stay. Being so simple, implementing a C compiler is a task anyone could do at any point so we can be sure that software written in C (standard C, not using all the GNU bullshit extensions) can probably run in 10 years or more from now without many changes.
So are other languages useless?
No, other languages are not useless as most languages (no, not you JavaScript) can be used to achieve similar results and everyone has their preference on the matter. I wrote this post in defence of C since nowadays I keep hearing that we should all stop using it [1] [2].