4 ms·
C is still king in embedded systems. It is also great at making you aware of the machine. In C, very little is happening behind the scene. If you want something
by GuB-42 7y ago
C is still king in embedded systems. It is also great at making you aware of the machine. In C, very little is happening behind the scene. If you want something to happen, you need write some code. Objects will not initialize themselves, allocated memory will not free itself, no smart reference mechanisms, just explicit pointers. This understanding of the machine will help understanding why higher level langages behave the way they do.
But anyways, programming skills is not so much about the language. A good programmer in one language will be a good programmer in any other language very quickly. But still, if I have to hire a programmer for a project in a language he doesn't know, I will tend to prefer C programmers over those who only use higher level languages. The reason is that C programmers may do things that are not pretty, but they usually understand what they are doing, people who are only accustomed to some higher level language may come up with better designs, but write code that make no sense.
- Mike345845 7y ago> It is also great at making you aware of the machine. In C, very little is happening behind the scene. This is not true. It hasn't been true for decades. C is an abstract high level language on modern processors. https://queue.acm.org/detail.cfm?id=3212479 https://queue.acm.org/detail.cfm?id=3212479
- porknubbins 7y agoTrue, but if it is still possible to be a C programmer who can more or less imagine what assembly will be generated (at lower levels of optimization at least) by their C code, then isn't the real issue that x86 assembly abstracts away a lot of hardware info about caches, pipelines, microcodes etc? In that case how can a low level exist on x86?
- UncleMeat 7y agoI'm not sure that's true. There was a highly upvoted post recently on both HN and /r/programming that claimed to have a better sorting algo than libc's sort. After hundreds of comments across both forums, looking into compiler explorer showed that the key difference was inlining. As a C++ person, basically all micro-optimizations start at "look at the damn assembly" since people really suck at predicting what code will actually be generated.
- BubRoss 7y agoHow does inlining happening in C++ mean that the asm in C isn't predictable? Even with inlining the point is mostly the same - there aren't small program changes that lead to big changes in what is generated.
- edoo 7y agoLanguage fluency is very important but real programming is program architecture. Learning C++ or spending time with object oriented paradigms in general will boost your C abilities.
- GuB-42 7y agoI agree with you 100%. Learning an object oriented language will make you a better C programmer just as learning C will make you a better, say, Java programmer. My point is that learning C is definitely worth it. Not only it has real life applications but it will help you become a better programmer in general. But it doesn't mean you should limit yourself to C. Go and Rust are good too, and even the most hated languages (ex: PHP) can teach valuable lessons.
- deleted 7y ago[deleted]
- deleted 7y ago[deleted]