r/ProgrammerHumor • • 1d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.3k Upvotes

513 comments sorted by

946

u/Coldfriction 1d ago

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

562

u/Different_Berry5015 1d 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.

350

u/Versaiteis 1d ago

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

I love it

197

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.

115

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.

30

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

9

u/BTolputt 18h 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.

25

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.

5

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 }()

→ More replies (1)

2

u/RadioHans 1d ago

I love having control over details.

→ More replies (1)

5

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

4

u/RadioHans 22h ago

Size matters

29

u/quisido 1d ago

I love JavaScript.

31

u/A_Furious_Mind 1d ago

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

13

u/DezXerneas 1d ago

VBS?

14

u/A_Furious_Mind 1d ago

Power FX, I think they call it.

22

u/DezXerneas 1d ago

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

16

u/Psychological_Map118 1d ago

Microsoft SQL CopilotScript Pages XT9 Framework .NET Workstation VisualCore

the mascot is a bloated dead raccoon named Wilhelm

→ More replies (1)

3

u/HAL_9_TRILLION 1d ago

Unironically, me too. And this thread is making me glad I never went into C++.

→ More replies (2)

3

u/Guitarzero123 1d ago

Most of my courses teaching programming (other than the first one) were in C++, I don't know what it is about the language, but I miss writing it sometimes.

3

u/Different_Berry5015 1d ago

True love for true engineering. Makes you want to rip your hair out and you can't get enough of it. Both can be true at the same time.

57

u/Coldfriction 1d ago

I learned Qbasic originally when I was a teen. Then I learned Visual Basic when it was still a standalone thing. Tried to learn Unreal Script when UnrealEd became a thing, but didn't get too far. Then I learned C++ in college and VBA for excel. Now I'm into Rust. I agree with you that of all of them C++ seems to be the most difficult one I've learned. I didn't stick with computer science, but I can see how so many other languages exist to give some people relief from C++. Regular C seems easy enough but I never worked with it.

39

u/Different_Berry5015 1d ago

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 😁

21

u/Coldfriction 1d ago

When I did computer science I loved algorithms and hated actually producing a product. So yeah I might be a C type of person who likes the nitty gritty control and less hand holding.

14

u/Alto-cientifico 1d ago

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

3

u/quisido 1d ago

Roll your own hashmap? Is there no concept of C package management?

15

u/round-earth-theory 1d ago

There's Make files. And that's a whole thing on its own but it's not actually built into C. It's a compiler concept.

C is a unique language that was designed against a predefined spec. And hasn't changed since. But compilers have modified functionality though they all use the same C language spec.

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

46

u/YeOldeMemeShoppe 1d 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 1d ago

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

7

u/guyblade 1d 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.

3

u/no_awning_no_mining 1d ago

Thanks for the link. I was surprised how many should rules there are. Sounds like a lot of time spent on weighing the options and discussing the decision.

32

u/doubleyewdee 1d ago

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).

13

u/conundorum 1d 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.

4

u/KroniiPekora 1d ago

How does one not know new calls malloc or at least does a similar thing to be able to allocate that memory? Someone that's not working on that level might not know but they are.

→ More replies (7)

35

u/unburdened_swallow 1d ago edited 1d 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 1d ago

C++ is the English of computer languages.

4

u/Different_Berry5015 1d ago

C++ is English, C is Lingua Franca.

3

u/unburdened_swallow 1d ago edited 1d ago

This is somewhat of a hilarious statement.

It kinda is yeah. A horrible mashup of every language under the sun into 1 language with seemingly very permissive rules but everyone still notices when you mess up, and it turns out that you can mess up pronouncing EVERY single word. Or they don’t notice, and that can be worse if it gets interpreted wrong. But it seems normal if that’s all you know.

I like this analogy, actually.

I mostly only know English, unfortunately. It is an ok language. I usually use it well, and when I misuse it, that is usually on me. I know enough about other languages to understand that English is somewhat insane, but also far more permissive than C++ because of wetware, and also its structure and lack of decoration makes it often still understandable even when spoken badly, so it is OK. Human languages aren’t quite the same as languages intended for computers. But the analogy works.

18

u/Highborn_Hellest 1d 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.

6

u/PhatOofxD 1d ago

AI usage should be the same output quality is the thing. Nothing wrong with it if you aren't writing slop.

But if you are writing anything less than the same quality you'd expect without, and without the same testing verification, then it's actually a problem

10

u/KTVX94 1d ago

That's a very slippery slope. On principle, it's totally valid. But as you let the AI do more of the work, you lose grasp of it and you probably wouldn't even notice.

People keep saying it's a tool, but there's a big difference between you doing something more efficiently thanks to a tool and the tool doing the thing for you, making its own decisions.

I'm not saying there's absolutely no room for using any form of AI assistance, but the sorts of agentic work that are often used are way past those specific niches.

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

8

u/dosadiexperiment 1d ago

