The C programming language refuses to die.
Category : Blog
As a technology research analyst, I try to keep up the pace with the changing world of technology. It seems like every single day, there is a new programming language, framework, or tool emerging out of nowhere. In order to keep up, I regularly have a peek at the listicles on TIOBE, PyPL, and Stackoverflow along with some twitter handles and popular blogs, which keeps my FOMO (fear of missing out) in check.
There it was, the language which everyone seemed to have forgotten about, C, sitting at the second position, like an old tower among the modern skyscrapers in New York. A quick scroll down shocked me even more: C was only recently named theÂ language of 2017Â by TIOBE. The reason it won was because of its impressive yearly growth of 1.69% and its consistency â€“ C has been featured in the top 3 list for almost four decades now.
C has a design philosophy for the ages
A solution to the challenges of UNIX and Assembly
The 70s was a historic decade for computing. Many notable inventions and developments, particularly in the area of networking, programming, and file systems, took place. UNIX was one such revolutionary milestone, but the biggest problem with UNIX was that it was programmed in Assembly language. Assembly was fine for machines, but difficult for humans.
So, the team working on UNIX, namely Dennis Ritchie, Ken Thompson, and Brian Kernighan decided to develop a language which could understand data types and supported data structures. They wanted C to be as fast as the Assembly but with the features of a high-level language. And thatâ€™s how C came into existence, almost out of necessity. But the principles on which the C programming language was built were not coincidental. It compelled the programmers to write better code and strive for efficiency rather than being productive by providing a lot of abstractions.
Letâ€™s discuss some features which makes C a language to behold.
Portability leads to true ubiquity
When you try to search for the biggest feature of C, almost instantly, you are bombarded with articles on portability. Which makes you wonder what is it about portability that makes C relevant in the modern world of computing. Well, portability can be defined as the measure of how easily software can be transferred from one computer environment or architecture to another. One can also argue that portability is directly proportional to how flexible your software is.
Applications or software developed using C are considered to be extremely flexible because you can find a C compiler for almost every possible platform available today. So if you develop your application by simply exercising some discipline to write portable code, you have yourself an application which virtually runs on every major platform.
Programmer-driven memory management
It is universally accepted that C is a high-performance language. The primary reason for this is that it works very close to the machine, almost like an Assembly language. But very few people realize that versatile features like explicit memory management makes C one of the better-performing languages out there. Memory management allows programmers to scale down a program to run with a small amount of memory.
This feature was important in the early days because the computers or terminals as they used to call it, were not as powerful as they are today. But the advent of mobile devices and embedded systems has renewed the interest of programmers in C language because these mobile devices demand that the programmers keep memory requirement to a minimum. Many of the programming languages today provide functionalities like garbage collection that takes care of the memory allocation. But C calls programmersâ€™ bluff by asking them to be very specific. This makes their programs and its memory efficient and inherently fast.
Manual memory management makes C one of the most suitable languages for developingÂ otherÂ programming languages. This is because even in a garbage collector someone has to take care of memory allocation â€“ that infrastructure is provided by C.
Structure is all I got
As discussed before, Assembly was difficult to work with, particularly when dealing with large chunks of code. C has a structured approach in its design which allows the programmers to break down the program into multiple blocks of code for execution, often called as procedures or functions.
There are, of course, multiple ways in which software development can be approached. Structural programming is one such approach that is effective when you need to break down a problem into its component pieces and then convert it into application code.
Although it might not be quite as in vogue as object-oriented programming is today, this approach is well suited to tasks like database scripting or developing small programs with logical sequences to carry out specific set of tasks.
As one of the best languages for structural programming, itâ€™s easy to see how C has remained popular, especially in the context of embedded systems and kernel development.
Applications that stand the test of time
If BeyoncĂ© would have been a programmer, she definitely might have sang â€śWho runs the world? C developersâ€ť.
And she would have been right. If youâ€™re using a digital alarm clock, a microwave, or a car with anti-lock brakes, chances are that they have been programmed using C. Though it was never developed specifically for embedded systems, C has become the defacto programming language for embedded developers, systems programmers, and kernel development.
C: the backbone of our operating systems
We already know that the world famous UNIX system was developed in C, but is it the only popular application that has been developed using C? Youâ€™ll be astonished to see the list of applications that follows:
The world desktop operating market is dominated by three major operating systems: Windows, MAC, andÂ Linux. The kernel of all these OSes has been developed using the C programming language. Similarly,Â Android,Â iOS, and Windows are some of the popular mobile operating systems whose kernels were developed in C.
Just like UNIX, the development ofÂ OracleÂ Database began on Assembly and then switched to C. Itâ€™s still widely regarded as one of the best database systems in the world. Not onlyOracleÂ but MySQL andÂ PostgreSQLÂ have also been developed using C â€“ the list goes on and on.
What does the future hold for C?
So far we discussed the high points of C programming, itâ€™s design principle and the applications that were developed using it. But the bigger question to ask is, what its future might hold.
The answer to this question is tricky, but there are several indicators which show positive signs.Â IoTÂ is one such domain where the C programming language shines.
Whether or not beginner programmers should learn C has been a topic of debate everywhere. The general consensus says that learning C is always a good thing, as it builds up your fundamental knowledge of programming and it looks good on the resume. ButÂ IoTÂ provides another reason to learn C, due to the rapid growth in the IoT industry. We already saw the massive number of applications built on C and their codebase is still maintained in it. Switching to a different language means increased cost for the company. Since it is used by numerous enterprises across the globe the demand for C programmers is unlikely to vanish anytime soon.