embedded software boot camp

Embedded Programmers Worldwide Earn Failing Grades in C and C++

Tuesday, November 24th, 2009 by Michael Barr

In industry surveys, over 80% of embedded software developers report using C or C++ as their primary programming language. Yet as a group, these programmers earned a failing grade on a multiple-choice quiz testing firmware-related C programming skills. A scary result, considering that embedded software inside medical devices, industrial controls, anti-lock brakes, and cockpits place human lives at risk every day.

In a February 2008 blog post, I examined the first few hundred results from the “Embedded C Quiz” on the Netrino website. That analysis compared the performance of programmers in the U.S. and India with the rest of the world (the only three data sets large enough for meaningful analysis). I concluded that the average embedded programmers in the U.S. and India don’t know C very well, but do know it better than programmers in the rest of the world.

Two years now since launching the quiz, we have collected thousands of data points, so it’s time for an update on programmer performance. In total, 3,870 programmers have taken the short 10-question multiple-choice C skills test. A few (a bit less than 3%) didn’t answer all of the questions; the analysis below is based on just the 3,755 completed quizzes. (Note that each website user can only take the quiz once.)

Across all countries, the mean result was 60.8%–a grade of ‘D-‘ at best. That is to say that the average embedded programmer answered just 6 out of 10 multiple-choice questions correctly. A rather scary fact, given that C is the language of choice for most embedded projects and that C++ is even harder to master.

Programmers in the United States scored slightly above average. But they still earned a failing grade of 61.8%. Programmers in India scored slightly below the worldwide average, at 58.9%. Together, programmers from these two large English-speaking countries accounted for the majority of all quiz takers.

The number of completed quizzes, mean scores, and standard deviations for all countries with more than 20 completed quizzes are shown in the table below, sorted by average score. In general, programmers from European countries scored best.

Country Completed Mean Std Dev
Poland 23 68.7 19.2
Sweden 26 67.7 15.8
Australia 45 67.3 22.3
Germany 57 67.2 17.2
France 35 66.9 24.0
United Kingdom 109 66.1 22.8
Spain 24 65.0 18.3
Canada 114 64.5 19.3
China 51 64.1 23.4
Israel 22 62.3 21.7
United States 1346 61.8 20.4
Egypt 28 59.3 22.8
India 1288 58.9 22.4
Romania 45 58.9 23.0
Singapore 24 58.3 20.1
Italy 44 56.4 20.8
Turkey 57 55.6 23.3
Brazil 47 55.1 24.1
Pakistan 25 44.0 21.7

How are your embedded C programming skills? Test them by taking the Embedded C Quiz yourself now at http://www.netrino.com/Embedded-Systems/Embedded-C-Quiz?

P.S.  We recently launched an Embedded C++ Quiz and the results so far look downright abysmal.  I’ll write something about that in a future post.  Do you have a few minutes to take that one too?

Tags: , , , , ,

6 Responses to “Embedded Programmers Worldwide Earn Failing Grades in C and C++”

  1. Anonymous says:

    Hello Michael,I am one of the embedded developers who did not do well on your test, and I thought you might be interested in some of the "whys" of this result.To give you some background – I have been programming 8-bit micros as part of my product design efforts (I program the uC's for my projects, butr I'm not a professional programmer, obviously!) since the late 70's. Virtuall all of my programming knowledge has been self-taught (I have not taken any programming classes). Initially, I started with machine code (on an old KIM-1, using a MOS Technology 6502), assembler (Motorola 6800/6802, 6809, HC05, HC11), and finally, "C" (HC05, HC11, PIC, and Atmel AVR). All of my experience has been on "small" systems. None of my projects has used up more than 16K of code, and most use less than 2K. I use "C" primarily as a glorified assembler, as I have to get down to the bit level in most of programs. Almost all of my variables are global, because the values contained therein need to be accessible to the various functions. Most code is predominantly interrupt driven, and is very "real time". Certain interrupts cannot have more than a couple of microseconds of latency, so I have to juggle things around to make sure that this occurs as required.I virtually never use pointers – I just access arrays of char or int as required using the normal indices.In looking at the questions on your quiz, many refer to things such as #define statement syntax or pointer declarations that I just have never used.Also – questions regarding compiler variations are completely outside of my area of experience. I have used one compiler (IAR EWB) for the past 10 years or so, because it works well & I've had no reason to change. Since I almost never use qualifiers such as static, volatile, etc (since virtually all my variables are volatile, I suppose) I really have no idea whether or not a compiler would allow a variable to be declared both ways (such as volatile & constant – it seems a bit contradictory).I don't use "modules" (to tell you the truth, I am not copmpletely sure what you mean by that) my only concern about static variables is what pertains top their use within a function.At any rate, you can see that I probably don't fit your definition of an embedded programmer very well – perhaps I'm better described as an engineer who programs, but I have written some pretty good, stable code over the years.

  2. Michael Barr says:

    I recently wrote a more up-to-date and thorough analysis of these quiz results in a column for Embedded Systems Design magazine. The URL for that is:http://www.embedded.com/columns/barrcode/222300586

  3. William says:

    Food for thought on why C skills are lowerConsider Myself Average EE16 Semester Hrs College work in Assembly Language — Have written whole small accounting systems, avionics, other applications(mostly in Assembler)1 Semester Hr in "C"(Struggled trying to make C work before there were 8bit "C" compilers that really were worth anythingnot even anywhere as good as SDCC now)2 week seminar in C++(If you limit what you use in this language — it can work for embedded — but probably could have done the same things in Assembler without learning a whoole new language and done it with an 8051 instead of a PowerPC)

  4. Anonymous says:

    "You got 10 of 10 correct. Your score: 100% Congratulations! You passed Netrino's Embedded C Quiz."There were two that were tricky and obscure. There were also two that I wouldn't expect non-embedded people to know. It was a good test.

  5. fileoffset says:

    Anyone that gets more than 5/10 correct is very good at C++, anything more than 7/10 and I dub thee a C++ expert.

  6. Vaibhav Garg says:

    With respect to your analysis on Embedded.com on the demographies of results, there is a fundamental problem with the quiz that might render all location data irrelevant. The default location is the USA, which many might not have bothered changing. At least 2 people didn't, and they sit right next to me in India.

Leave a Reply to Michael Barr