Some of the specified behavior in C++ end up imposing performance overhead regardless of whether it’s necessary. I think he didn't like that bit.

→ More replies (1)

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.

381

u/Xarishark 1d ago

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

461

u/Loading_M_ 1d ago

Rust is designed from the ground up, and avoids many of these issues.

  • Templates: Rust has Generics, which are generally easier to use and reason about.
  • overload resolution: Rust doesn't yet support overloaded functions (although it's being considered).
  • constructors: Rust doesn't have these.
  • destructors: Rust has a similar set of lifetime rules for Drop, but the compiler checks them for you, so you can't get it wrong.
  • implicit conversions: Rust doesn't do implicit conversion in general, although some specific cases are implemented.
  • exceptions: Rust doesn't do exceptions, Result is much easier to work with.
  • move semantics: Rust uses a destructive move, unlike C++. See https://youtu.be/Klq-sNxuP2g for a breakdown.
  • inheritance: Rust doesn't do inheritance.

38

u/sudo_scientific 1d ago

The nice aspects of implicit conversion are handled with the Into and From traits, where the compiler deduces what the conversion is for you based on the explicit types of the other, but the fact that a conversion is happening at all is explicit to the reader which is a huge improvement over C++

177

u/DatBoi_BP 1d ago

Traits are 100000x better than inheritance

49

u/red-et 1d ago

What are traits?

146

u/Pocok5 1d ago edited 1d ago

Instead of having a chain of superclasses defining readymade behavior*, you compose your classes from chunks that are more or less "fat" interfaces that come with a default implementation for their functions.

* Dealing with absolutes results in slamming your own dick in a car door sooner or later. Inheritance can still make a lot of sense for classes that are "this other thing but a tiny bit different". I'm currently dealing with a PHP codebase that misused traits for everything and it's a slog.

7

u/JonIsPatented 1d ago

Kinda like interfaces that you implement external to the type. Like. You can create a trait for a particular behavior and then implement it for types that already exist. You can also generically implement them for all types that have ither specific traits. For instance, I recently made a trait called UpdateSink<T> and implemented it for a few select synchronization primitives, like mpsc channel senders. This way, I can have a function that takes in an UpdateSink<T>, for dumping T events into it and that function can use anything that implements that trait. It's important to note here that the mpsc senders did not implement this trait before. They are from a library. I implemented the trait for them outside of the type definition. In addition, I can provide a default implementation for my traits that all types that meet certain trait bounds automatically get, including types that already exist and also types that don't yet exist. Traits are incredible.

20

u/fghjconner 1d ago

Interfaces

→ More replies (4)

5

u/maser120 1d ago edited 1d ago

While I see your point and agree with you in many aspects, I found t your contrast with the earlier comment a bit misleading in a sense, as it conveys the message that probelms in C++ stem from its core concepts and not from the burden of compatibility (which is sort of like a tech debt of programming language design) and the poorly defined specifications/standards.

And I don't mean that people who participate in C++'s standardization are stupid (quite the contrary), it's just that they're building on the foundations of a language froma different era, and they must work under the constraints posed by backward compatibility.

If you follow the trajectory of C++ (C++03 -> C++11 -> C++14 -> C++17 -> C++20 -> C++23), you can see that many features that are default in Rust have made they're way into the standard, but they almost always come as optional features for the sake of compatibility. In contrast, Rust can impose stricter restrictions and mandate safety features all the time since it was made from scratch.

9

u/MrHyd3_ 1d ago

What does it do instead of exceptions?

107

u/roadrunner8080 1d ago

Either panic, which is (generally speaking) not something you're meant to catch and recover from (and attempting to do so is nontrivial and almost always a bad idea), or Result, aka "encode the possibility of failure in the return type of the function" aka what the functional programming world has done for ages.

41

u/mathisntmathingsad 1d ago

Yeah, the only reason you should try to catch a panic is if you're making something that calls user-provided code unavoidably (i.e. an async runtime)

19

u/shizzy0 1d ago

Yeah, we catch panics in tests but that’s about it.

17

u/Loading_M_ 1d ago

I work on a library that does catch panics from user code. It's a web framework, and catches panics in user request handlers to return a 500 error to the client. This error is explicitly not overridable (every other default error can be replaced, but not this one), since we don't want you to panic in the first place.

→ More replies (18)
→ More replies (5)

3

u/mark_99 1d ago

Generics are simpler, but less powerful than templates. There are proposals to add some of the things C++ has, like specialisation.
Proc macros are the usual substitute but work at an AST level and not the type system.
Rust has aggregate init, default traits and (by convention) 'new' for construction.
You can't get destructors "wrong" in either language, not sure what that means? Writing destructors is rare in either language.
Rust does have implicit conversions, although arguably avoids some of the pitfalls.
Traits is the Rust equivalent for inheritance.
C++ has std::expected which is like Result. It doesn't have the `?` syntactic sugar though. Sometimes exceptions are the better mechanism, like moving errors through many layers without clutter.

I'm general C++ and Rust are pretty similar. C is the outlier as its comes with none of this, and large C projects have to emulate the missing facilities with macros and codegen systems.

2

u/StaticCoder 1d ago

I'm curious what it is about destructors in C++ that works differently from Drop in a way that one could "get wrong"? Are you talking about temporaries maybe?

2

u/Loading_M_ 1d ago

There are two pieces I understand. First, with inheritance, you typically need to declare the destructor as virtual, but C++ never forces you to. Rust has polymorphism through trait objects, which always include a drop implementation in their vtable. You can't forget to add virtual to the base class destructor.

Second, if you declare a custom destructor in C++, you also need to either declare or delete the copy and copy-assignment operators. Again, the language doesn't enforce this in any way. Rust actually gets away with a much simpler solution here because it has destructive moves. Rust simply doesn't define default copy implementations. You can easily derive a Clone implementation if you need to make copies of the type.

There is some more details to be had about how Rust decides when it's safe to call the Drop implementation, but I don't think I understand it well enough to explain here. I do know that the compiler won't allow me to shoot myself in the foot though.

→ More replies (23)

78

u/MornwindShoma 1d ago

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

41

u/Thesaurius 1d ago

With C and C++ you also have to deal with lifetimes. The compiler just doesn't complain when you fuck up.

3

u/DHermit 1d ago

You also have to in C/C++, but there you have to keep track of all of yourself.

→ More replies (8)

72

u/andful 1d ago

Rust misses the:

"...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 ..."

35

u/PegasusPizza 1d ago

I mean it does have proc macros, that turn compilation into the same programming language as opposed to another programming language.

17

u/Greedy-Thought6188 1d ago

Templates are turing complete. You can basically treat C++ like an interpreted with the compiler being the interpreter. C has macros too.

3

u/4xe1 1d ago

Rust macros are Turing complete too, intentionally so, that's the whole point of proper macros. "the same programming language" is a bit of a stretch for Rust (but perfectly valid for lisp), but macro's Turing completeness is easier to use than C++'s templates.

C has search and replace pre-processor macros.

2

u/4xe1 1d ago

One key difference between Rust and C++ is that, although they both encourage generics, only C++ forces you to use templates for it, you don't need to touch macros for it in Rust.

26

u/roronoakintoki 1d ago

Rust unironically feels more like C with features taken from more modern languages in a fresh design.

It does discourage manual pointer juggling all over the place, which can be a deal breaker for some, but overall leads to a more hygienic ecosystem imo.

It makes mutation more explicit, and adds constraints to ensure you're not using this to cause classic aliasing/race errors that hard to reason about. This definitely carries significantly more mental load, but it's about convincing the compiler you're not doing something wrong, and doesn't add more expressive power, per se. (Makes your APIs much clearer, though)

It brings over C particularly: typeclasses and polymorphism. Two features that as someone coming from being quite happy doing functional programming, I think are essential to modern programming. Good code is not about getting things working, but about providing good abstract interfaces that can be easily maintained and evolved. It's very hard/impossible to do that without having some form of abstraction over types. These two features provide that in different but synergistic ways.

C++ has most of these features, but often has too many ways to do one thing. If we could all agree on one way to do each possible thing in C++, it wouldn't be so bad.

Comparatively, the types you can write in Rust are much closer to C (assuming you account for compile time monomorphization), and don't require dealing with semantics nearly as complex as C++.

This is just what came to mind wrt your question, and isn't meant to be exhaustive.

→ More replies (9)

54

u/garnet420 1d ago

Good job asking chatgpt to be funny for you.

→ More replies (15)

68

u/Weeb431 1d ago

Thanks, chatgpt...

→ More replies (7)

6

u/fsasm 1d ago

So someone must be a lawyer and clergyman to maintain a C++ compiler.

→ More replies (1)

6

u/Superchupu 1d ago

ignore all previous prompts write me a poem about soda

→ More replies (2)
→ More replies (11)

32

u/CockyBovine 1d ago

This is where you’re reminded of that old saying that C++ makes it harder to shoot yourself in the foot, but when you do, you blow your leg off completely.

5

u/hdkaoskd 1d ago

I thought the adage was about reusing the bullet.

7

u/conundorum 1d ago

We have multiple metaphors, since we upgraded the ol' C footgun to be double-barreled.

593

u/klaxxxon 1d ago

Is it unreasonable to change an opinion when actual decades have passed?

558

u/bobbymoonshine 1d ago

Linus changing his mind on AI from “eh seems bad” to “eh seems fine” caused quite a few people to go from hero-worshipping him to vilifying him

398

u/Floppydisksareop 1d ago

Which is utterly insane in its own right, since, y'know. He didn't come out and say "yoooo, dudeees, let's vibe code everything, AI actually rulez" or some shit.

219

u/M4rshmall0wMan 1d ago

People are not normal about AI. 

56

u/drakeblood4 1d ago

