4 ms·
>is there big difference between the latest version and C++ from 5 or 15 years ago? As compared to 15 years ago, the language is almost unrecognizable. As comp
by GeneralMayhem 8y ago
>is there big difference between the latest version and C++ from 5 or 15 years ago?
As compared to 15 years ago, the language is almost unrecognizable. As compared to 5 years ago, it's a bit more convenient to use, but not wildly different. C++ is a relatively old language, but it didn't have an real standard until 1998, and even that version was more about documenting what was out there rather than prescriptively designing anything. Before that (and to a lesser extent since, cough-cough-Microsoft-cough), it was a mess of incompatible OS features, compiler-specific semantics, and inconsistent tooling. In the right environment, it could be the most amazing and productive language, but it was a very short trip from "this is great" to "here be dragons and assorted hellbeasts".
C++11 has been by far the biggest change. Beyond the huge impacts on the language itself, it was the beginning of the current standards cadence of new standards every 3 years. To point to a single feature, C++11 introduced smart pointers and move semantics, which are the only "modern C++" features that I use in almost every single source file.
>How do you guys keep up when a huge language is continually changing?
A new version every 3 years is not that fast, really. And the new features are totally opt-in and backwards compatible; code written decades ago will, for the most part, still compile today. That means that you can slowly adopt new features one at a time as they make sense.
>why a low level language is going through so many new versions?
First, C++ isn't really a low-level language - or at least, it doesn't have to be. It hits a really interesting sweet spot where you can express powerful things concisely, and yet predict more or less exactly how things will execute if you think it through. It doesn't run on a VM like Javascript or Python, and it doesn't have the esoteric abstractness of Haskell, but it's certainly much higher-level than C, and there are a number of layers farther down than that.
Second, the reason for the iteration mostly has to do with filling in features that everyone had to build for themselves, and which were often platform-specific. Each version has progressively expanded the standard library with things like cross-platform concurrency primitives (std::mutex, std::thread), file I/O (<filesystem>), efficient string manipulation (std::string_view), and improved templated containers (std::optional, std::variant). Adding smart pointers in C++11 was about moving best practices about memory management into the language. Adding file I/O in C++17 was about standardizing cross-OS compatibility layers. Adding modules in C++20 is about improving standard buildchains and package management. Prior to C++11, every organization had to have their own implementations of all of those things, which required a massive investment into internal "standard" libraries, styleguides, and tooling, which were totally incompatible with each other. In the modern C++ era, a lot of those things can be the same for everybody, which makes everything more efficient - easier to transfer to a new codebase, easier to start from scratch, easier to share tools and libraries.
- microtherion 8y ago> 1998, and even that version was more about documenting what was out there rather than prescriptively designing anything. That was the original intent, I think, but decision to incorporate the STL caused the standard library to change massively late in the standardization process. P.J. Plauger wrote a book on the 1995 version of the C++ library, that ended up being massively different than what the standard adopted: https://www.amazon.com/Draft-Standard-Library-P-Plauger/dp/0131170031 https://www.amazon.com/Draft-Standard-Library-P-Plauger/dp/0...
- heyoni 8y agoI think that teaching myself C++ in the late 90’s was a mistake. I remember going through an entire textbook, not being able to do anything with it and stopped programming for years.
- speedplane 8y agoI learned C++ in the late 90s and also struggled. I now barely use it at all, mostly relying on garbage collecting languages. But knowing how memory is managed, that it's a resource that can easily be abused, even in a garbage collecting environment has been a huge boon to how I architect projects.
- pjmlp 8y agoDepends pretty much on each one. Coming from Turbo Pascal 6.0, it provided me a world with access to C based tools, without having to endure typical C unsafe code.
- heyoni 8y agoAbsolutely. For me it was something I was doing for fun when I was about 13 and was my second intro to programming after qbasic.