News for hackers. Stuff that matters.
Re:C++ Coroutines Do Not Spark Joy by TillE on Monday November 01, 2021 @06:43AM (#29065033)
I think it's not a coincidence that 99% of the complaints about modern C++ on HN are from people who...don't use C++. You don't get anything remotely like this tone of discussion on r/cpp or whatever.

I've been continuously employed as primarily a C++ developer since around 2001. The language was pretty bad back then, but it's been getting better and better since C++11. The vast majority of the new stuff is absolutely wonderful to use, a huge improvement in productivity and code readability.

Re:C++ Coroutines Do Not Spark Joy by will4274 on Monday November 01, 2021 @01:12PM (#29069708)
Big +1 to this. Most of the changes to C++ have been fixing old problems. Concepts are a complex feature sure, but before having named concepts in code, we had unnamed concepts in code that may or may not be named in the documentation. Being able to name these things in code and get reasonable error messages from the compiler / just actually be able to understand it in my brain is great!

Same with constexpr. People used to do all sorts of stupid math / string concatenation in "template metaprogramming" to get compile time execution. Now they write (mostly) normal functions in standard C++ that I can actually read. The language gets more complex sure, but the code I read and write gets simpler.

C++20 is larger than C++11, sure. But for most users, it's simpler too.

Re:C++ Coroutines Do Not Spark Joy by matheusmoreira on Tuesday November 02, 2021 @02:20PM (#29085318)
> Most of the changes to C++ have been fixing old problems.

It will not fix all the pre-existing legacy code that people deal with on a daily basis. Languages are like infrastructure. People need to get it right on day one since it's exceedingly expensive to fix later on after people have already started to build on top of it.

Re:C++ Coroutines Do Not Spark Joy by pornel on Monday November 01, 2021 @08:06AM (#29065637)
This is a selection bias. People generally aren't forced to use C++, so those who can't stand it don't take C++ jobs, or leave to use something else.
Re:C++ Coroutines Do Not Spark Joy by matheusmoreira on Tuesday November 02, 2021 @02:25PM (#29085392)
I wasn't even complaining though. I'm just demoralized due to the extreme and ever increasing complexity. I don't feel like it's worth it to update my C++ skills.

My real complaint about C++ is the utterly insane ABI situation. Only C++ code dares to touch C++ code, no other language can interface with it without a C interface in between. The new standards forced even C++ compilers to break backwards compatibility with themselves due to requiring certain data structure performance characteristics. There is such a thing as C++ code that won't even work with other C++ code produced by the same compiler.

Re:C++ Coroutines Do Not Spark Joy by eska on Monday November 01, 2021 @07:40AM (#29065437)
Yes, visitors to Disneyland don’t complain about Mickey Mouse.
Re:C++ Coroutines Do Not Spark Joy by tralarpa on Monday November 01, 2021 @07:03AM (#29065184)
Could you explain what kind of projects nowadays use C++? I'm not up to date at all anymore. Used a lot of C++ until about 2010 (for simulations and Windows programming).
Re:C++ Coroutines Do Not Spark Joy by sseagull on Monday November 01, 2021 @08:03AM (#29065620)
Still used a lot in scientific programming. Especially with long-lived projects, but even now new C++ projects start up.

It’s a combination of institutional knowledge, domain-specific libraries, and low-level, hpc capabilities that keep C++ being used.

(C++ for low-level stuff, python for the glue is a common paradigm in scientific computing)

Re:C++ Coroutines Do Not Spark Joy by throw_m239339 on Monday November 01, 2021 @11:13AM (#29067710)
> Could you explain what kind of projects nowadays use C++? I'm not up to date at all anymore. Used a lot of C++ until about 2010 (for simulations and Windows programming).

All browsers you use are written in C++ (Firefox, Chrome...). Node.js is written in C++.

We live in that bizarre world, where on one side we have C, an antiquated and simplistic language and on the other C++ a monster of complexity that provides also basic modern stuff C will never have.

Rust has complexity of its own but it's more like a "philosophical" complexity rather than syntactic. A lot of C and C++ developers just don't like how Rust works.

Re:C++ Coroutines Do Not Spark Joy by jandrewrogers on Monday November 01, 2021 @12:41PM (#29069219)
High-performance database engines and similar data infrastructure are almost exclusively written in modern C++ these days. They benefit immensely from new C++ features.
Re:C++ Coroutines Do Not Spark Joy by KineticLensman on Monday November 01, 2021 @10:30AM (#29067024)
Game development using Unreal Engine, which has a C++ API [0]

[0] https://www.unrealengine.com/en-US/features/c-api