2 ms·
I have been coding in straight C lately on an embedded personal project and have loved it immensely. I know what is going on and have a good shot at predicting
by retro64 10y ago
I have been coding in straight C lately on an embedded personal project and have loved it immensely. I know what is going on and have a good shot at predicting the resulting assembly.
However, for me, C falls down on large projects. I know there a lot of hate on objects lately, but the complexity of a project decreases while the maintainability increases when you use properly designed interfaces. You “force” the new guy to do it right because the interface makes it obvious. I know there are ways to enforce encapsulation with C, but I’ve never worked on a (large) codebase where this has been successful.
- Keyframe 10y agoObjects are in C as well, with structures. You can do abstraction like that in different ways in comparison to classes. For example, components are common. Difference being that objects are components, but not all components are objects. Also function objects, aka functors. I try to organize into specific components and piece them together into a sequential or threaded or both model, depending on what I do. Of course, it is specific to what I do. But there are large C projects that are successful - for example, Linux kernel.
- pjmlp 10y agoAnd yet, in spite of all code reviews, they just got an use after free exploit this week and the CVE database is full of exploits due to memory corruption.