1. A Quick Introduction to C

What is C?

Simply put, C is a language used by computer programmers to interact with computers in directing computers how to make a simple calculator, or a video game, or an operating system (you can assume Windows 12!) or any other cool (simple/ complex) applications.

History

C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972.

Developed to write the UNIX operating system, this language was a game-changer! Before it, programmers wrestled with assembly language, which was like trying to chat with your computer in hieroglyphics—lengthy, complex, and a nightmare to debug. They needed something more user-friendly to make their lives easier, and voila, this new language came to the rescue!

A Fun fact: C wasn’t always called C! It started as ‘New B,’ an upgrade of the B language. They renamed it C because, well, C comes after B in the alphabet!

Why should you learn C?

The first obvious reason to learn C is if you are enrolled in a high school or university course where there is a course on C language (at least it was the reason for me back in 2018, to be honest). However, C has other specialties that you can not overlook.

As I said earlier, C was developed to write operating systems (OS) code. As a result, C is very fast in its execution (If not, the OS would be slower).

C was brought into light back in the ‘70s when there was not enough memory and processing speed. So, the developers of C had to keep that in mind, which made the C a very lightweight language consequently, as it has only 32 keywords (don’t worry, I will explain what keywords are in my next blogs).

C gives programmers the facilities of high-level programming languages while also providing access to the system level and memory access mechanism more efficiently, which in turns makes C a mid-level language.

The students are encouraged to learn C as it makes the basics of interacting with a computer rigid. As a result, they find it easier to go with C++, Java, Python etc. afterward.

One of the most important benefits of learning C is that all the advanced topics (compiler design, operating systems, computer networks etc.) in Computer Science (CS) are based on C language. If you are pursuing a CS degree and you are not confident in C, then it is no doubt that you will struggle in the coming days. The modern high-level languages hide the machine-level details (CPU cache, memory, adapters) from the user, but in C, you can have a good understanding.

The popularity of embedded systems is increasing, and C is widely used in embedded programming. Imagine a smart thermostat in your home. The microcontroller inside it uses C programming to read the temperature, adjust the heating, and even connect to your smartphone. You’ll also find C in cars, robots, and various hardware devices, making them smart and responsive!

Apart from these, let’s take a look at some applications of C to better understand why learning C is so appealing

  • It’s used to develop browsers and their extensions. For instance, Google’s Chromium is built using the C programming language.
  • C is used to develop databases. For example, MySQL, one of the most popular database software, is built using C.
  • C is essential in developing operating systems. For instance, Apple’s OS X, Microsoft’s Windows, and Symbian OS are all created using the C language.
  • The C programming language is widely used for developing compilers. Many well-known compilers, including Clang C, Bloodshed Dev-C, Apple C, and MINGW, were developed using C.
  • Due to its close relationship with machine hardware, C programming is often considered the optimal choice for scripting programs and developing drivers for embedded systems.