4 ms·
I would recommend that anyone who hires a programmer should test his/her knowledge in C (especially in areas like code that produces undefined or unspecified re
by pksadiq 10y ago
I would recommend that anyone who hires a programmer should test his/her knowledge in C (especially in areas like code that produces undefined or unspecified results), even if the candidate is never going to code in C, ever.
If he/she knows these concepts well, that means he/she have invested much time, and probably know other things well enough (or can learn them easily).
- loup-vaillant 10y agoLet's not confuse low level understanding with the fine points of the C virtual machine, which drifts from whatever platform you are working on by the year. What you really want is an understanding of how whatever code the candidate may write will map to the underlying hardware. Test for that.
- uryga 10y agodo you have any pointers for reading about "the C virtual machine"? i'd love an accessible explanation of how the model of the hardware predented by C differs from actual modern chips, but those keywords make it hard to google for.
- nwmcsween 10y agoThe C virtual machine is described by the C standard, implementations of such do vary which is due to a combination of bugs, vague language and interpretations of the standard. But ask anyone to build a house given 100 pages of text and see what happens.
- loup-vaillant 10y agoWell, like the sibling comment, I can only point to the standard. I'll give one example: the segmented memory model. In C, the difference between two pointers is a valid operation iff they point to the same object (or one slot past it). So it works if it's the same array or malloc() block, but something as simple as int a; int b; ptrdiff_t d = &b - &a; is undefined. Modern computers, including most embedded platforms, have a flat memory model by now, and could implement the operation above without problem. Another difference I know of is signed integer overflow. Most platforms use a 2's complement architecture, where signed overflow simply wraps around. In C, such an operation is undefined. Yet another difference relates to pointer aliasing. On most platform, a pointer is just a pointer to a memory slot. In C, it is assumed for optimization purposes that pointers of different types cannot point to overlapping regions. This prevents practical stuff like type punning, for which you have to use unions.
- jeanlucas 10y agoThat's a problem if the developer never had a C influence. Depending on when you learned to code you may have never touched C.
- drivingmenuts 10y agoHire a Javascript programmer and lemme know how that works out for you. There's no point in testing for C knowledge if they're never, ever going to use it. Sure, they may know some C, but they're not going to have more than a surface, I-recognize-it-when-I-see-it understanding of it.