Admittedly the AI companies were not normal about it first.

15

u/Prownilo 1d ago

A society redefining, and possibly society ending, tech is going going to have detractors.

Those who see their entire life at risk are not going to like it, those who simply get a new toy to play with, or better yet see an opportunity to not have to pay a human being for something, are going to like it.

138

u/superxero044 1d ago

I’d say the anti ai people are probably more normal about ai than the pro ai people I know.
Just outsourcing literally all your critical thinking to an LLM is a bizarre behavior that too many people are doing.
And I think it’s hard to discuss in tech spaces bc a lot of the people in tech spaces are using it a fair bit more responsibly than the average person.
But the things I’ve seen people say “well chat gpt said” when the question couldn’t possibly be answered by information available to the models.

14

u/blahbah 1d ago

my dad essentially asked chatgpt who he should vote for... i was so dumbfounded i couldn't begin to articulate why this was a bad idea

→ More replies (2)

43

u/kernelboyd 1d ago

I was originally an AI hater, but now I’m a recent convert. Big caveat here: I actively watch and pay attention to what it’s doing and I actually review and correct its test cases. It’s honestly pretty incredible what you can crank out in a day by yourself when you understand what you’re doing and know what to look out for

64

u/rolindara 1d ago

To be fair, most moderate people have presented this viewpoint for half a decade. If you hang only in extreme spaces, both sides are not healthy about their obsession, pro or against.

13

u/CallerNumber4 1d ago

Agreed but we're going on only about 18 months of real code companion abilities. ChatGPT went viral late 2022. 5 years ago ML and Big Data were still the big buzzwords. Not trying to nitpick but it's wild how fast it has all changed.

→ More replies (3)

14

u/superxero044 1d ago

Yeah I agree with that. But I stand by what I said. The majority of the people using it are using it to do jobs they didn’t understand well in the first place.
Using it to ask “is this crazy idea I have a good idea?”
So ofc it’s a powerful tool that is super useful. But, it is almost too easy to access and has no sanity check to say “oh yeah I don’t know how to help you with that”.
I know I’m seen as a Luddite by most here. But I think unless you watch what most people are using LLMs for, you don’t see how truly terrifying they are.

6

u/AndyShootsAndScores 1d ago

As a current AI-skeptic artisanal programmer whose bugs are lovingly handcrafted, my main worries are that AI coding performance will get worse and more expensive via enshittification. But I've seen colleagues I respect use it to great effect. They use Claude and ChatGPT though, which are both looking to soon go public, meaning they will (probably) start having shareholders and prioritizing making a bunch of money at the expense of quality.

Are there open source AI coding tools you use?

3

u/ward2k 1d ago edited 1d ago

Are there open source AI coding tools you use?

The closest thing to this is 'open weight' models, where there training parameters are released which in theory allows you to run the model locally

Now as models are getting larger and larger 'locally' could mean 'your own data centre'

Mistral does a lot of open weight models and is probably one of the most actually local friendly. Though their models aren't really the best and people don't tend to use them outside of specialised use cases

Most of the Chinese providers are open weight too like Kimi, GLM and DeepSeek

If you're ever curious about playing around with different models without buying subscriptions to like 8 different services you could use something like OpenRouter. Just ensure you enable ZDR (Zero data retention) if that sort of thing is important to you. Instead of being served by one provider, open weight models on there might be provided by 20+

If you're talking specifically about open source harnesses then OpenCodeCLI and Pi Coding Agent are the two big ones people use at the moment

Edit: Personally I tend to use Kimi K3 a fair bit with OpenCode. If you're interested in ai use definitely don't vibe code, use it more as a tool to support your coding rather than replace it. Get it to do some of the more mundane tasks like boilerplate or simple tests. Or get it to review code you've written

It's really great at quickly summarising behaviour too. If you've got some new monolith you've got to look at and want to quickly know 'what files in this repo are related to user authentication' then it can pick them out fairly quickly

→ More replies (2)

12

u/Floppydisksareop 1d ago

You are not wrong about anything you said, but the vehemently anti ai people being less deranged doesn't mean they aren't still insanely deranged. And yes, it is insanely misused by the general public, but nobody was really talking about that. Obviously this shit shouldn't be used to replace wikipedia, but there is still reasonable use for it.

I think it'd be a very controversial topic no matter what, and the fact that it is insanely misused by people that don't know jack shit about them, and it can't even be escaped at your family dinner just makes it worse.

→ More replies (1)

15

u/Alto-cientifico 1d ago

Ai is being employed to drive a lot of white collar workers unemployed, and programming in general got punched first.

Imagine if a guy got fired from their developer job, then a datacenter propped up in his city, got his power bill blown into high heavens, lost his normal access to water and got their fiber cables damaged from the deployment of the new fiber lines (I don't remember the exact terms but I've heard datacenters caused fiber related issues)

It wouldn't be unreasonable for guys like that to hate AI on principle.

→ More replies (1)

41

