Live data from Hacker News

C++ Should Be C++

open-std.org

11–20 of 191 posts

Re: C++ Should Be C++

#11
post #2

Honestly, the changes in C++ 20 and 23, plus the upcoming changes for 26 (looking at you, Concurrency TS v2) have so drastically improved the language it's almost like the ES5 -> ES6 evolution of JavaScript. I might be in the minority here, but I genuinely enjoy writing modern C++. My complaints are about it's dependency management story and lack of integrated, standardized tools for things like dependencies, testing…

Anything C++11 forward is alright with me, though 17 introduces some very nice conveniences like , and most critically . Honorable mention to std::clamp too.

23 introduced (result/either) as well

Re: C++ Should Be C++

#12
> It is easy to see that C++ is fit as a general-purpose programming language–adoption by millions is a testament to that.

No, that is false. It is akin to arguing that Christianity must be true because 2.4 billion Christians can't be wrong. The fallacy is easy to see because the argument can be applied equally to the world's 1.9 billion Muslims and 1.2 billion Hindus and 500 million Buddhists, etc. And yet these groups hold mutually-exclusive positions and so at least N-1 of them must be wrong.

Humans are social animals. With only a few exceptions, we tend to conform to the group. That tends to make us get stuck in very deep ruts. "Everyone is doing it" is absolutely no indication that "it" is a good idea.

[UPDATE] A lot of people seem to be missing the point here, so I feel the need to clarify: I'm not saying C++ is analogous to a relgion. I'm using the exclusivity of religious belief just as a short-cut to show that it is possible for large groups of people to hold false beliefs without getting into the weeds of which of those beliefs are actually false. The point is not that C++ is analogous to a religion, just that "adoption by millions" is not a valid argument for its merits.

[UPDATE2] I am also not saying that religion has no value beyond the truth of its objective claims. I am only saying that (some of) the world's major religions do make objective claims, some of those claims are mutually exclusive, and so some of them must be objectively false, and therefore it is manifestly true that large groups of people can hold objectively false beliefs, and therefore the fact that large groups of people hold a position is not evidence that that position is objectively true. Being "fit as a general purpose programming language" is an objective claim.

Re: C++ Should Be C++

#13
post #4
post #2

Honestly, the changes in C++ 20 and 23, plus the upcoming changes for 26 (looking at you, Concurrency TS v2) have so drastically improved the language it's almost like the ES5 -> ES6 evolution of JavaScript. I might be in the minority here, but I genuinely enjoy writing modern C++. My complaints are about it's dependency management story and lack of integrated, standardized tools for things like dependencies, testing…

I don't know if you're in the minority or I am, but I find modern C++ to be borderline intolerable (and I've been programming mostly in C++ from before there were C++ compilers). I used to love C++ (and still do if we're talking about older standards), but the new stuff is just a baroque torture.

Aye, same here.

I don't mond C++ evolving into some thing of its own beyond all recognition, but there is a distinct lack of modern "C with Classes" language. Basically, C on steroids. There are attempts at that, but none is perfect and/or has enough traction to be viable.

Re: C++ Should Be C++

#14
post #2

Honestly, the changes in C++ 20 and 23, plus the upcoming changes for 26 (looking at you, Concurrency TS v2) have so drastically improved the language it's almost like the ES5 -> ES6 evolution of JavaScript. I might be in the minority here, but I genuinely enjoy writing modern C++. My complaints are about it's dependency management story and lack of integrated, standardized tools for things like dependencies, testing…

You're absolutely not in the minority, old C++ was awful and there have been so many improvements to the language and standard library to help write simpler, clearer code.

I was just recently appreciating the if statement with an initializer in C++17, which helps me express exactly what I want for variable scope in one line instead of multiple awkward ones.

Re: C++ Should Be C++

#15
post #7

this feels defeatist c++ is with us for the near future, it needs an evolutionary path that provides a sane path forward why not break with the past? anyone needing to compile c++11 can find the tools and still use them, they can live in the past as long as they like just getting dependency/build management and integrated testing would be huge and really a small ask given what is happening in other tools its crazy th…

Lack of modules support is the biggest thing keeping me from doing more c++ greenfield. So much friction in managing a pointless interface implementation layer.

I'm not well versed in C++ best practices, but unless it's a non-option for your situation, have you considered single file headers or perhaps even a unity build[1] approach? Of course, both are just workarounds for proper module support and have their drawbacks and limitations.

[1]: https://en.wikipedia.org/wiki/Unity_build

Re: C++ Should Be C++

#16
I like that this doc at least says that C++ is unergonomic. I'm always saying that good way to learn language patterns and idioms is to look into standard libraries implementations.

And when you look into C++ libraries/stdlib, they often look like they're written in another language entirely. This is not normal.

Re: C++ Should Be C++

#17
post #12

> It is easy to see that C++ is fit as a general-purpose programming language–adoption by millions is a testament to that. No, that is false. It is akin to arguing that Christianity must be true because 2.4 billion Christians can't be wrong. The fallacy is easy to see because the argument can be applied equally to the world's 1.9 billion Muslims and 1.2 billion Hindus and 500 million Buddhists, etc. And yet these gro…

Awful analogy.

C++'s fitness as a general-purpose programming language is not an exclusive assertion.

Re: C++ Should Be C++

#18
post #7

this feels defeatist c++ is with us for the near future, it needs an evolutionary path that provides a sane path forward why not break with the past? anyone needing to compile c++11 can find the tools and still use them, they can live in the past as long as they like just getting dependency/build management and integrated testing would be huge and really a small ask given what is happening in other tools its crazy th…

Lack of modules support is the biggest thing keeping me from doing more c++ greenfield. So much friction in managing a pointless interface implementation layer.

Yes! Proper modules support would give c++ a well needed boost (no pun intended!). msvc is kinda there, but it breaks here and there with intellisense.

Re: C++ Should Be C++

#19
I feel the C++ committee saw the major quality-of-life improvements from C++11 and convinced themselves that Python's ergonomics with templated C++'s speed was possible. I won't say it's impossible, but the backwards compatibility sure seems like too much weight.

Re: C++ Should Be C++

#20
post #12

> It is easy to see that C++ is fit as a general-purpose programming language–adoption by millions is a testament to that. No, that is false. It is akin to arguing that Christianity must be true because 2.4 billion Christians can't be wrong. The fallacy is easy to see because the argument can be applied equally to the world's 1.9 billion Muslims and 1.2 billion Hindus and 500 million Buddhists, etc. And yet these gro…

Awful analogy. C++'s fitness as a general-purpose programming language is not an exclusive assertion.

That's not the point. The point is that "N people can't be wrong" is not a valid argument for any value of N.
Post reply on HN