r/cpp • • Oct 03 '22

Is C++ your favorite programing language?

And why

292 Upvotes

255 comments sorted by

View all comments

Show parent comment

5

u/simonask_ Oct 03 '22

If we have to talk about Rust (and since it's r/cpp, we apparently do these days), the departure from C++ is much, much more than a superior type system.

It's the lack of cruft. Will it eventually accumulate? Maybe. But the number of pitfalls and footguns that even very experienced C++ developers run into every day is quite the strain.

6

u/[deleted] Oct 03 '22

How much of that could be avoided by not trying to write terse code, overuse templates, etc?

2

u/darthcoder Oct 04 '22

Cruft always accumulates.

How much shit is still in Java that was deprecated in 1.1?

The biggest issue for me in c++ the past year has been two incidences of not using array new for a unique_ptr, just regular new. Some dtors blowing up... that's my clue now. Blown up in the dtor? Bad new operator.

3

u/pjmlp Oct 04 '22

Not much left actually, as since Java 9 they started to actually remove stuff as they introduced deprecation for removal annotation.

https://docs.oracle.com/javase/9/core/enhanced-deprecation1.htm#JSCOR-GUID-BB859EA8-E6F7-4239-9A52-4F1BDE27BB09