The tool matters. It's more effort and more error-prone to manually ensure your malloc's and free's are always matched 1:1, that you always initialize your data before use, clear your stale pointers, and we haven't even gotten to bounds overruns.I'll never give up C. Malloc() and free() and I have been best buddies for decades... Stop blaming the language. It's the people that are the problem. KISS Principle rules!
In my opinion, the worst thing about C is the poor support it provides for writing generic, reusable data structures and algorithms. The result is programmers continually reinventing the wheel, but nearly always doing a substandard job of it. Due to laziness and/or ignorance, C programs often utilize inferior algorithms, inferior/buggy implementations, or (often) both. This makes it even harder & more laborious to use well - at least for anything serious.
No, C really isn't a memory-safe language. The only way C++ even gets close to being memory-safe is through of good style, which includes rigorous use of standard library facilities designed to improve memory safety.Uh... C and C++ can be "memory safe" if you program like that.
Last edited: