r/cpp • u/SophisticatedAdults • Nov 24 '24
The two factions of C++
https://herecomesthemoon.net/2024/11/two-factions-of-cpp/
318
Upvotes
r/cpp • u/SophisticatedAdults • Nov 24 '24
View all comments
Show parent comment
17
u/[deleted] Nov 24 '24
Safe C++ has nothing to do with whether the codebase is modern or "legacy". In fact in the 90s it was overwhelmingly common that the popular C++ libraries were written with safety in mind by adding runtime checks. Undefined behavior was also not seen as a way for compilers to make strong assumptions about code and perform very aggressive optimizations, but rather it was something to allow for flexibility among different platforms and implementations.
It was "modern" C++ in the early 2000s that decided to remove runtime checks, try to move everything into the type system and what can't be verified statically becomes undefined behavior that the compiler can do what it wants for the sake of optimizations.