Why Learn C?

Last Edited: 7/1/2024

I am writing this blog for me to come back at this and re-convince myself to continue learning C.

C

Since its creation in 1972 by Dennis Ritchie, C has been a cornerstone in the development of various areas, including operating systems, kernels, embedded systems, compilers, databases, browsers, and applications. However, is it really worth learning C in 2024? Let's look at what C is to answer this question.

Close to Metal

C is often described as a "close to the metal" language, meaning it operates at a lower level of abstraction, nearer to machine code. This proximity to hardware provides developers with greater flexibility in manipulating memory directly. However, this also means that C requires more manual handling of memory compared to higher-level languages that offer automatic memory management. The low-level nature of C can make code more complex and time-consuming to write and read, which can deter some developers. Additionally, C lacks the type safety features found in many modern languages, which can lead to more (often cryptic) programming errors if not managed carefully.

Procedural/Structual Programming language

C is fundamentally a procedural language, which means it relies on a structured approach to programming through procedures or routines. It emphasizes a clear sequence of instructions to perform computations, making it straightforward and efficient for certain types of tasks. C is also a structured language, promoting modularity and code reuse through the use of functions and blocks of code. This structured approach enhances readability and maintainability of the code.

However, C is not an object-oriented language, which some might consider a drawback given the popularity of object-oriented programming (OOP) in modern software development. C++ was developed as an extension of C to incorporate object-oriented features and other useful capabilities. As a result, C++ has become widely popular in both academia and industry, particularly for operating systems, kernels, and system programming.

Why Learn C?

In summary, C is old, hard to write, hard to read, and not object-oriented. Even if you need to manipulate memory manually for developing operating systems and kernels, we have other languages like C++ and Rust. Then, why would you even learn C?

Firstly, it is still one of the most widely used programming languages. Desipte its age, it remained relevant in many areas of computer sicence. Secondly, it also serves as an excellent stepping stone to learning C++, which builds upon C with additional features and capabilities. Lastly and most importantly, it helps developers understand what happens under the hood of the high-level languages they often use. By grappling with the low-level details of memory management, pointers, and other fundamental concepts, developers can gain a deeper understanding of how computers work, which can make us better programmers, even when we primarily write in higher-level languages.

Conclusion

I might not recommend this language for begginers as it is generally hard to write and read. However, as someone who aspires to be a better programmer and is interested in system programming and embedded programming, learning C is a logical and beneficial step. Its enduring relevance and foundational importance in the field of computer science make it a valuable skill to acquire. I am excited to start laerning C and share my journey with you all.

Resources