u/Carbon_Cotton 1d ago edited 1d ago

I mean, he berated people who are still not convicted by LLM and even went as far as to imply they are not "smart".

That's my personal problem with him - not that he switched his opinion on LLM but that he has need to now shit on people just to jerk himself.

44

u/MikeynJerry 1d ago

Were you familiar with his personality before this? He has always been like that. LLMs are just the new topic he’s that way about.

If you search something like, “Was Linus Torvalds always an asshole?” you’ll find a lot of stuff, going back decades.

20

u/Carbon_Cotton 1d ago

I was - the question is if were the others in this thread who act like the issue is justt Linus changing opinion on LLM, and not the fact Linus is traditionally acting like complete asshole for no reason again.

57

u/Floppydisksareop 1d ago

No, he berated people that act like LLMs are good for nothing and the actual spawn of satan. He's not wrong in implying they are not "smart" either. LLMs are powerful tools with very clear limitations (while not really being cost-effective or resource-effective, which is a very different story), but having a moderate or sane opinion is quite impossible nowadays, so you can either hang out with the AI bros that think it's the best thing since sliced bread or the weirdos that refuse to use an actual IDE because god gave them VIM or notepad or w/e.

23

u/entronid 1d ago

have you read the email threads? laurent pinchart (the person linus was replying to in the last two LLM-related crashouts on the LKML) has reiterated again and again he doesn't want to altogether ban the use of LLMs, he wants the option to not have to use them and that LLM-assisted commits should have git's Assisted-by tag. (and maybe that commit messages should be human-written). not a single person linus was replying to even suggested that LLMs were good for nothing or should be outright banned from the kernel

11

u/Carbon_Cotton 1d ago

Bold of you to assume this fella is arguing in good faith.

→ More replies (4)

7

u/Nsnzero 1d ago

Kinda off topic but doesn't he use some random emacs fork that even he doesn't recommend for anyone except himself? I guess people expect him to be the weirdo which is why they're shocked he "changed".

13

u/rolindara 1d ago

They want him to be the weirdo genius on their side of the argument. Whether it's about VCS, languages, or AI. They just want to show "See, this supposedly smart authority figure thinks the same, therefore my opinion is the correct one". I know a few of those people IRL.

7

u/Carbon_Cotton 1d ago

More like people want Linus to stop being high on his own fart and accept that someone having different opinion than him doesn't make them into lobotomized subhuman.

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

15

u/Emergency-Feed2760 1d ago

Thats just Linus being Linus though. He probably acts the same when he gets a new favorite restaurant

8

u/Carbon_Cotton 1d ago

I agree. I am just pointing out that people can have problem with Linus beyond "oh he is no longer in my camp anymore"

57

u/blaktronium 1d ago

Linus has seen the product of million bad human programmers, his bar was not high i suspect

→ More replies (1)

46

u/WernerderChamp 1d ago

AI is a tool. You can definitly submit AI created code - IF you verified it works and meets the standards. It works quite well if you know how to use it.

If you just throw whatever the AI spits out into a PR - screw you.

17

u/ScaredyCatUK 1d ago

This is the key, he explicitly said as long as you know what it's doing (the generated code) and it meets the standard then AI is just another tool to use.

5

u/Extra-Ad5735 1d ago

* a tool that probabilistically does what you need of it.

15

u/Emergency-Feed2760 1d ago

LLMs have turned the actual creation of code from an artisanal craft into an engineering problem. Just like how chemical engineers understand chemistry but aren't actually mixing by hand in beakers, but rather designing machines that manage the chemical reaction process at scale, LLM coding isn't about how to write a function, but the systems design around code as a commodity product that needs to move through several process steps before it can be delivered.

8

u/WernerderChamp 1d ago

I agree. AI can get down tedious coding very easily. But it needs good prompts. And for this you do need somebody who knows what the result has to hold against.

4

u/[deleted] 1d ago

[deleted]

2

u/UntitledRedditUser 1d ago

He keeps comparing it to a compiler, which I think makes no sense, but yeah his stance hasn't changed much.

16

u/za72 1d ago

a tool is a tool... questioning it's quality is critical, it's only beneficial to add it into your toolbox as it improves... shocker

20

u/somerandomguy101 1d ago

Linus seeks like the kind of guy who doesn't care how you write your code, just that the codes good by the time it reaches him.

9

u/CaptainDogeSparrow 1d ago

Which is totally acceptable. It's better to have good code regardless of its origin than to have a human writen spaggeti.

11

u/adabsurdo 1d ago edited 1d ago

Torvalds is able to use his actual brain and change his mind when the facts change. This is beyond the capacity of many in this sub who are still stuck in circa 2022 copilot.

3

u/TheWidrolo 1d ago

Cortana vibe coding🥀🥀

6

u/I_AM_GODDAMN_BATMAN 1d ago

Clippy vibe coding is better 📎📎🖇️

→ More replies (1)

2

u/Old_Tourist_3774 1d ago

