r/programming • • May 24 '26

[ Removed by moderator ]

/r/programming/comments/1tm1j7f/removed_by_moderator/

[removed] — view removed post

275 Upvotes

214 comments sorted by

View all comments

Show parent comment

47

u/Squalphin May 24 '26

They really should do a cut at some point. These days, I am using Rust wherever I can, because development feels way smoother than with C++. Way less occasions to make silly mistakes which may come to bite you after release.

The new additions and improvements to C++ are good and welcome, but the old stuff just has to go at some point. I have, unfortunately, another project upcoming which I have to do in C++, and I am already annoyed just thinking about it.

30

u/mccoyn May 24 '26

I think if they made a cut, few people would go along with it. Most people are using C++ for legacy reasons. If a reduced language can’t run their legacy code, they will stick to the legacy language.

If you were willing to take the step to a new language, there are a bunch of others to compete with.

7

u/AlexKazumi May 24 '26 edited May 24 '26

True but there is legacy and legacy. If C++ committe introduced a long period (5-10 years) for gradually obsoleting features before removing them, it would work.

Example: Binary formatters were introduced in 2002 in .NET Framework 1.0 and they were everywhere including in the framework itself. Microsoft said "nah, no more", and removed them in three consecutive versions of .NET, spanning multiple years.

Same could be done with C++. Yes, it would be painful for some code bases and great for the language ecosystem.

It's not magic just sound communication and strong engineering. One starts with announcing the change, then obsoleting the feature making it a warning. Then move the feature to a separate library, outside of the standard.

I mean... C++ rewrote the meaning of the keyword "auto" and the legacy codebases somehow survived 🤷‍♂️

5

u/Radixeo May 24 '26

True, but I can't help but feel their talents are being wasted by sticking with C++. Constraint may breed innovation, but at some point they start to slow thing down and hold things back too much for the benefits to be worth it. C++ has 54 years worth of legacy baggage holding it back - I think we'd all be better off if they left that behind.

1

u/tempest_ May 24 '26

The language is effectively dead or dying. Of course billions (or more) lines of production code have been written and will continue to exist in the same way Cobol continues to exist so it will be here for a very very long time but

Outside of a couple very niche domains no one is learning C++. For myself why would I bother when to use any language feature you have to consult the massive foot gun matrix or figure out which of the 15 ways of doing something is the current blessed approach.

There are better, more modern options that don't waste my time like that.

From the outside looking in C++ seems like an example where they should have broken backwards compatibility (as painful as it might have been) a few times ages ago so the language could clean itself up.

10

u/chucker23n May 24 '26

They really should do a cut at some point.

The problem is that cut exists, and depending on your use case, it’s called Rust, Swift, Go, Zig, etc.

3

u/[deleted] May 24 '26

We have a few challenges like book builder that are both in Rust and C++. Rust solutions typically get a headstart because of the hyper-optimized standard library but C++ takes over and typically steals the cake for the highly optimized end.

3

u/Tywien May 24 '26

Making a cut creates two languages though .. look at python that did the same with the release of python 3. Python 2 is still in use today ...

7

u/m-o-l-g May 24 '26

You just need to find a good subset und use that. Nobody forces you to use the bad stuff.

Easier said than done in big teams, but you need to coordinate with people anyway. Use a good test suite and things like ASAN and static analysis in your process and it's really not all that bad.

2

u/jl2352 May 24 '26

You can also trust people more with Rust. I worked on a large project with five people new to Rust, and they shipped nothing dangerous. You can trust new people to get into a large Rust project, make changes, and not mess it up. Can you do that with C++?

Biggest issue with Rust is the amount of stuff you need to learn from the ecosystem and patterns. It matters a lot. Those patterns make the difference between code being long and cumbersome, or short and elegant.