3 ms·
Everyone in these comments mentions C and C++ as a single word, which frankly has nothing to do with reality. C++ is a FAR safer language than C, if you wish to
by dxuh 5y ago
Everyone in these comments mentions C and C++ as a single word, which frankly has nothing to do with reality. C++ is a FAR safer language than C, if you wish to use it properly (which many don't). I write C++ full time at work and I also use it a lot in my free time and I rarely if ever have out of bounds accesses, use after free or any of these bullshit errors. If you use modern C++ and AdressSanitizer and don't do anything too "fancy" then it's very hard to get those types of bugs. I firmly associate them with C and C alone. These time are over for modern C++. The people commenting here clearly have no idea what modern C++ even looks like.
- hawski 5y agoAs much as like C and dislike C++ you are right.
- eandre 5y agoThe problem for modern C++ is that few (or zero?) code bases contain exclusively "modern C++" when you include all transitive dependencies. You end up using a huge amount of C and "legacy C++" just by virtue of reusing code.
- snovv_crash 5y agoThis is true for Rust as well though.
- pjmlp 5y agoBecause even companies like Microsoft and Google don't write modern C++, you can easily validate this on their public repositories. See how much modern C++ you will find in AOSP and NDK, WinUI or XBox code samples. Modern C++ exists only at talks in CppCon, C++Now.
- x4e 5y agoC++ can be safer but that does not mean it is safe. The fact you have out of bounds accesses, even if it is rare, is not really acceptable in a language that would like to be considered “safe”.