4 ms·
I 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? > T
by clappski 6y ago
I 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