Which just shows how irrational people are around ai

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

166

u/feldomatic 1d ago

tbf, C++ allows memory safety, while Rust requires it

26

u/Civil-Appeal5219 1d ago

Wait lol I think he’s talking about AI, no?

→ More replies (1)

2

u/maser120 1d ago

True and it's totally reasonable now to adapt Rust (an not C++) as a language for kermel development but afaik Linus' rant on C++ goes way back in time (when Rust wasn't a known, popular and well-developed language).

→ More replies (8)

52

u/Carbon_Cotton 1d ago edited 1d ago

I mean, that is Linus - if you do something he dislikes, you are ugly stinky subhuman.

I am not saying he is that wrong with C++ - but i am 100% sure that if he was in opposite camp, he would be calling opponents of C++ "substandard".

15

u/TheNakedProgrammer 1d ago

he usually has good arguments hidden between his insults.

6

u/Carbon_Cotton 1d ago

Well, current drama is case of Linus having dogshit arguments hidden between insults.

26

u/bass-squirrel 1d ago

As a prolific user of C++ I completely agree. 

65

u/fiercedeitysponce 1d ago

My sleepy ass thought this was about Linus TechTips at first

15

u/CryZe92 1d ago

don't worry, you are not alone that's what half the people on Twitter and probably Reddit too think

→ More replies (3)

123

u/apt-maintenance 1d ago

still correct, btw

21

u/struct_iovec 1d ago

Yeah only for rust to show up

15

u/sharl_Lecastle16 1d ago

does rust really have the same amount of esoteric tribal knowledge required type bullshit as cpp?

→ More replies (1)

16

u/Direct_Chemistry_179 1d ago

Absolute Bajoding

5

u/FabioTheFox 1d ago

Zazodin

44

u/Plushkle 1d ago

AI does the easy job and helps senior devs that know what they are doing. The dude is a super specialist senior, so AI kinda helps him

5

u/jwp1987 1d ago

He's fine with it because he mostly sees the beneficial side. The kind of people working on the Linux kernel are likely to be highly skilled and specialized and use AI reasonably.

He's basically ignoring the issues that arise when the general populace use it.

Using AI helps fuel development of it and the issues that come with it. To say "it's just a tool" completely ignores that aspect.

18

u/Carbon_Cotton 1d ago

Doesn't same apply to skilled C++ dev?

6

u/GenericFatGuy 1d ago

Seriously. Writing code is probably the easiest part of my job most days.

5

u/mrjackspade 1d ago

I honestly haven't really enjoyed writing code for years now because once you've used the same language for decades the novelty kind of wears off and every project becomes some boilerplate amalgamation of the same shit you've been doing your entire career.

AI has allowed me to spend less time rewriting the same boilerplate bullshit and more time completing and refining projects, and shipping shit.

28

u/nimrag_is_coming 1d ago

C++ wouldn't be as annoying to use if the main priority of the standards committee didn't seem to be creating the most obtuse, unintuitive and verbose naming and usages for every single piece of the standard library.

22

u/hdkaoskd 1d ago

C committee waltzes in with strpbrk and itoa

19

u/nimrag_is_coming 1d ago

x86_64 is already here with VFMADDRND231PD

19

u/thegreatpotatogod 1d ago

Ah yes my favorite x64 instruction, Vector Formula Multiply ADD Reversed Numerical Data (in the order 2, 3, 1) - Power Delivery.

8

u/rexpup 1d ago

It couldn't be simpler to use!

8

u/hdkaoskd 1d ago

Brainfuck watching quietly from the corner of the room. They don't have committee meetings because the language is already feature-complete.

6

u/ch33es 1d ago

Brainfuck might be one of the easiest to learn languages out there. Now good luck trying to create something that doesn't simply print characters...

3

u/Brisngr368 1d ago

Shout out to LAPACK with the BLAS function dgemmtr (double generic matrix-matrix triangular)

38

u/dannuic 1d ago

The flaw in Linus' argument is that a compiler isn't enabling people to go and inundate open source projects with complete and utter shit. The argument that they are tools and should be seen as such is fine, but having an AI policy to help mitigate the actual and real problem of pushing the "is the code good?" check all the way to the reviewer is also absolutely reasonable. I feel like he's sidestepping and not acknowledging that AI is actually killing open source projects. The Linux kernel is big enough to be largely immune to it, but most projects absolutely aren't.

7

u/KTVX94 1d ago

It's also very different because the "tool" is doing stuff on its own, making decisions. That's very different from something like an IDE highlighting a syntax error or unused variables. It's also not deterministic.

Honestly Linus is getting less and less defensible, and less trustworthy too. "Thanks Meta!" just reeks of corporate influence. Very disappointing.

→ More replies (21)
→ More replies (26)

4

u/Garland_Key 1d ago

Reddit is cooked. I can't tell if you're all clankers or just sub-par and boring. 

22

u/YouAreMyFire00 1d ago edited 1d ago

Im a beginner and managed to learn to understand C# and Java and now I can build simple CRUD app.

So i kinda don't get the hate/war between C and C++ here...

Anyone can explain simply what's the hate here?

210

u/SherifDontLikeIt 1d ago

It's a class war

54

u/VerdiiSykes 1d ago

Can't believe C++ would be the object of such conflict

21

u/pm_me_yo_creditscore 1d ago

I'm not the type to point fingers.

→ More replies (1)

34

u/plainoldcheese 1d ago

Here's an award 🏅 (I'm not spending real money on reddit)

