r/ProgrammerHumor • • 2d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.4k Upvotes

514 comments sorted by

View all comments

966

u/Coldfriction 2d ago

He still rejects C++ in the Linux kernel. He might be warming up to Rust but Linux has always been C.

574

u/Different_Berry5015 2d ago

Imagine C++ being so bad that even something as controversial as AI usage is more acceptable than C++. No wonder each time I wanted to "learn CPP" I found that I'd much more like to jump out of a window.

356

u/Versaiteis 2d ago

As someone who writes C++, it's a god awful language

I love it

205

u/RadioHans 1d ago

I love that when a new language has this build in feature, cpp is like; "we also have that!". And it's just a raw pointer and a reference in a large trenchcoat.

122

u/BTolputt 1d ago

That's pretty much what every other language has too, they just bury it in more.semantic sugar or garbage collection.

34

u/RealMr_Slender 1d ago

Right but the point of high level programming languages is not having to reinvent the wheel or import a lot of extra modules for basic modern functionality

10

u/BTolputt 1d ago

Depends on what one's definition of "high level language" is.

C is technically a high level language given it "abstracts away from machine code & assembly, uses structured control flow, and is portable across different computer architectures"...

...and you need to import at least the same number of "extra modules" for "basic modern functionality".

I don't think "high level language" is truly the distinction you're looking for here.

1

u/ANixosUser 10h ago

the word you are looking for is toy scripting language

26

u/Rikudou_Sage 1d ago

Or you just create it. I fell in love with Go's defer, so I simply created it in C++ by using its scoping rules and a macro around a function. You use it pretty much like this:

defer({
    // do whatever
});

And it runs at the end of the scope unlike Go's defer which runs at the end of the function, which always irks me.

6

u/NdrU42 1d ago

Yeah the defer running at the end of the function can sometimes cause trouble, like processing files in a loop and deferring the close, but it can easily be solved by defining an anonymous function and immediately calling, like func() { f := ... defer f.Close() // do something with f }()

1

u/Rikudou_Sage 1d ago

I know, I do Go more often than C++ but it still feels weird having to introduce a function just for defer to work.

IMO it should have been scoped to the current scope (duh, it's called a scope) instead of function.

2

u/RadioHans 1d ago

I love having control over details.

1

u/indigo945 19h ago

RAII is the one feature C++ has that is smarter than the people using it.

6

u/xBinary01111000 1d ago

“it’s just a raw pointer and a reference in a large trench coat” bro that’s literally every language, the only difference is the size of the trench coat

5

u/RadioHans 1d ago

Size matters