Remix.run Logo
dwattttt 4 days ago

I've been following Raymond Chen's recent series on writing a tracking C++ pointer class with interest.

Most of the articles start with "to fix the mistake we showed at the end of the last article", and end with "but now we've broken something else".

Needing to keep track of where exceptions can occur, so that you don't leave an operation half committed, sounds especially nasty: https://devblogs.microsoft.com/oldnewthing/20250827-00/?p=11...

nromiun 4 days ago | parent | next [-]

A lot of things are broken in C++. Like coroutines, exceptions, parallel execution (std::execution) etc. That does not mean the core ideas are bad and we should stop using them in every language.

tialaramex 4 days ago | parent [-]

I suspect too much is broken (well, I'd say more clearly "crap") in C++ to be sure whether any particular core ideas hold up based on that whole language.

I'm particularly mindful of C++ 26 Erroneous Behaviour for initialization. This idea was introduced for the forthcoming C++ 26 language version, it says that although just making a variable `int k;` and then later taking its value is an error, it's no longer Undefined Behaviour, the compiler shall arrange that it has some specific value.

This is a meaningful improvement over the C++ status quo. But, that doesn't mean the core idea is actually good. It's bad to do this in your language, they didn't have any better choice for C++ for historical reasons so this was the least bad option.

quotemstr 4 days ago | parent | prev | next [-]

You still have to be exception safe in Rust, you know. What do you think a panic is? Rust really has the worst of both worlds.

dwattttt 4 days ago | parent [-]

Agreed, and I wish there were more emphasis on ensuring panic free sections of Rust code.

lenkite 4 days ago | parent | prev [-]

Yeah, well C++ built a faulty bridge and screwed the pooch for future language designers who now all say "bridges are harmful".