cat sitting in front of the computer
You may not like it, but there is great chance that this cat is also benefiting from the invention of C language.

Why you should learn C?

C is old language, often presented as unfriendly for beginners and boring, but I believe it’s one of the fundamental languages to learn if you really want to get into coding. Regardless of your background as a developer, learning C may become handy for handful of reasons such as:

speed

C is a compiled language, which means it’s turned into machine code before execution in a process known as compilation. Because of that, code written in C is extremely performant in comparison to interpreted languages such as Python or JavaScript, where code is being turned into CPU instructions during runtime in the background. Thanks to granular control over system resources and lack of garbage collector, C is even faster than other compiled languages like Go or C#.

portability

Code written in C can be often compiled to other operating systems and CPU architectures without even changing a single line of code. This is huge benefit for everyone who would like to ship their software to different platforms and operating systems. On top of that, you can run your C program on any CPU architecture as long as there exist C compiler for it, which is often first thing developed for any new CPU.

maturity

C is actively maintained and developed for over 50 years. It’s both old and widely accepted standard for writing code. From coffee machines running embedded C, to GNU/Linux kernel to MRI machines, C is number 1 when it comes to industrial grade software. Thanks to its age there is also whole lot of libraries and tools meant to improve your C coding experience and extend functionality of your programs.

simplicity

C23 (2023 standard for C language) has only 45 keywords. For contrast, Java has 67 keywords and for C++ this number is even higher, with 79 keywords. Keywords are fundamental instructions used to write code in given language, and usually the less of them, the less you have to learn in order to gain full control over given language. Another benefit is the fact that thanks to fewer keywords, C code can be more directly translated into machine code, leading to performance gains.

interoperability

C code can be called from many modern languages like Swift, C++, Python, Go, Zig, Rust, Julia and many more, ensuring that all your libraries written in C can be used in other languages as well. Thanks to this you can write performance-critical code in C while keeping rest of your app’s logic in other languages better designed for given task like Swift for a native iPhone app or Go for distributed cloud software.

fine grained control over hardware

Another great benefit of using C is complete freedom over all operations. There is no garbage collection running on the background or interpreter translating your code during runtime, making C a great choice for writing operating systems and hardware drivers. Gaining ability to manipulate every single byte of RAM memory may be liberating, but in clumsy hands it also may become dangerous. As you might know, with great power comes great responsibility and C is no other here.

summary

If this was enough to convince you, I have great news to you because it’s an introduction to my blog series about C programming! Stay tuned for future posts and don’t forget about proper hydration.

Thanks for reading and see you soon,
Laura