top | item 40447771

(no title)

MauranKilom | 1 year ago

As a younger programmer, I used to listen to people hating about everything C++ does, offers, or wants to be. Specifically https://yosefk.com/c++fqa/ [1]. Then I tasted the RAII (probably up there with Dynamic Programming for "horribly named but super powerful paradigms") koolaid, and threw my caution to the wind. It's been a pleasant ride since, even if I've been living in a somewhat comfy C++ environment with few third-party integration woes and a reasonable compiler upgrade pace.

Sure, I agree, you should carefully evaluate which language best serves your needs, and what tools in a language you should use or stay away from. But some game dev ranting about which C++ features they consider useless (without even articulating their background or constraints) is worthless imo. Especially if this is the credit they give to their name:

> After over 20 years working with C/C++ I finally got clear idea how header files need to be organized.

[1] Yes, that FAQ parody is now very outdated, seeing as it precedes even C++11. I can believe that it was on-point at the time of writing, but C++ grew up since then.

discuss

order

pphysch|1 year ago

C++ indeed has many gems like RAII, and many turds. My hope is that one of the last unavoidable turds (mandatory header files) gets replaced by modules but that seems eternally on the horizon.

Frankly I haven't used C++ since LLM copilots dropped, so that would address a lot of the tedium with managing headers in rapid greenfield development.

rileymat2|1 year ago

I have very mixed thoughts about headers, there is something I kind of love about being able to document the public declarations in one slim text file; and put the definitions elsewhere. There are lots of ways to do that, but other languages don't seem to bother. There are automated solutions, to pull these out, but I rarely see, for example, a python file will often just be a series of functions with no way to tell.

But they have a ton of warts, and require duplicate maintenance.

pjmlp|1 year ago

Modules nowadays mostly work, at least for VC++, clang 18 and cmake/msbuild.

My hobby C++ coding nowadays only uses modules.

For portable code, I imagine at least 5 years more, given experience with previous C++ standards.