So maybe people just couldn't use their damn webapp.
Several of their questions:
Which of the following is the most portable way to declare a C preprocessor constant for the number of seconds in a (non-leap) calendar year?
#define SECONDS_PER_YEAR 60 * 60 * 24 * 365
#define SECONDS_PER_YEAR 60 * 60 * 24 * 365;
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365UL)
#define SECONDS_PER_YEAR (60 * 60 * 24 * 365)
Which of the following is the most flexible way to declare a C preprocessor macro that takes two arguments and returns the smaller of their two values? #define MIN(A, B) ((A) < (B) ? (A) : (B))
#define MIN(A, B) { if (A < B) A; else B; }
#define MIN(A, B) ((A < B) ? A : B)
#define MIN(A, B) A < B ? A : B;
Which of the following constructs can be used to create a portable infinite loop in C? while (1) { ... }
for (;;) { ... }
loop: ... goto loop;
All of the above
And then they asked a question which says "what was the intended effect of [some terribly misleading line of C]" and I became fed up, because I have no idea what the intent was, even if I could figure out the actual behaviour.Most embedded C devs know what "volatile" does, because if you get that wrong your program crashes.
Very few developers know how to craft hygenic cpp macros, but since the question didn't ask about hygiene, I wouldn't expect anyone to feel like they should "look it up". You kind of either know it or you don't.
If anything, the problem with this quiz is that it was far too superficial.
I really dislike questions like "Most portable", etc where you have to answer what you know they want you to rather than say "I don't know how good all compiler compliance is in this respect, I suspect most do it fine, but c-compilers vary widely in quality, would you really like me to go research the standard and find out how good compliance is with respect to this behavior?"
Portability is only a concern for a subset of embedded programmers, whereas most of the other questions are a concern for most people.
Ditto for the multithreading operation item (Although I suppose most embedded programmers have ISRs at least to deal with).
In general, the author of the article is completely misinterpreting the test results which answer:
How well are embedded programmers at passing a test which involves esoteric declarations, overly detailed knowledge about compiler compliance and general portability questions probably in excess of what you worry about in any embedded design position, and otherwise designed to be beyond the experience of most practitioners in the field?
The use of a grade school grading scheme for the test is juvenile at best. They are VASTLY underrating the embedded developer pool.
For single platform coders, especially working on largely modern code, 6/10 is a fine score.
People who write for single platforms have no reason to be good at the portability questions. People who write for single platforms have no reason to be good at the compiler compliance questions. People who do not work on old code without "don't be tricky" condemnations have no reason to have memorized esoteric declarations of C variables which aren't commonly used.
Anyone who wanted 80-100% scores for MOST embedded positions would be completely wasting their companies money on overly expensive engineers. Only companies which have a multi-threaded legacy codeset which is designed to be compiled on unknown systems, running on multiple processor machines actually needs all the knowledge the test tests for, and if the company has good code reviews, such as all the "oh no" cases the article writer put out there, only SOME of the staff needs to know all these things, the rest can learn them in code reviews.
In the whole survey, I found one question that was actually relevant and specific to writing C in embedded environments: when do you declare a variable volatile. The answer was "All of the above".
So yeah, not a good quiz.
There is one thing Hacker News has to learn from this article: silly little quizzes like this have spectacular PR value relative to the amount of effort they take to generate.
An interesting quiz, certainly. The problem is that the article contains no suggestions for the question asked: why?
(Well, thinking about it, where do you find proper programming education?!)
(By the way I've never programmed in C - got 7/10 ?!)
I realised that 365UL would make 16-bit machines happy. I haven't worked on such one from a long time.
I also make a mistake on int (*a)[10], and I had no idea about "volatile const".
I think these kinds of "standardized" tests only make sense when the results are normalized against the population of test takers. That most embedded software developers received a D- only tells us that a combination of the performance of the test and the performance of the test taker was poor.