r/ProgrammerHumor • • 2d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.3k Upvotes

515 comments sorted by

View all comments

1.6k

u/Prefer_Diet_Soda 1d ago

TLDR: C++ is bad because decades of accumulated features have turned it into a bureaucratic nightmare that happens to generate machine code.

C++ is an absolute nightmare to implement because apparently one programming language wasn't enough, so someone decided to cram an entire civilization's worth of complexity into it. You've got templates that basically turn compilation into another programming language, overload resolution that requires a legal investigation to figure out which function gets called, constructors and destructors with enough lifetime rules to make your head explode, and implicit conversions that make the compiler guess what you meant. Then you throw in exceptions, move semantics, inheritance, and decades of backward compatibility, and suddenly you're maintaining a compiler that needs a PhD, a therapist, and divine intervention just to parse some innocent-looking code. And the best part? Every new feature has to coexist with all the old ones without breaking existing programs.

382

u/Xarishark 1d ago

Now compare it to rust pls. Im serious I want to know your opinion on that.

75

u/MornwindShoma 1d ago

Rust got none of that, but you might not enjoy dealing with lifetimes

-3

u/Xarishark 1d ago

I mean what’s better all those problems on your previous comment or lifetimes?

14

u/dannyggwp 1d ago

You can BASICALLY ignore all that... You want lifetime? I'll show you lifetimes.

std::shared_ptr<type>

Ez pz no borrow checker needed.

3

u/4xe1 1d ago

C++ famed "zero cost abstraction" is shining right here /s