3 ms·
C++ is so large that choosing the safe subset is completely non-obvious unless you're deeply experience in the language already.
by packetlost 3y ago
C++ is so large that choosing the safe subset is completely non-obvious unless you're deeply experience in the language already.
- bombcar 3y agoAnd with similar knowledge and care, C can also be safe; after all, memory safe languages can be written in C.
- kbolino 3y agoYeah, my thought/question is more about doing so ergonomically. Because C++ has encapsulation and operator overloading, you can make it very ergonomic to write memory-safe code. I think it's very difficult to do the same with plain C. It's probably possible to make it less painful with macros, but doing so builds something more like a DSL atop of C, and would frustrate IDEs that don't understand the conventions.
- MaxBarraclough 3y ago> C can also be safe In practical terms, no, it cannot. Even C codebases held to very high standards tend to have memory-safety issues. > memory safe languages can be written in C That says nothing about the safety of the C language.