4 ms·
This is where C++’s fanatical commitment to backwards compatibility really helps. You can bring your C++98 code and compile it with the latest compiler in C++2
by RcouF1uZ4gsC 6y ago
This is where C++’s fanatical commitment to backwards compatibility really helps.
You can bring your C++98 code and compile it with the latest compiler in C++20 mode and it should still work.
This allows you to upgrade (and learn) incrementally. You can slowly incorporate new features into an old code base.
- Rochus 6y agoThat's one of the best features of the language; I would rather call it "reasonable and conscientious" than "fanatical".
- CyberDildonics 6y agoThey meant fanatical in the sense that they are dedicated, not unreasonable.
- leetcrew 6y agoit's a double edged sword though. after a while, you end up with some parts of the code written in c++98 style, some that uses odd c++0x extensions, a bunch of c++11 style code, and then c++14/c++17 features sprinkled around in the newest code (or sometimes refactored into older paradigms). to be an effective developer for an older codebase, you need to understand a lot of history surrounding the feature sets to understand design decisions from the past.
- jeffbee 6y agoIt takes discipline and tooling to effectively eradicate older idioms from your code, but it is worth doing. Regarding tooling, check out ClangMR https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/41342.pdf https://static.googleusercontent.com/media/research.google.c...
- bluGill 6y agoWhat is your alternative? Do the great rewrite every few years to the latest fads? Some have done that successfully, but it is expensive to get right and many more have failed. In general, if it ain't broke don't break it is a great use of resources, which keeps your company in business (thus you making steady paycheck and going home to your family at night). Fix/update the parts that need updating because they change and let the working stuff keep working. I will give a nod to the other poster who pointed out automatic tools. They are often worth running on everything, but they only fix a fraction of the things that a sane developer with 20/20 hindsight starting over would do differently.
- dragontamer 6y agoI mean, is it harder than writing code in C++98 style, then suddenly having to deal with C++ and Rust combinations from 2015 onwards? I'd say C++98 + C++17 is easier to deal with than C++98 + Rust.
- jacoblambda 6y agoThis unfortunately isn't really quite entirely true any more. There are a number of depreciations in C++17 and up that prevent older C++ code from working out of the box. Keep in mind that these are largely relatively useless or now replaced features so any incompatibilities should be both few and far between and relatively easy to fix.
- rfoo 6y agoAnd you can always compile your old codes with older C++ standards, codes compiled in C++11 / C++14 / C++17 are mostly ABI compatible so they can be (relatively safely) linked together.
- SomeoneFromCA 6y agoThis enables easy porting of good old C code, to C++.