Getting to know the C programming language

The C programming language is used to run everyday objects like your TV remote control and your microwave. It is the soul of embedded systems and Jaimie Stevens explains why learning C should be part of your coding arsenal.

269
Image – Shutterstock
WorkingNation’s Jaimie Stevens.

Developed by Dennis Ritchie between 1963-1973 in the Bell Labs to re-implement the Unix operating system, C has become one of the most widely used programming languages of all time. It’s C compilers are available for the majority of computer architectures and operating systems.

Initially developed for system development work because it produces code almost as fast as the code written in assembly language, examples of where you might use C today besides operating systems are in language compilers, assemblers, text editors, print spoolers, network drivers, modern programs, databases, language interpreters and utilities.

Often referred to as a “middle level” programming language because of its capability to combine benefits of both low-level machine languages and high-level developer friendly languages, C finds application across every domain in the programming world. Many languages have borrowed from C, such as C++, C#, and C-objective, as well as D, Go, Java, JavaScript, Limbo, LPC, Perl, PHP, Python, Rust and Swift. Most of these are very syntactically similar to C in general and apply the expression and statement of C with underlying type systems, data models and semantics that can be radically different.

Embedded C Programming is the soul of the processor functioning inside every embedded system we come across in our daily life. Embedded systems are like small computers that have a microcontroller/microprocessor inside that is running a program, called firmware, on embedded devices. I’ll explain the significance of that below — keep reading!

What are some characteristics of C?

C is considered a general-purpose (used in a wide variety of application domains), imperative (consisting of commands for a computer to perform), static typing (type checking done at compile time) programming language that was designed to use a straightforward compiler, require minimal run-time support, and encourage cross-platform programming (i.e., it can be used by Microsoft Windows or macOS). It is considered easy to learn, structured, efficient and able to handle low-level programs.

C uses basic commands in English, which makes it an easier language to understand. This is why you have to run it through a compiler, in the end, to transfer the human-readable form into a machine-readable language.

C allows you direct control over the very “bare bones” of the computer.

C implements algorithms and data structures swiftly, which allows for faster computations in programs.

What are some real-world uses of C?

As mentioned above, C is the queen of the embedded system world. Embedded systems are used constantly in our every moment. The alarm clock that wakes you up is programmed in C. The microwave or coffee maker that you use at breakfast use C. Say you turn on your TV or radio to catch the morning news — those are also powered by C. Then you open your garage to leave for work — that remote you’re using is also using C.

Does your car have automatic transmission? Cruise Control? Sensors that determine oxygen, temperature, and oil level? Airbag control? Dashboard display? Memory for seats and mirror settings? Anti-lock brakes? Automatic stability control? Child-proof locks? Tire pressure detection systems? Climate control? Keyless entry? Heated seats? All C!

Say you want to buy a soda from a vending machine. Or pay for something at a cash register with your credit card. That’s right — probably C.

RELATED STORY: Rules to live by when writing code

Real-world uses of C include operating systems and developing new languages (as mentioned above), facilitating faster computations which enable higher calculations for programs like MATLAB or Mathematica, and the development of graphics for gaming applications like chess, bouncing ball and archery.

Here are some operating systems that are powered, at least partially, by C: Microsoft Windows, Linux, Mac, iOS, Android, Windows Phone, Oracle Database and MySQL.

3-D movies are commonly written in both C and C++, because they need to be efficient and fast to save the time of artists and animators generating movie shots and to spare money the company saves.

What are some advantages of C?

C has been around for 30 years and as a result, there is a lot of source code available, giving you plenty of libraries to work with, a community to draw from and a lot of tutorials at hand.

Because C is so “close to the machine” in a computer, you can really get familiar with what’s under the hood and this will give you a better understanding going into any of the other many languages that stem from C.

The C programming language does not seem to have an expiration date like so many other languages do. The world is running on C-powered devices. Whereas some languages suggest that you learn other languages alongside them because there is no guarantee of how long they will last, C is considered a foundation language.

What are some disadvantages of C?

C is sometimes criticized because it leads to the belief that the programmer is always right, and allows many programming practices that could be questioned.

C is very precise and will require you to define every variable with a Type, and not let you change it.

What kinds of skills does becoming a C developer entail, and how much do they make?

A common job description for a C developer will require them to develop embedded systems and high-level languages, and study the APIs of those environments and apply their C skills to developer modules that are reliable and easy to maintain. Like any programmer, they must be able to implement performance and quality modules, identify bugs and come up with solutions on how to solve them and be able to maintain code quality and automatization.

In order to do these things, one should at least have a thorough understanding of what libraries are available, familiarity with embedded systems design and low-level hardware interactions, knowledge of component data sheets and specifications and familiarity with language and code versioning tools. Having experience with system call wrapper library functions helps as well.

The median wages that C developers make is $74,994, with the low of $49,310 and the high of $118,666.

This article is part of WorkingNation Associate Producer Jaimie Stevens’ “Starting Out in Tech” series where she shares her insight into becoming a computer programmer. Catch up on her previous articles here.

Join the Conversation: Share your thoughts on the latest Starting Out in Tech column on our Facebook page.

Facebook Comments