4 ms·
"ask the developers to practice discipline" is a baseline requirement for coding in C
by krupan 1y ago
"ask the developers to practice discipline" is a baseline requirement for coding in C
- pjmlp 1y agoUnfortunately the majority has failed to attend the temple classes on such practices.
- lelanthran 1y ago> "ask the developers to practice discipline" is a baseline requirement for coding in C Sure, but since there's 10x more opaque footguns in C+++, there is much less discipline needed than when coding in C++. The footguns in C are basically signed-integer over/underflows and memory errors. The footguns in C++ include all the footguns in C, and then add a ton more around object construction type, object destruction types, unexpected sharing of values due to silent and unexpected assignments, etc. Just the bit on file-scope/global-scope initialisation alone can bite even experienced developers who are adding a new nonlocally-scoped instance of a new class.
- Loudergood 1y agoIf only.
- EPWN3D 1y agoAnd it hasn't worked in practice. C unfortunately does not have a very big pit of success -- it's way too hard to do the right thing and way too easy to do the wrong thing. The solution to this doesn't have to be "rewrite everything in Rust", but it does mean that you need to provide safe, easy implementations for commonly-screwed-up patterns. Then you're not asking people to be perfect C programmers; you're just asking them to use tools that are easier than doing the wrong thing.