4 ms·
I can't speak for the parent, but I've been using RAII and smart pointers in the 00s and it provided a lot of the benefits that got standardised with C++11.
by ondrasej 5y ago
I can't speak for the parent, but I've been using RAII and smart pointers in the 00s and it provided a lot of the benefits that got standardised with C++11.
- varjag 5y agoNone of that was a thing in 90s and early 00s.
- jcelerier 5y agoThe average C++ codebase isn't from the 90s. On all the recent c++ polls the average language revision used is between c++14 and 17. Besides I'm pretty confident that there are more new c++ projects created daily in 2021 than monthly at the peak of the 90s c++ craze - just on GitHub, 6/7% of C++ repos means a few million recent C++ repos.
- dagw 5y agoI've worked on several code bases that nominally are C++11 or 14. However they still contain a lot of code written by people still coding like it's the 90s.
- varjag 5y agoWhat does it have to do with what we are discussing?
- jcelerier 5y agowe are discussing the sentence "The average C++ code base has as many segfaults than the average C code base." __s and you said "You were using C++ >= 11 in 90s/00s?" to which I answered that this was not the point, because the average C++ code base isn't from the 90s/00s.
- secondcoming 5y ago> On all the recent c++ polls the average language revision used is between c++14 and 17. Polls of hobbyist coders, or software houses? I would be surprised if most software houses migrated to C++17 yet. Tensorflow is stuck on C++03 I think.
- jcelerier 5y agoTF is at least C++11 from the first header I opened in the repo: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/cc/experimental/base/public/runtime.h https://github.com/tensorflow/tensorflow/blob/master/tensorf... I'm referring to e.g. the Jetbrains and cppcon polls. https://blog.jetbrains.com/clion/2020/06/dev-eco-cpp-2020/ https://blog.jetbrains.com/clion/2020/06/dev-eco-cpp-2020/ https://youtu.be/JYzDpXI-vWI?t=137 https://youtu.be/JYzDpXI-vWI?t=137
- secondcoming 5y agoLast time I used it there was faff around having to define __GLIBCXX_USE_CXX11_ABI=0
- jcelerier 5y agoit does not mean that you're not using C++11. This macro is just a compatibility flag for your code to work on old linux distros that provide a C++11 compiler but did not want to rebuild their whole archive. It mainly means that std::string is implemented with copy-on-write instead of small buffer optimization.
- ectopod 5y agoRAII and smart pointers definitely were a thing in the 90s. I wrote lots of COM code using these techniques. According to wikipedia, RAII was invented in 1984-89.
- antoinealb 5y agoauto_ptr (precursor to unique_ptr) was first proposed for standardisation in 1994 [0], and there was probably non standard versions of it before 94. http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1994/N0555.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/1994/N055...
- marrs 5y agook then, nobody was using auto_ptr in the 90s.
- pjmlp 5y agoOh boy, OWL, MFC and VCL were used in the 90s, with their ComPtr smart pointer for COM/ActiveX/OLE 2.0.
- varjag 5y agoI worked with C++ & MFC in mid-late 1990s, smart pointers weren't an option. Maybe if you do something against MS oddball APIs, but not in general programming, not even for mainstream MFC uses. And what was there was entirely non-idiosyncartic, it's like claiming C++ had garbage collection in 1990s because you could bolt on Boehm's.
- mcguire 5y agoYou ever used auto_ptr? In 1992, I was working on the Taligent project, probably the first major C++ operating system. (It failed.) I remember when the ARM came out---none of the compilers we had available could really do templates. Or namespaces.
- pjmlp 5y agoSure it was, Borland and Microsoft compilers already had smart pointers for COM libraries. Besides even on MS-DOS with frameworks like Turbo Vision, RAII was a common pattern.