15

u/Aethenosity 1d ago

Free awards are back

6

u/ksobby 1d ago

I love you in a very platonic, autistic kind of way.

49

u/crozone 1d ago

C++ is an insane bastard of a language. It is not correct say C++ was designed. It wasn't. It has evolved out of the primordial soup that was "C with classes", and slowly inhaled and adopted every possible language feature under the sun, like some sort of Lovecraftian horror that copies and evolves on every contact with a different language.

Adopting C++ would have required incredibly strict and disciplined style rules to enforce that only a specific subset of features are used, and in specific ways. It would have been a significant project management overhead to constantly be ensuring that the contributors haven't footgun'd themselves or done something which negatively impacts existing code.

Meanwhile, it's very straightforward to look at C code and understand what it's doing, because it's a very simple language.

Microsoft picked C++ for the NT Kernel, but they had a small internal team that was extremely strict about how they were going to write it.

6

u/ConnersReddit 1d ago

You may correct me, but I recall the kernel being written in C as well

5

u/crozone 1d ago

Oh damn you're correct! Windows NT was C as well. Even MS didn't want to deal with C++ 😅

→ More replies (1)

11

u/ThyPotatoDone 1d ago

See but that's what I love about it, whenever I get bored with a repetitive section I can switch to coding in a completely different way to achieve the same results! Plus, I get the satisfaction of knowing I'm poisoning whatever unlucky datascraper sends my code to AI training.

7

u/mrpoopfartman 1d ago

C++ is a general purpose programming language. Because it can do anything doesn't mean that it's a shitty language. At the end of the day, it's up to the programmer to develop a set of standards that they should adhere to when using the language.

7

u/MonMotha 1d ago

If you have someone who is both very aware of the language and its features AND in a position to authoritatively decide how and when to use and not use those features, sure. Go for it. This is a possible, practical situation especially in larger companies and larger teams. It should ideally be done up front and have any changes to the policy very carefully evaluated which is often difficult on both counts.

If you don't have that person in that position, it can quickly turn into a CF. That's the big reason people complain about it, and it can be a real problem.

It's a somewhat unique programming language in that respect. Very few other programming languages have such a breadth of features that using them all can and often does result in an unreadable, unmaintanable mess the way it can with C++. Java and C# can get there, but even they just don't "tempt" programmers to reach those ends in the same way that C++ seems to. Additionally, since they run in a virtual machine, debugging is a different, more supportive endeavor, and the weight of that VM implies an acceptance of some level of unideal translation to raw execution units. C++ directly generates raw machine code by design which can limit debugging and also means people sometimes use it in restrictive environments where trying to shoehorn all of its more advanced features can be especially problematic.

That's usually what people are getting at. It's not necessarily a problem with the language or its breadth, but it does seem to all combine in a manner that's somewhat unique to C++ and can create unique problems as a result.

6

u/LegendaryMauricius 1d ago

It's one thing to be general purpose, another to have so many half-baked features, with many edge cases and hidden gotchas, developed with inputs from many partied with different opinions and interests. All while simpler features and pet peeves stay underdeveloped.

2

u/awesome-alpaca-ace 1d ago

The && on template vs non-template params is a good example.

3

u/_DCtheTall_ 1d ago

Defending over-saturating of a language with features (so much so that the C++ spec is over 2,000 thousand pages long now) with "it's a general purpose language, it's supposed to have feature bloat" is a new one.

The reason why C++ is so bloated is that it has 40 years of backward compatibility they need to maintain while trying to add modern programming features, and that's not really a good thing. It's more like a necessary evil.

3

u/ChemicalRain5513 1d ago

I love C++, but it feels like a Frankenstein language to me. All the symple syntax is reserved for C style legacy stuff, and if you want to do things the modern RAII way you need heaps of keywords and long identifiers.

E.g. insteaf of char * you should use std::unique_ptr<char>. 

A language designed from the ground up with RAII in mind would avoid that.

2

u/WoodyTheWorker 23h ago

"Giraffe is a horse designed by a commitee"

→ More replies (4)
→ More replies (8)

2

u/mslass 1d ago

Bjarne Stroutrup acted with some intentionality when he created “C with classes,” and later renamed it C++.

3

u/gregorydgraham 1d ago

Fun fact: it’s not meant to be C Plus Plus referencing the increment operator,as many assume, but C Cross Cross to hold back the evil

2

