upvote
To use the subset that makes it a better alternative than C, aka "Typescript for C", and ignore the rest.

Hopefully we would have moved on into fully bootstraped alternatives, but open source has decided to build their alternative languages on top of LLVM and GCC instead, with some minor exceptions.

Note that I am starting to have a "find it hard to keep up with the language changes" similar feeling with Java, C#, Python and TypeScript.

reply
I have the same opinion. C++ was my first programming language I used at work. I feel that I was relatively proficient with it, but it was around 2005 I think. Since then I've mostly used other languages. Right now I feel I can use C with ease, in fact I periodically use it. But C++? I don't even dare.

I guess it's fine if one specializes on C++ programming only. But when one needs to use different languages and C++ is used sporadically, I feel like it might be substantially harder than other languages.

reply
I would feel the opposite. I dare not write a program in C. The mentality of RAII and destructors for resource management is so ingrained that attempting to track resource use and lifetime in C would be nightmarish.
reply
The problem with C are the parts that C++ already provides an alternative, regarding bounds checking, generic code with preprocessor tricks or now that _Generic thingie, stronger typed enumerations, heap allocations without sizeof math, automatic resource cleanups.

So use a minimal approach to C++.

reply
I've never used LLMs for C++ but I notice that it likes to use every available feature on other languages. Is Claude-generated C++ incomprehensible as a result?
reply
Extreme accretion/scope-creep of syntax (and features) across all languages continues, C++ is probably one of the most extreme example of this.

Everyone's trying to bring in the shiniest new toys from all other languages. So-called "modern C++" is an unbearable menu of every possible flavor of procedural, functional, OOP, templates, strong/weak typing, metaprogramming, and so much more. End result is a Frankenstein mix of C, Fortran, Pascal, Python, F#, Scala, C#/Java, Visual Basic, LUA, TCL, Rust, and what not... and that's before we even talked about the STL/STD situation in C++.

The only correct way to work with C++ is to agree on the most minimal subset of features needed for consistency and productivity in your codebase, stick to those and avoid adopting 95% of the crap that's being brought in. Ignore the noise.

reply
Sorry for the nitpick, but ossification means the opposite of how you're using it here. It means existing structures / practices becoming frozen in place, by analogy with real ossification which is where flexible cartilage hardens into rigid bone.
reply
Thanks!
reply
C++ was complex already 15 years ago (template metaprogramming, anyone?).

Can't imagine what it must be nowadays.

reply
It's a very complex language, but I also find little reason in using any of its more niche features; however, I essentially just write C with RAII and templates when it comes to C++, so I'm probably abnormal.

For instance, I can now avoid SFINAE in C++20 and beyond, which was always the ugliest part of C++ templates to me. C++20 concepts simplified most of my metaprogramming needs.

reply
Reading boost libraries was like reading brainfuck. In fact most of std lib source felt that way too. I never reflected on this since I stopped doing C++ 15 years ago - but yeah I have not worked with a language that's worse to read since. Maybe macro heavy lisp ?
reply
[dead]
reply
The best orgs have style guide that restrict features
reply
Going from C++11 to 14 and so on... it’s hard to keep up with those changes. And I’m reluctant to use C++—not because C++ is a bad language, but basically because it’s been used so widely, the places I work have a lot of legacy C++ code, and since each version is different, it’s hard to adapt. I know it’s not a feature everyone uses, and I know you have to define your domain according to your work and limit yourself to a subset, but C++ can do too many things, and even within that there are many overlapping ways, so it’s more confusing. When features are added, you do feel pressure to know them, right? In my head I know “C++ should be limited depending on the domain!” but the problem is that using this language means you have to know it—and even in the same domain, C++ has many different ways of doing the same thing, so it’s freeing but painful for maintenance, I think.
reply
This may not invalidate your point, but C++11 was a major step forward that, for me, made C++ feel much more convenient and modern than before. And C++14 is basically just adding/fixing stuff that should have been in C++11 in the first place.
reply
I like C++11 too. (My introductory book was on C++11 as well—yes, it’s that book about modern C++11.) But some projects require C++14, and other times I have to use C++98.

I’m a “traveling programmer” in Korea. But when I go out to a work site because they say I have to work on C++, as you know, there are so many versions that it’s painful.

reply
Even the author of a well-known series of books about C++ has long since "given up" because the laundry list of footguns, caveats and adversarial interactions between different features has gotten too long.
reply
Assuming you're talking about Scott Meyers, that's a fabrication.
reply
The complexity of C++ lies only in template programming, and it doesn't add any efficiency to the final program—on the contrary, it makes the program harder for other programmers to read.

Technically, you're only learning to mentally unfold multi-level nested templates just to verify how they work, and all for the sake of making the program look small with less boilerplate?

This is complete nonsense. For me, C++ died with the 11 standard.

reply
In what way is making the program harder to read contrary to making the final program more efficient?
reply
Template meta programming is essential to many kinds of efficiency that are quite tedious to mimic in C.
reply
[dead]
reply