3 ms·
No, but I need to know them to read other people's code. Every C++ programmer has a slightly different subset of C++ features that they consider "basic", "funda
by bxparks 3y ago
No, but I need to know them to read other people's code. Every C++ programmer has a slightly different subset of C++ features that they consider "basic", "fundamental", or "essential".
After 35 years of C++ on and off, I have pretty much given up it. I don't have the mental energy to deal with its complexity anymore. I will deal with parts of C++11 or C++14, mostly so that I can read other people's Arduino code.
I think I would rather learn a new language (Rust?) than deal with the hairball that is called "modern C++".
- 01100011 3y agoThis 100%. The vast majority of programmers' lives is spent reading code. We need to be able to interpret, repair and extend the work of others. I often hear this defense of C++, that you only need to know certain parts and the rest are for "library writers". This is an absurd argument, but not exactly surprising from the core C++ cult(and I say this with 26 years as a C/C++ dev). It's almost as if there are two separate camps, one writing and maintaining production software, and another group which only works on language internals and is becoming further divorced from reality.
- wiseowise 3y agoAbsolutely this, 100 times. I will never understand “don’t use all features” argument. Open 5 C++ projects side by side and you’ll find 5 different languages and 5 different build systems that are nigh impossible to build if they deal with dependencies.
- UncleOxidant 3y agoSadly agree. I used to know something that was called C++ (or at least parts of it) and even used to get paid to program in it. But now that C++ has become this kind of constantly morphing target (see the discussion here about what the most modern way to display text to stdout is) it's just tough to get my arms around it anymore. It seems like there was a noble attempt to modernize C++ and certainly there are some welcome parts of that, but it's gotten so far out of hand now. At some point you just have to admit defeat and start over from scratch with something that has a more unified vision. I'm looking at Zig and Carbon for lowlevel stuff and Julia for mathy stuff now.
- angiosperm 3y agoIt is easy: Ignore the old parts, use the new parts.
- wiseowise 3y agoC++ is one of the oldest languages there is, it’s impossible to ignore old parts.
- angiosperm 3y agoYet, anywhere I have a choice between old and new, I choose the new, and do ignore the old. Except println(), hard pass.
- sevagh 3y agoI saw `<< std::endl` when my brain was still developing, and now it's too late to stop using it.
- angiosperm 3y agoIt is as easy to drop as it is to pick up "auto".
- angiosperm 3y agoSome new features are specialized, like standard library support for SIMD instructions, and you learn them where you want that. But many offer better ways to do familiar things, that make the overall programming experience more pleasant. Use those as soon as the compiler you use gets support for them. Often they make bugs harder to write, and correct code easier to write. Now we can write for (auto const& [key, value] : map) { ... } instead of for (Map::const_iterator_type it = map.cbegin; it != map.cend; ++it) { Map::key_type const& key = it->first; Map::mapped_type const& value = it->second; ... } It is just better in every way. Another example is extension of "constexpr" to more and more of the language; each eliminates the need for some range of template metaprogramming. Nowadays you can ignore almost everything written about template metaprogramming, because there are good, straightforward ways to achieve its aims with ordinary language features.
- pompino 3y agoCan you give a real-world example? Most code-bases have massive inertia that resists complete re-writes using new features.