News for hackers. Stuff that matters.
Re:C++ the Good Parts (2014) by rramadass on Thursday October 01, 2020 @07:48AM (#24649825)
>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" :-)

Re:C++ the Good Parts (2014) by clappski on Thursday October 01, 2020 @07:53AM (#24649859)
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.

Re:C++ the Good Parts (2014) by formerly_proven on Thursday October 01, 2020 @07:56AM (#24649875)
In 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.

Re:C++ the Good Parts (2014) by UncleMeat on Thursday October 01, 2020 @09:19AM (#24650484)
Initialization 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.
Re:C++ the Good Parts (2014) by gpderetta on Thursday October 01, 2020 @12:23PM (#24652790)
to be fair the interactions between brace initialization and initializer lists is a completely new mess.
Re:C++ the Good Parts (2014) by tsimionescu on Thursday October 01, 2020 @02:26PM (#24654432)
Well, initialization lists have added quite a bit of complexity to that problem. So have move semantics, to a lesser degree.
Re:C++ the Good Parts (2014) by rramadass on Thursday October 01, 2020 @10:53PM (#24658307)
It 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

Re:C++ the Good Parts (2014) by kevinventullo on Thursday October 01, 2020 @09:54AM (#24650804)
Does 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.
Re:C++ the Good Parts (2014) by rramadass on Thursday October 01, 2020 @10:23PM (#24658150)
You 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.
Re:C++ the Good Parts (2014) by guenthert on Thursday October 01, 2020 @01:28PM (#24653714)
What about the 'auto' storage class?
Re:C++ the Good Parts (2014) by gpderetta on Thursday October 01, 2020 @04:23PM (#24655788)
I 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.

Re:C++ the Good Parts (2014) by int_19h on Thursday October 01, 2020 @06:33PM (#24656871)
If 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.