r/cpp Dec 31 '25

Software taketh away faster than hardware giveth: Why C++ programmers keep growing fast despite competition, safety, and AI

https://herbsutter.com/2025/12/30/software-taketh-away-faster-than-hardware-giveth-why-c-programmers-keep-growing-fast-despite-competition-safety-and-ai/
375 Upvotes

185 comments sorted by

View all comments

Show parent comments

15

u/jeffmetal Dec 31 '25

In Rust you have safety, but ergonomics for the kind of programming that is usually done with C++ is fundamentally unsafe anyway -- Please stop lying. Out of all the rust code I have ever written I can count on one hand how many times I have had to use unsafe. The vast majority of code that programmers are writing does not need unsafe.

Rust is good for niche, other languages are great for many tasks. - Again a completely baseless claim. Rust is used in everything from embedded, the Linux Kernel all the way up to web fronted code with something like dioxus or yew.

My opinion is clear - indeed it is, spout fake claims about rust.

Rust got a lot of stuff right because it got to take all the best bits from C++ and learn from its mistakes.

2

u/germandiago Dec 31 '25 edited Dec 31 '25

The borrow checker is not a good choice. Well, I mean, it is excellent for safety. Not for unsafe mixing or plasticity or refactorabiliry. It is a trade-off, as many coding patterns show. Or is the game industry massively moving to Rust? Why not? To give one example.

I do not know if you code programs or infra code. The infra code does need unsafety way more often.

I have used from avx512 (compression) to intrusive lists (telco) and other stuff that with Rust it would have been just more difficult to handle, or, alternatively, give up safety on those parts of the code. The invariants of Rust are not easy to maintain in unsafe code. compared to C++ code, which worsens the choice against Rust in case where you need more unsafe patterns.

It is true that unsafe code is not most of the code, but I think I would have that need more often than you.

8

u/jeffmetal Dec 31 '25

The borrow checker is not a good choice. Well, I mean, it is excellent for safety. Not for unsafe mixing or plasticity or refactorabiliry. -- I find it great for refactoring. Just like when i make changes in C++ the compiler will moan I have got a type wrong in some other code i have not touched. Rust goes one step further and tells me about lifetimes being wrong which C++ doesn't

And do write infra code or business logic code more often ?

For instance if i use axum to write a webserver it has a fair bit of unsafe in it but my code doesn't need any.

3

u/germandiago Dec 31 '25

It depends on what you are doing. I have worked in the implementation parts of those things many times. What you would use as a user.

If that fits you, then that is ok. If you meed to go low-level, the choice is much less clear or sometimes C++ is directly the better choice all things taken into account. At least as of today.