Intro to C

A quick introduction to the history and significance of C.

Johnson Tang

The computer programming language C was one of the earliest programming languages created. Developed by American computer scientist Dennis M. Ritchie at Bell Laboratories in the early 1970s, it was actually first designed for writing operating systems for minicomputers. It was based on an early programming language called "Combined Programming Language", which was first condensed into another language called B.

A visual depiction of the compilation process of C code.
C code on an old code editor with C written in the middle.

C is considered a low-level programming language, meaning that the process of turning C code written by humans into machine code readable and executable by computers is very short, requiring little steps. Firstly, the code is passed through a preprocessor, which removes comments. These are lines of codes that developers put inside their code in order for code to be easier to understand and more readable. Next, the preprocessor looks for any file inclusion instructions, meaning that it will look for instructions in the code that ask for the contents of other files to be included. This is to import functions (a chunk of code is stored for regular reuse) written by developers that you can use in your code. Following, a compiler turns the C code into Assembly, an even older language and an even lower-level language. The compiler also optimises the code, to make it run as smoothly and efficiently as possible. Once this is complete, the assembler turns the assembly code into 1s and 0s readable by the computer, called machine code. Finally a linker links everything into one executable file. Although it seems like there are already a lot of steps from human code to machine code, it is actually very few steps in terms of programming languages. Languages like Python and Javascript require many more steps to be executable by the computer.

A visual depiction of the compilation process of C code.

Despite this, C code is still very easily readable and the language strikes a good balance between computer efficiency and human readability. This factor combined with the fact that C was designed for system programming, meant that it was a perfect fit to write UNIX, an early operating system that introduced groundbreaking features that are still used today. The UNIX operating system eventually led to the development of Linux, a versatile and open source operating system that is used in many systems today.

A colourful photo with the Linux logo in the middle with other computer-science related images in the background.

Furthermore, important code libraries were also built in the C, as the low level nature of the language meant vastly greater speed when running code.This contributes to C’s lasting popularity as C is still extremely relevant, being the second most popular computer programming language.

The 3rd most popular language, C++, is also a superset of C, meaning that all of C’s functionality is included with C++, with added features. The most prominent one is object oriented programming, or OOP, which allows programmers to create classes, which have a blueprint of values and behaviours, and to create objects, which are instances of classes and inherit the values and behaviours of the blueprint but often include tweaks and changes. This also means that all C code is also valid C++ code, however it does not work the other way around.