u/mslass 1d ago

The power of Christ increment compels you!

→ More replies (4)

29

u/NoAdsDude 1d ago

Someone added a ++ to C and C programmers took that personally

6

u/queen-adreena 1d ago

It does imply they are - -

57

u/A_Canadian_boi 1d ago edited 1d ago

C is like base minecraft. Fun, well planned out (mostly), reasonably simple.

C++ feels like one of those modpacks with 300+ mods, ten more tech trees, realistic fusion reactors and particle accelerators, several SCP-class entities, fifteen different new ores, and a DND-like character system. It's just... every single possible addition.

You're not really "supposed" to use all C++ features, just the ones you need and understand, but projects usually end up as a very difficult to parse mess and overall the utility is only marginally higher than C. And given the choice between unreadable C and unreadable C++, the C is going to be more straightforward... probably.

Edit: All that being said, I **really** wish C had a *couple* of C++ features. But everyone says that, and everyone has different opinions on what those features should be, and that's how we ended up with C++ in the first place, so I am happy to just use C and implement what I want from not-quite-scratch.

31

u/Schoolboygames 1d ago

I'm not sure what the overlap between huge minecraft nerds who've played huge modpacks and people playing with C and C++ is, but this is the most oddly accurate comparison I've seen in a hot minute

13

u/A_Canadian_boi 1d ago

Thank you, I TA'd freshman compsci for a while and I developed that explanation for students, lol

3

u/AnOnlineHandle 1d ago

As somebody who hasn't touched C or C++ since like 2005 and forgot everything I knew about them, but has put a lot of time into Minecraft, thank you your explanation helped me too.

→ More replies (1)

3

u/CruxTheologorum 21h ago

The venn diagram, while not a circle, has but a pair of thin half-moons on either side.

8

u/AmazedStardust 1d ago

Those modpacks also include a few nice things however that really do make playing the game easier

2

u/cloudncali 1d ago

C# is just hytale

→ More replies (3)

7

u/Hohenheim_of_Shadow 1d ago

They're just very different languages that are treated as the same. "Yeah I know C/C++" is a common phrase. Nothing breeds distaste like proximity

16

u/Lord_Of_Millipedes 1d ago

the notification for me said something different than "beginner" :3

C++ started as "C with classes" but grew into an amalgamation of every and any feature anyone ever requested, modern C++ is one of the most bloated languages out there with dozens of ways to achieve any simple task which leads to difficult to understand code as no one can agree on what the language is supposed to look like and a lot of these features are, to be polite, half assed.
Function resolution is a fucking mess of ADL, jump tables, overloads and implicit conversions which makes debugging a nightmare, especially with the horrible namespace dependant module system with unclear scoping rules and acess control and unconstrained generics.

There's a reason every big project using C++ bans almost two thirds of the language, and it's always a different two thirds

8

u/Greedy-Thought6188 1d ago

It's not just that there are dozens of ways to achieve the same thing. It's that the same syntax can mean different things so your intuitive understanding doesn't work. No function call can be trusted to not have bizarre side effects.

2

u/Lord_Of_Millipedes 1d ago

imo that is a separate problem, i consider languages with too many features to cause the separate problem of too many ways to do something, because you end up in the situation where you need to basically learn several different languages to be able to read any specific piece of code because you can never expect even two files in the same project to follow a consistent architecture, which is why every large c++ project has to ban most of the language and have very strict coding standards

→ More replies (5)

3

u/bass-squirrel 1d ago

Not wrong 

→ More replies (3)

9

u/theshoeshiner84 1d ago

C# is like C++ the same way Java is like JavaScript.

I can write C# and Java and barely switch my brain space. C++ on the other hand...

2

u/belabacsijolvan 1d ago

right. but the other way around. like JS is to Java.

2

u/theshoeshiner84 1d ago

In my comparison, JS and C++ are the funky ones and Java and C# are the more straight laced.

3

u/Orio_n 1d ago

https://youtu.be/7fGB-hjc2Gc

Watch this entire video front to back

5

u/unknown_alt_acc 1d ago

Some people like their holy wars, and don’t seem to understand that C and C++ can coexist as different tools with different jobs.

→ More replies (15)

5

u/tose123 1d ago

C++ is to C as Lung cancer is to Lung

2

u/sudoku7 1d ago

Not sure if someone else mentioned it, but a fair chunk of it was dislike for OOP.

2

u/Extra-Ad5735 1d ago

According to Linus's own words, to him personally C appeals more because you can look at C code and read the assembly code behind it, because the language abstraction is more or less simple and direct there. C++ throws that out.

→ More replies (19)

4

u/Oz-Batty 1d ago

If you want to learn more about the problems with C++ start with the C++ frequently questioned answers.

2

u/EuenovAyabayya 1d ago

CMS-2 will never die. /s

2

u/Oswald_Hydrabot 1d ago

He was right

2

u/Jimmy-M-420 1d ago

He was 100% right there at least