C: The immortal programming language

By Michael Barr

CTO and Software Expert Witness

Barr Group

February 26, 2018

Story

A longitudinal study of survey data spanning almost a decade and a half shows that C remains the primary programming language of embedded software.

Barr Group’s 2018 Embedded Systems Safety & Security Survey is now closed and I am in the midst of analyzing the data. This year, a portion of my analysis is focused on multi-year trends. One trend that really stands out to me is that the C programming language refuses to give up the fight. This is especially interesting given the increasing popularity of more modern languages in almost all other applications of computer science.

A longitudinal study of survey data spanning almost a decade and a half shows that C remains the primary programming language of embedded software. In that time, C has actually gained market share from 50 percent to about 70 percent – at the expense of assembly, C++, and Java.

The graph below shows the relevant data from 2005 through 2018. The first decade of this data is drawn from annual surveys published by the publishers of Embedded.com with the most recent data coming from Barr Group’s annual survey. Each of these surveys of embedded systems designers phrased the relevant question similarly: it was either, “My current embedded project is programmed mostly in [pick one],” or, “What is the primary programming language for your current project? [pick one].”

It makes total sense that the use of assembly as a primary programming language is falling. The last time I wrote an embedded program mostly in assembly was about 20 years ago. Of course, there will always be some low-level code that needs to be written in the native language of the machine – if only to bring up the higher-level language execution and for drivers and kernel code. But with inexpensive (and mostly 32-bit ARM-based) microcontrollers increasingly at the heart of our systems, there’s no sense wasting time coding the application code in assembly.

We can attribute about seven percentage points of the growth in use of C to the reduction in use of assembly during these years. This trend has helped use of C grow to about 60 percent. But what’s also been happening in this time is that C++ has failed to capitalize on earlier gains. The peak year for C++ use was apparently 2006, when it had 33 percent share. Use of C++ as the primary language has since fallen and thus added about 10 percentage points to use of C.

I didn’t include Java in the graph, but its use has been less common than assembly in every survey year, with high points of 3 percent and now down around 1 percnet the last three years. And no other language has emerged to maintain greater than 1 percent share.

What I make of all of this is that C remains the most cost-effective way to write embedded software. In hindsight, object-oriented languages have been tried but failed to establish their value to most programmers. C++ is a player, but looks unlikely to ever eclipse its namesake.

Michael Barr is the co-founder and CTO of the embedded systems consulting firm Barr Group.  With over a decade of software design and implementation experience, he is also a former adjunct professor of electrical and computer engineering and the author of three books and more than 60 articles and papers on embedded systems. 

Barr Group co-founder Michael Barr is a former adjunct professor of computer engineering with more than twenty-five years of experience in the software industry, including over a decade spent developing software for embedded systems. Mr. Barr is the author of three books and more than seventy articles and papers about embedded software design and architecture and has testified more than twenty times before judges and juries.

More from Michael