Personally I don't find programming with C++ that hard. The downside is it needs a brain warm-up, and this is per project, but once that flywheel is spinning, I find it almost effortless to write code.

I have to go through the same warm-up more or less for any language I work with, so it's not that different than writing Python, Go or Java for me.

I agree.

You don't learn or know C++ in the way you learn or know C.

You never have the total language spec in mind. Much of it you will never (and for some of it should never) come across.

The way I think of it

C is an abstraction of the machine, so thin it's nearly transparent.

C++ is an abstraction over programming paradigms, letting you pick how you think.

Everything else abstracts the machine away, replacing it with a VM, runtime, or model of its own.

The same way a good project has a clear model of the problem it should have a clear C++ pattern in use.

> C is an abstraction of the machine, so thin it's nearly transparent.

Looks like someone fell for the C abstract machine trap yet again. No, C is isn’t an abstraction of the machine.

C Is Not a Low-level Language: Your computer is not a fast PDP-11.

https://spawn-queue.acm.org/doi/10.1145/3212477.3212479

As a corollary, all processors are C VMs, anyway.

[deleted]

It may not be an abstraction of a real machine. But the C abstract machine is very close to the foundational idea of how a computer work. And it’s quite easy to bootstrap.

Importantly my work involves me often being able to look at C and think about the assembly and back and I regularly work on ESP32, ch42(riscv) and atmega avr8.

I couldn't do that with mciropython on any platform.

C is a thin abstraction, python isn't.

I find C++ not hard at all when working with familiar idioms, restrictions and toolings (familiar to me). But it's hard jumping into new codebases and adjusting yourself to new patterns. Recently I did a lot of programming using C++23 Modules and it was a breeze.

There's basically dozens of very nice languages inside C++. That can be a blessing or a curse.

I'm anxious for Herb Sutter's CPP2/CPPFront to become a standard.

In February this year Herb tweaked a test case. That was his last commit to his "CPP2 syntax experiment". Don't expect it to "become a standard".

https://github.com/hsutter/cppfront/commits/main/

That's a shame! It's a lovely language.

Is it really, though, or is it just in comparison to C++?

Tbh I never expected that experiment to go anywhere. I guess that leaves Carbon (and large scale efforts to rewrite C++ in Rust).

I personally really like the syntax and the defaults, and I like it more than the C++ alternatives.

What type of project actually uses C++ 23 modules in real life? What kind of toolchain enables that? When I worked on Chromium, they were indefinitely in the "maybe in 5-10 years the tooling will be ready" camp.

The tooling people have - as of about a year ago said they are ready. Now everyone who considers themselves early adopters is using then. Most are waiting for the early adopters to figure out what the best practices are so we don't make a mess

What early adopters are using them? Because my impression is the tooling still isn’t there

People using Visual C++ with MSBuild, or clang with CMake and ninja.

CMake says they are there. Other tools mostly are not.

Nobody has said they are using them in anything important, but hopefully that is coming.

CMake has support for named modules but does not support header units or C++23 module features such as import std;

Import std has been there for a while but is experimental until gcc supports it. Gcc just for that support so it should be mainline soon.

C++20 is pretty common and gives you already a pretty nice engineering experience.

YC startup. Toolchain was Clang and sh.

Chromium is gonna be more conservative than that for sure.

Looked up what C++23 Modules were and I must say I was not let down.

>I'm anxious for Herb Sutter's CPP2/CPPFront to become a standard.

Why? It doesn't remove complexity, it (partially) hides it and makes the whole thing even more complex.

I enjoy the syntax and the defaults he picked, and it matches the way I use C++. I prefer it to all the C/C++ alternatives.

There are so many standards and idioms that it gets confusing. There are still legacy codebases out there — some codebase still use C++98 as their standard, others use C++11... And with Unreal Engine, the modern C++ standard is C++14, right? There are things like smart pointers, but some places don't even use them. I feel like there are just too many features. When I saw template metaprogramming — that new feature — I realized I have no talent for C++.

I have developed things with C++98, C++11 and C++14. Every of these standards are so vast, so remembering everything (even in a single standard) is not possible. Instead of knowing everything, I first fix the standard I want or need to work with.

Then I design the thing I want to build. I always design what I want to build beforehand. This takes a couple of iterations from high level to low-ish level. That last design becomes a bit language dependent. Then I select some of the core tools that I'm going to use (which kind of pointers, classes or structs, etc.)

With that design in mind, I go "library shopping" both for file formats (if any) or other stuff like vectors, etc.

Armed with the reference docs of these, I write my code with the toolbelt I have built for the project.

Some things are hard, but they are not impossible. I find thinking like compiler helps a lot.

This is true of any language. Python with flask vs django, with/without type hints. JavaScript with anhular and vue.

The varying standards are no different to major python versions or go versions - arguably there’s even less between most versions than there is in your average go release.

The differences in apps and frameworks don’t matter for day to day - std::string, Unreal’s FString and QT’s QString all are similar enough that 99.9% of the time.

Metaprogramming is one of those things; you either write it or you don’t. Knowing some basics is required but the vast majority of people use a handful of pre existing things without understanding the nuances of how it works under the hood.

> This is true of any language

Is it? Java has changed a lot, but in such a way that it's still easy to mentally map new features to the old ones, provided you have understood the core language. IDEs can even convert your code from old to new and back.

> When I saw template metaprogramming — that new feature — I realized I have no talent for C++.

It's not a new feature. And tbh, compared to Typescript, C++ templates are tame ;)

(but yeah, deciding when to stop digging into the template metaprogramming rabbit hole requires some common sense and sanity, too much template complexity is almost never worth the hassle)

It was a new feature. Over 30 years ago now. Template metaprogramming was even featured in the ARM.

> And with Unreal Engine, the modern C++ standard is C++14, right?

Unreal Engine depends on C++20 at this point.

https://dev.epicgames.com/documentation/unreal-engine/epic-c...

When I went on a business trip for screen golf program project back then, it was UE4(CPP14), By your introduction UE5 onward, it's 20. I've updated my knowledge.

> The downside is it needs a brain warm-up, and this is per project, but once that flywheel is spinning, I find it almost effortless to write code.

How is that different from other languages, which don't need the brain warm-up?

The difference, if you split hairs, that the brain warm-up takes a bit longer. Maybe a couple of hours, or a day at most.

Otherwise it's not different for me. I don't feel different while writing with any other language. I guess the main reason is I always think like the computer first and translate that thinking to the programming language at hand.