3 ms·
Moves can be safe, and copies can be dangerous. C++ is a language that can be used like a sawed-off shotgun propped against a developer's foot, and with a hair
by bcjpjk 9y ago
Moves can be safe, and copies can be dangerous.
C++ is a language that can be used like a sawed-off shotgun propped against a developer's foot, and with a hair trigger. Granted, it does not _have_ to be used this way, but it can be.
A good developer can be "safe by default" and can use profile-directed optimization to speed up areas that are performance critical. A great developer can build proofs that such performance improvements maintain safety guarantees. For the average developer, following modern C++ development practices creates code on par with other languages in terms of both safety and performance.
For most languages, a lot can be done in terms of optimization, profiling, and security. Even in higher-level languages, an FFI is available to rewrite critical portions of code in a lower level language for performance improvements. Careful attention to detail can provide critical performance improvements in any language without compromising on safety. Getting there requires model checking or formal methods, but that is also becoming more of a part of modern development practices.
- pjmlp 9y agoThe problem is that many developers don't care, they just want to do something that works and move on. This is not specific to C++, but it is worse in C and C++ given the nature of these languages. It also doesn't help that management even cares less about QA than those devs.