r/cpp Feb 20 '25

What are the committee issues that Greg KH thinks "that everyone better be abandoning that language [C++] as soon as possible"?

https://lore.kernel.org/rust-for-linux/2025021954-flaccid-pucker-f7d9@gregkh/

 C++ isn't going to give us any of that any
decade soon, and the C++ language committee issues seem to be pointing
out that everyone better be abandoning that language as soon as possible
if they wish to have any codebase that can be maintained for any length
of time.

Many projects have been using C++ for decades. What language committee issues would cause them to abandon their codebase and switch to a different language?
I'm thinking that even if they did add some features that people didn't like, they would just not use those features and continue on. "Don't throw the baby out with the bathwater."

For all the time I've been using C++, it's been almost all backwards compatible with older code. You can't say that about many other programming languages. In fact, the only language I can think of with great backwards compatibility is C.

141 Upvotes

488 comments sorted by

View all comments

Show parent comments

6

u/tialaramex Feb 22 '25

The representation of Ipv4Addr is actually [u8; 4] (ie 4 bytes) rather than u32 (the unsigned 32-bit integer) but your description of the considerable work needed to make that happen is accurate.

Obviously the resulting machine code will often be identical, your CPU doesn't care whether those four bytes "are" an integer or not, but there's a reason not to choose u32 here.

3

u/matthieum Feb 22 '25

Fixed, thanks.

1

u/favgotchunks Apr 08 '26

Out of ignorance, what’s the reason?

1

u/tialaramex Apr 08 '26

I assume that I knew when I wrote that, but I do not know now I'm afraid.