4 ms·
>C++20 is more fun to program in than 17, which was better than 14, which was better than 11. Not quite. The syntax has become even more weirder and the langua
by rramadass 6y ago
>C++20 is more fun to program in than 17, which was better than 14, which was better than 11.
Not quite. The syntax has become even more weirder and the language more complicated. I really do think that the standards committee have gone overboard adding in everything and the kitchen sink. The pace of change has been crazy for such a old and widely used language. The standards committee should just disband for a couple of years and go take a rest instead of adding in everybody's "favourite features" :-)
- clappski 6y agoI agree that the language in general is more complex mainly due to additions to the STL, but what has changed in the syntax that you think make it weirder? > The pace of change has been crazy for such a old and widely used language. Not necessarily a bad thing, at least you can request specific standards at compile time so you can stick around at whatever standard you want and it should work for a very long time (there's still C++03 and older out in the wild), and those who want the features in the latest standard can upgrade.
- formerly_proven 6y agoIn terms of syntax and semantics, initialization in C++ is rather complex and subtle, perhaps the most complex part of C++ (yes, more so than templates, because templates-the-language-feature is not that complex, it's the way libraries like Boost and the STL use them that's complicated). The good thing about the STL additions is that you can simply ignore them, as they are not part of the core language, just like people have ignored iostreams since the 90s.
- UncleMeat 6y agoInitialization is admittedly a tremendous mess. There are so many ways to screw it up it is ridiculous. But this is really a problem with some old old old decisions and backwards compatibility rather than an issue with new complexity.
- gpderetta 6y agoto be fair the interactions between brace initialization and initializer lists is a completely new mess.
- tsimionescu 6y agoWell, initialization lists have added quite a bit of complexity to that problem. So have move semantics, to a lesser degree.
- rramadass 6y agoIt is the overloading of symbols and keywords in the language with new meanings which bugs me the most. Symbol soup for lambdas, "using" can now mean a type alias, initializer lists, move syntax, "decltype" function returns etc. Each by itself is not complicated but when you start mixing them in template heavy code, suddenly reading difficulty increases exponentially. I think a lot of things were added in just to "get away" from C roots and make C++ its own language which IMO was a bad idea. For me, C++ is first and foremost a "better C with Classes" because i can keep that subset of the language in my head easily. PS: Relevant other HN discussion: https://news.ycombinator.com/item?id=24649992 https://news.ycombinator.com/item?id=24649992
- kevinventullo 6y agoDoes it really matter as long as it’s backwards-compatible? AFAIK one can write C++98, compile it as C++20, and most everything should still just work. So a developer can pick and choose which new features they want to use.
- guenthert 6y agoWhat about the 'auto' storage class?
- gpderetta 6y agoI wonder if it has been ever used on the wild outside of some compiler conformance test. Anyway, it is true that C++ is not fully backward compatible, some things have changed in very important ways, but the vast majority of the code will compile unchanged and breakages should be caught at compile time.
- int_19h 6y agoIf you're dealing with a C++98 or C++03 codebase, you can literally remove every mention of "auto" in it without changing the meaning of the code.
- rramadass 6y agoYou are in a sense both right and in another sense not quite so. You are right in that the language designers went to great lengths to maintain backward compatibility. So all my C++98/C++03 skills are still relevant today. When i see kids say how "modern and better" is C++11/xx i always reply, go read Coplien, Barton & Nackman, Koenig to understand where it all came from. On the other hand the cognitive overload imposed by the new features is substantial and there is a non-trivial learning curve even for experienced developers. Beginners have even more difficulty getting started. Result? Everybody lives within their "familiar subset" of the language. So codebases can be in C++ and yet two different developers can have difficulty understanding each other's codebase.