The Resurgence of C Programming

Mike Barlow
4 min readFeb 23, 2017

--

Do you still need to write code to build cool machines and devices?

Embedded software written in C … just kidding!

I was pleasantly surprised to discover that many coders reacted strongly — and mostly positively — to my recent O’Reilly report about the resurgence of the C programming language.

To recap, I noted that learning C was a rite of passage for many students in the 1970s. Today, we don’t usually think of C as a high-level language. But back in those early days, long before the arrival of Java and Python, C was considered high level, especially when compared to assembly languages.

To some degree, C was written for the purpose of elevating UNIX from a machine-level operating system to something resembling a universal platform for a wide range of software applications. Since its inception in 1972, C has been the common language of UNIX, which essentially means that it’s everywhere.

C and C++ are at the heart of Arduino, the open-source project for building do-it-yourself devices and hardware. “Arduino code is essentially C and C++,” says Massimo Banzi, a co-founder of the Arduino project. “Right now, you can write Arduino code on an 8-bit microcontroller and then on an ARM processor. You can go right up to a Samsung Artik, which is essentially a Linux machine with an 8-core processor. We can run Arduino on top of Windows 10.”

Learning About Software by Tinkering with Hardware

How does this play out in the real world? Let’s say you’re an aerospace engineer and you’re asked to improve the functionality of an actuator that moves a control surface such as an aileron on the wing of an airplane. You might begin by using components from an Arduino kit to create a low-cost prototype of the actuator.

After you’ve got your prototype working, you can tinker around with it and optimize its performance. “If you are an engineer, you can take your idea and use Arduino to build prototypes very fast,” says Banzi. “So you might begin with Arduino and then decide the re-implement the code using another tool. But you might also wind up using Arduino all the way. Or you could use a C compiler to move your code to a piece of hardware that doesn’t run Arduino, but will run C or C++.”

Transferring the code isn’t difficult. The hard part, says Banzi, is writing the algorithm that controls the actuator moving the aileron. Fixing the problem with the aileron means you need to develop a new algorithm. Then you need to tweak and adjust your algorithm.

“If it were my project, I would write my Arduino code for the tool and then I would use a pure C or C++ file for my algorithm,” says Banzi. “Once my project is working and I can tweak the algorithm, I would just take the algorithm and paste it into the tool.”

Unforeseen Consequences

In a cosmic sense, Arduino fulfills the vision of C’s creators, who foresaw a world of portable software applications. What they did not anticipate, however, was the emergence of open-source hardware, the maker movement and maker culture.

For the early pioneers of computing, creating functional software was an end in itself. Today, it’s not enough to just create software that runs without crashing. The world wants software that can run devices and machines such as trains, planes, automobiles and pacemakers — without crashing. That puts a lot of weight on C, which is used widely to write embedded software.

“C is the Latin of programming languages,” says Ptah Pirate Dunbar, an open source hacker and professor of computer science. He notes that many commonly used high-level languages are influenced by C through syntax, function, or both. “Learning C empowers developers with the mental flexibility required for transitioning across C-influenced languages with ease and agility.”

‘It’s Like Learning to Drive a Stick Shift’

Edward Amoroso, chief executive officer of TAG Cyber and former chief information security officer at AT&T, says knowing C is handy, but no longer absolutely essential. “You can drive your car to Buffalo and not know how the engine works,” says Amoroso. “I think the analogy holds for software. On the other hand, if something goes wrong or some kind of weird issue arises and you have no understanding of the underlying logic of the software and the hardware, it might be more difficult for you to fix the problem.”

“If you’re programming on bare metal, then it’s helpful to know C. It’s like learning how to drive a stick shift — it gives you more control,” says Amoroso.

Amoroso says he misses the old days when students would actually learn to write code. “Today, much to my chagrin, young people are taught to code using programming environments where they’re moving widgets around and creating little games. They’re basically adding logic to widgets. I’m not saying it’s necessarily harmful, but I’d rather see them learn how a computer operates first, and then build up to writing software. But that’s not the way it’s typically done in schools today.”

If you’d like to read the full report, you can download a free copy here from the O’Reilly website. I’m interested in hearing your opinions about the current state of C and other older programming languages.

Thanks for reading this story! If you enjoyed it, please hit that heart button just below. Would mean a lot to me and it helps other people see the story.

--

--