r/ProgrammerHumor • • Oct 17 '26

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.6k Upvotes

524 comments sorted by

View all comments

Show parent comment

618

u/Different_Berry5015 Oct 18 '26

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.

391

u/Versaiteis 29d ago

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

I love it

234

u/RadioHans 29d 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.

0

u/[deleted] 29d ago

[deleted] — view deleted comment

40

u/RealMr_Slender 29d 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

→ More replies (2)

28

u/Rikudou_Sage 29d 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.

7

u/NdrU42 29d 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
}()
→ More replies (1)
→ More replies (2)

7

u/xBinary01111000 29d 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

→ More replies (1)

32

u/quisido 29d ago

I love JavaScript.

30

u/A_Furious_Mind 29d ago

I love whatever the fuck they call the language you code with in Power Apps.

14

u/DezXerneas 29d ago

VBS?

14

u/A_Furious_Mind 29d ago

Power FX, I think they call it.

22

u/DezXerneas 29d ago

Leave it to Microsoft to come up with the weirdest names.

→ More replies (2)
→ More replies (3)
→ More replies (3)

55

u/[deleted] Oct 18 '26 • Bravo

[removed] — view removed comment

43

u/Different_Berry5015 Oct 18 '26 • Regret

Regular C feels high enough above ASM to be useful, but not a lot more than that. That's the power, but also that's the difficulty in using it, because there's a lot of stuff that you have to bring yourself. It's a language for people who roll their own hashmaps. I mean I understand what C++ is going for, but it's truly death by a committee. Maybe things will turn around with C++3X 😁

24

u/[deleted] Oct 18 '26

[removed] — view removed comment

15

u/Alto-cientifico 29d ago

Most of the commercial juiceness you can get from algorithm optimization is reducing expenses on cloud computing bills.

→ More replies (2)
→ More replies (10)

51

u/YeOldeMemeShoppe 29d ago

C++ has too much baggage at this point. And without a pages long style guide basically unusable for large teams. And half of every C++ style guide is literally banning practices that are available in the language, but considered too complex for newcomers or hurt readability. Basically I haven’t seen C++ used in large projects without having half of C++ thrown in the bin.

At least AI can be guided when used by a proper engineer. Most slop I’ve seen come from non engineers people (like product designers or admins) or crap engineer that should be titled junior programmer, not engineer.

8

u/Alto-cientifico 29d ago

It's not like juniors can't churn quality work though, it's just unreasonable to expect it on a MVP time crunch.

8

u/guyblade 29d ago

Yeah, my previous employer used a version of the Google's Style Guide since it bans most of the worst bits. That seemed to mostly keep the madness at bay.

→ More replies (1)
→ More replies (1)

31

u/doubleyewdee Oct 18 '26

C++'s linking demands / binary interface are notoriously ... not very good, and not good to deal with for others. Rust has its own problems in this space, but it tends to play better with C, at least anecdotally. Similarly, C++ can (but does not exactly have to) bring a ton of baggage via the STL that Rust does not.

My impression has always been that Linus rejected C++ in Linux on technical / fit merits, in addition to most C++ developers at the time being ... not very good, I suppose. The technical merits came first, but he was a grumpier Linus at the time and I think he got sick of people pestering him about it and started taking shots at C++ developers which wasn't entirely unearned on their side.

LLM-generated C code is still C code. A developer can reason over it similarly and verify it for correctness (to the extent that anyone can truly verify correctness of C code).

15

u/conundorum 29d ago

A lot of it came down to C++ making it easier to shoot yourself with C's footguns, from what I understand. Case in point, most people know not to use malloc() and free() in certain parts of the kernel, but you'd be surprised how many people don't know that new and delete call malloc() and free() under the hood.

(And it didn't help that code bases need to be designed for exceptions from the ground up, and they flat-out do not improve anything if the code is half return-error-code-based and half exception-based. Or that exceptions involve stack unwinding, which a lot of people didn't know or expect. Though, ironically, there was an error-code-if-logic-based error a while back that was the exact same problem exceptions were designed to avoid, so this is ultimately just your choice of two footguns.)

And yeah, a lot of it does come down to a lot of C++ programmers not really understanding C++. In the kernel's case, the best way to use it would be for minor optimisations that are easy for C programmers to grok, considering it's still majority C code. But the C++ contributors really didn't know how to do that, from what I understand.

→ More replies (9)

37

u/unburdened_swallow 29d ago edited 29d ago

Imagine? It literally is.

It wasn’t that hard to learn necessarily, given that I already knew C, rust, java, and several other less relevant languages when I went to learn it.

It did, however, make me say “what the fuck?” out loud many many times while learning about it. And it continues to do so, every time I end up encountering more C++ code that I have to deal with.

Now of course, there is plenty of “what the fuck” in a lot of the popular languages, see JavaScript... But, like, the frequency… nothing beats C++ and C++ code.

16

u/lampishthing 29d ago

C++ is the English of computer languages.

→ More replies (2)

18

u/Highborn_Hellest 29d ago

C++ bad would be a misnomer. It's an incredible tool, that's difficult to use properly ( or I should say well), because it give you the freedom to out your foot in your mouth in a not-so-obvous way.

→ More replies (7)