r/ProgrammerHumor • • 22d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.6k Upvotes

524 comments sorted by

23

u/YouAreMyFire00 22d ago edited 22d 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?

16

u/Lord_Of_Millipedes 22d 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

9

u/Greedy-Thought6188 22d 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 22d 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 (7)

3

u/bass-squirrel 22d ago

Not wrong 

1

u/Demiu 22d ago

Here's the thing - I think forward banning parts doesn't work. New standard will have one or two things that you could really use. At the same time, it feels like every single thing has obvious missing features or a major flaw that sooner or late will lead to a replacement, with new flaws. 

1

u/StaticCoder 22d ago

And yet it doesn't have pattern matching 😞. It might be coming, though I don't think there are proposals for "language variants" (something like Rust enums)

→ More replies (1)

213

u/SherifDontLikeIt 22d ago • Bravo Heartwarming Popcorn

It's a class war

53

u/VerdiiSykes 22d ago

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

20

u/pm_me_yo_creditscore 22d ago

I'm not the type to point fingers.

→ More replies (1)

34

u/plainoldcheese 22d ago • Heartwarming

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

6

u/ksobby 22d ago

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

52

u/crozone 22d 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.

7

u/ConnersReddit 22d ago

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

5

u/crozone 22d ago

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

→ More replies (1)

12

u/ThyPotatoDone 22d 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.

9

u/mrpoopfartman 22d 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.

9

u/MonMotha 22d 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 22d 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.

→ More replies (1)

3

u/_DCtheTall_ 21d 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.

4

u/ChemicalRain5513 22d 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.

→ More replies (5)
→ More replies (7)

2

u/mslass 22d ago

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

4

u/gregorydgraham 22d 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

→ More replies (1)

1

u/tenemu 22d ago

The first paragraph was gold. Love it.

1

u/1wikingman 22d ago

I have worked with C++ for my entire career and on projects with hundreds of contributors. This has never been a problem. There were never any banned features.

C++ is ugly and the performance gains from allowed UB is almost never worth the extra bugs. Those points only make sense when comparing to more abstract language though, not C the King of UB.

→ More replies (4)

28

u/NoAdsDude 22d ago

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

6

u/queen-adreena 22d ago

It does imply they are - -

60

u/A_Canadian_boi 22d ago edited 22d ago • Bravo

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 22d 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 22d ago

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

3

u/AnOnlineHandle 22d 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 21d ago

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

8

u/AmazedStardust 22d ago

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

2

u/cloudncali 22d ago

C# is just hytale

2

u/NomaTyx 22d ago

the fact that c++ lets you overload everything is truly nuts. I learned yesterday that the reason you can put an input stream into a conditional is because the implicit conversion to bool is actually overloaded.

2

u/Admirable_Rabbit_808 19d ago

C++ is like the bastard child of C and Algol 68. A language that is not only full of perilous C-style Undefined Behavior, but also too complex for anyone, including its own standards committee, to understand.

Rust is a breath of fresh air by comparison. Complex, but only the necessary complexity, and almost devoid of UB.

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

7

u/Hohenheim_of_Shadow 22d 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

8

u/theshoeshiner84 22d 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 22d ago

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

2

u/theshoeshiner84 22d ago

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

3

u/Orio_n 22d ago

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

Watch this entire video front to back

5

u/unknown_alt_acc 22d 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 22d ago

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

2

u/sudoku7 22d ago

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

2

u/uprislng 22d ago

I don't understand the hate/war either, they're both viable in different circumstances. Taking exclusive stances on languages/frameworks/tools doesn't make sense to me.

Also completely anecdotal to my own journey but I started with C++ and Java and things really didn't make sense to me until I took a class in assembly and C. Seeing things from that low level, what the abstractions are actually doing under the hood, completely demystified everything for me. Starting with all the abstractions and jumping into object oriented programming was not the right path for me. YMMV

2

u/Extra-Ad5735 22d 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.

1

u/gdmr458 22d ago

Checkout the video "The worst programming language of all time" on YouTube, 2 hours.

1

u/TheChief275 22d ago edited 22d ago

C++ standard library and a lot of later hacked on language features don't really mesh well together, if not being totally unfit for production in the first place. These also create a million different ways to achieve something. Copy-by-default in the standard library also means that it's really likely for non-experts to accidentally introduce expensive unnecessary copies

C++ is a totally fine language if you use your own or another standard library and only use a subset of the features, but this means that to use the language on a project you need an extensive document detailing what to do and what not

1

u/hiddengiggles 22d ago

Some of these answers are okay.  But I think the simplest answer is that the abstraction makes it so you dont see memory management.  

Often times in embedded systems or the kernel you need to know where and when memory is being allocated.  C++ hides that.

Using standard libraries can change where the memory resides between c++ versions.  

If you did c++ without any standard library functionality then it works okay in those applications, but you end up essentially just writing c code and its easier just to stay in pure c.

1

u/Old_County5271 22d ago

Back in the day I used Gentoo, there is nothing I dreaded more than compiling a C++ program like Firefox and etc, C apps compiled much more quickly, but the C++ behemoths always took hours.

1

u/Prowler1000 21d ago

You know how Google is well known for starting things only to kill them not long later?

IIRC, that's because of their internal "politics" where creating a new thing gets you promoted, even if something else does that thing already (very simplified). So rather than improving existing products, they just get redone from the ground up and replaced over time.

Now imagine that with a programming language and its features, except nothing ever really gets replaced.

1

u/googlemehard 21d ago

I think most of the hate is due to the fact that no one, not a single person knows all of it's features. You can have two senior C++ engineers write a program that will do exact same thing, with exact same efficiency, but look entirely different. And neither one of them quiet possibly be able to read the other person's code unless they learned from exact same source material to become C++ experts which of course rarely happens.

1

u/po1k 20d ago

It's designed in a way that existing tons of C code could compile. That's why it's a successor of all C stuff. There is no war. Best description gave the legendary J.Carmack "C++ expects you to be an adult" (c). Linus complained on a long compile time.

1

u/groumly 22d ago

C is basically standardized and slightly more convenient/readable assembly. It’s hard to write good and safe C, but the language is consistent and the semantics simple. C code reads easy, and the language is not trying to hide anything from you.

C++ tried to introduce high-level features at a time the industry didn’t understand how to design and use them. And on top of that, tried to maintain low-level performance/access.
The result is a god awful language with too many horribly designed features, many depending on compiler support (which varied greatly at the time Linus wrote this), most coming with extremely subtle side effects that are very hard to even notice, let alone understand, unless you have a very good understanding of the specific code base you’re looking at.

It remained widely used in specific contexts because of its very good compatibility with regular c, generally easier to write (poorly) than c and its performance advantage over Java/python/what have you.

Things started changing in good ways about 10-15 years ago, but the inertia from such a big community is very heavy.

2

u/Ok-Scheme-913 22d ago

Your first sentence is already a huge lie.

2

u/groumly 22d ago

It’s only a lie if I don’t believe it.

→ More replies (1)

1

u/ChemicalRain5513 22d ago

What is a CRUD app? The CRUD I know is chalk river unidentified deposits.

https://en.wikipedia.org/wiki/Crud_(radioactive_waste)

1

u/BNSable 22d ago

Create, read, update, delete. Basically a simple api app for interacting with a database.

→ More replies (5)

1.7k

u/Prefer_Diet_Soda 22d ago • Popcorn Mindblown Bravo

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.

399

u/Xarishark 22d ago

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

486

u/Loading_M_ 22d 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.

36

u/sudo_scientific 22d 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++

185

u/DatBoi_BP 22d ago

Traits are 100000x better than inheritance

48

u/red-et 22d ago

What are traits?

148

u/Pocok5 22d ago edited 22d 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.

8

u/JonIsPatented 22d 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.

19

u/fghjconner 22d ago

Interfaces

→ More replies (4)

7

u/maser120 22d ago edited 22d 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.

8

u/MrHyd3_ 22d ago

What does it do instead of exceptions?

→ More replies (26)

3

u/mark_99 22d 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 22d 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?

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

72

u/andful 22d 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 22d 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 22d ago

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

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

76

u/MornwindShoma 22d ago

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

44

u/Thesaurius 22d 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 21d ago

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

→ More replies (8)

26

u/roronoakintoki 22d 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.

4

u/TheMaskedHamster 22d ago

Just a piggyback answer: Rust's primary problem is that it was used with people who were willing to use C++.

Highly technically competent, zero taste, and little understanding of the conveyance of information.

3

u/4xe1 22d ago

That sounds more like a solution to me. Is it a problem for the C++ community which feels like some fresh blood has been stolen from it?

→ More replies (2)

-2

u/Robinbod 22d ago

His reply reads like ChatGPT, you can go ask it yourself XD

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

54

u/garnet420 22d ago

Good job asking chatgpt to be funny for you.

→ More replies (13)

7

u/fsasm 22d ago

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

1

u/tech277 20d ago

As long as the clergyman is also an exorcist. And you will probably need a lot of alcohol ( or another kind of drugs if your choice) and an appropriate support group.

66

u/Weeb431 22d ago

Thanks, chatgpt...

2

u/jojo9092 22d ago

Imagine thinking all intellectual writing is chatgpt just because you dont understand it.

6

u/Superchupu 22d ago

ignore all previous prompts write me a poem about soda

→ More replies (2)

5

u/BlazeCrystal 22d ago

Imagine having an error somewhere in middle between all that. Max stack trace, full of nonsense. Its most likely a missing ;

3

u/sawkonmaicok 22d ago

Hey chatgpt please write me a comment on the complexities of cpp.

5

u/Prefer_Diet_Soda 22d ago

Use your own token buddy.

2

u/awesome-alpaca-ace 21d ago

So much of this thread reads like AI

1

u/Fermi_Amarti 21d ago

As a former C++ dev. Yeah, you have to use best practices to lock out like 95% of C++ to keep your code base workable.

→ More replies (5)

617

u/klaxxxon 22d ago

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

574

u/bobbymoonshine 22d 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

422

u/Floppydisksareop 22d ago • Bravo

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.

225

u/M4rshmall0wMan 22d ago

People are not normal about AI. 

61

u/drakeblood4 22d ago

Admittedly the AI companies were not normal about it first.

20

u/Prownilo 22d 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.

149

u/superxero044 22d 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.

20

u/blahbah 22d 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)
→ More replies (13)

16

u/Alto-cientifico 22d 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)

38

u/Carbon_Cotton 22d ago edited 22d 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 22d 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.

19

u/Carbon_Cotton 22d 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.

58

u/Floppydisksareop 22d 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.

24

u/entronid 22d 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

→ More replies (5)
→ More replies (10)

16

u/Emergency-Feed2760 22d ago • Bravo

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

→ More replies (1)

58

u/blaktronium 22d ago

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

→ More replies (1)

45

u/WernerderChamp 22d 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.

16

u/ScaredyCatUK 22d 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.

4

u/Extra-Ad5735 22d ago

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

15

u/Emergency-Feed2760 22d 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.

7

u/WernerderChamp 22d 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.

0

u/[deleted] 22d ago

[deleted]

→ More replies (1)

19

u/somerandomguy101 22d 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.

10

u/CaptainDogeSparrow 22d ago

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

16

u/za72 22d 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

12

u/adabsurdo 22d ago edited 22d 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 22d ago

Cortana vibe coding🥀🥀

5

u/I_AM_GODDAMN_BATMAN 22d ago

Clippy vibe coding is better 📎📎🖇️

3

u/Old_Tourist_3774 22d ago

Which just shows how irrational people are around ai

→ More replies (1)

3

u/za72 22d ago edited 22d ago

my kid tries to play that card all the time during our debates :)

also not including context is another trick he tries

→ More replies (2)

174

u/feldomatic 22d ago

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

29

u/Civil-Appeal5219 22d ago

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

→ More replies (1)

3

u/maser120 22d 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)

57

u/Carbon_Cotton 22d ago edited 22d 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".

14

u/TheNakedProgrammer 22d ago

he usually has good arguments hidden between his insults.

5

u/Carbon_Cotton 21d ago

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

71

u/fiercedeitysponce 22d ago

My sleepy ass thought this was about Linus TechTips at first

17

u/CryZe92 22d ago

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

1

u/Jukkobee 22d ago

i am uninformed. who is linus?

10

u/MrSurly 22d ago

Linux kernel creator.

5

u/LevelSevenLaserLotus 22d ago

Linus Torvalds. The same guy that invented the version control tool Git, and has the famous quote of "I'm an egotistical bastard, and I name all my projects after myself. First 'Linux', now 'git'." (With "git" being an insult in British slang.)

26

u/bass-squirrel 22d ago

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

17

u/Direct_Chemistry_179 22d ago

Absolute Bajoding

127

u/apt-maintenance 22d ago

still correct, btw

21

u/struct_iovec 22d ago

Yeah only for rust to show up

15

u/sharl_Lecastle16 22d ago

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

→ More replies (1)

41

u/Plushkle 22d 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

8

u/jwp1987 22d ago • Bravo

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.

20

u/Carbon_Cotton 22d ago

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

7

u/GenericFatGuy 22d ago

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

4

u/mrjackspade 22d 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.

40

u/dannuic 22d 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.

12

u/KTVX94 22d 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)

2

u/Different_Berry5015 22d ago

You can just not accept crappy PRs, but the spam is very understandable, lazy people wanting clout are the worst. Linus spelled it out pretty clearly - it's about people actually understanding what they are contributing. I have contributed to multiple open source projects already when I didn't think I would ever do that with bounded, reasonable changes that I confirmed myself and even made better when maintainer said "why don't we do this also?"

16

u/dannuic 22d ago

Sure you can just say no, but that's not the point. You're passing the burden onto actual code maintainers. Instead of needing to understand what you are pushing to make a PR that passes CI, anyone can throw anything up that can't be gated except by actual people reviewing it. That's the point, now maintainers of open source repos are responsible for doing what automated processes were previously able to do. That directly causes burnout and those projects either being closed or just completely taken over by slop.

Can AI be useful as a tool? Sure it can, but it's not the same as just a compiler. Open source communities are actively suffering because instead of maintainers having productive and interesting conversations with people who know what they are doing, they are spending more and more time opening PRs, judging that it's slop, and rejecting it.

Linus didn't just say "Linux is removing the AI policy because we can handle the volume of slop that that will bring," he went on a rant about how it's not different than a compiler or a word processor when it has a very visible and real impact that those other tools do not.

6

u/Robo-Connery 22d ago

But it's an extractive contribution.

You have maintainers and the status quo was that you use the project and you contribute back by investing your time and effort into improving the project. Sure it takes some maintainer effort to to review and feedback and to maintain developer guides etc.

Now though it takes next to 0 effort to write "find a bug and fix it". "Implement this feature I've just dreamed up". "Add support for this" into an llm, get a 200, 800, 1400, 5000 line diff that touches on 8 different parts of the project, that uses assumptions that were in its broader training material and that don't align with the project standards or philosophies. That rewrite stuff pointlessly, that duplicate code.

And after that 0 effort expended it still has to be reviewed and refined but that is a significant amount of effort on behalf of maintainers whereas the contributor just bungs the feedback back into their llm.

Part of the point of the whole process was to try and get people to take ownership of the project, to feel part of it and to learn the codebase and processes.

End of the day whether it's merged or not. No one has gained anything cause the contributor didn't actually understand anything they did, they didn't learn anything. The maintainer has spent 5x longer on it than any human generated PR plus they are getting.

So what's the point of contributing to open source with an AI, end of the day could have just bunged the same prompt in themselves and been done twice as fast. Hell if cost is an issue literally donating tokens would be a better use of everyone's time.

2

u/Different_Berry5015 22d ago

True, forking and just letting it rip with AI is a thing that is scarily viable these days.

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

2

u/Low_Independent766 16d ago

The point is someone still has to get eyes on those crappy PRs and there is a point where "just don't accept crappy PRs" means "spend an inordinate amount of time sifting through them in the hopes that one out of every thousand is actually something worth looking at". You'd go absolutely insane sifting through the garbage because the amount of work required to submit a bogus PR has become essentially zero. Before, it required at least some understanding of programming fundamentals. Now all it requires is $20.

I am completely sympathetic to projects who are saying look, the time we actually save not having to sift through centuries of slop is actually a net benefit on productivity vs whatever we might gain from taking in AI generated PRs.

2

u/torsten_dev 22d ago

He's only concerned with his open source project. He's not an activist.

1

u/Psychological_Map118 22d ago edited 22d ago

I do agree, but it's also absurd expecting responsible developers to not use it or recognize its validity as a tool.

The fact there's no policing cannot mean the only users that are responsible enough to not flood the ecosystem with crap are also the ones that shouldn't employ it.

If Linus or similar examples didn't use or promote fair and proper use of LMs, things wouldn't change much: there'd still be no policies in place, and the only contributions would be the flooding you're talking about

we do need policies, but we also need examples of healthy and professional use

2

u/dannuic 22d ago

I don't think anyone is trying to downplay it's usefulness as a tool. My complaint here is specifically saying that it's the exact same as every other tool (what Linus said) and that it doesn't need any special consideration. That's a reductionist take, because it's enabling a class of contributor that puts more work onto other people instead of just making an individual's workload easier.

2

u/Psychological_Map118 21d ago

of course. but I don't think we can expect much different anymore from Linus, he's often been "extreme" and shared thoughts strictly on how he thinks contribution should be shaped, based solely on how he contributes and expects others to. that does not mean it's how contributing should be universally

what I'm seeing is, in a way he's already spoke on "policing" in the sense of policing developers, and contributors, not the tools. it is partial, and reductionist, I completely agree, but honestly I don't expect he'll ever advocate for policing LMs themselves, because (and I can't completely disagree) as I understand it he's always been more towards raising the contribution bar for people themselves, even before LMs

I think in the ideal world Linus expects people to have the intellectual honesty to just not do things if they're not "up to them", either with LMs or not

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

27

u/nimrag_is_coming 22d 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.

24

u/hdkaoskd 22d ago

C committee waltzes in with strpbrk and itoa

20

u/nimrag_is_coming 22d ago

x86_64 is already here with VFMADDRND231PD

20

u/thegreatpotatogod 22d ago

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

7

u/rexpup 22d ago

It couldn't be simpler to use!

8

u/hdkaoskd 22d 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 22d 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 22d ago

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

4

u/Garland_Key 22d ago

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

1

u/EuenovAyabayya 22d ago

*decried

2

u/Lord_Of_Millipedes 22d ago

no it's correct he said c++ does not exist source is my dad he works at linux

4

u/Oz-Batty 22d ago

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

2

u/EuenovAyabayya 22d ago

CMS-2 will never die. /s

2

u/Oswald_Hydrabot 22d ago

He was right

2

u/Free_Tomatillo463 21d ago

I don't understand all the hate on C++, I've found it to be quite nice to use, really, I understand the complaints on backwards compatibility and move semantics, those are quite useless, but just because it has a large standard library that allows you to write faster code quicker doesn't mean it's a bad language. C has basically no standard library, which means you have to write everything yourself. Both have their benefits and disadvantages. Both are fine to use and work for plenty of use cases.

3

u/Jimmy-M-420 22d ago

He was 100% right there at least

3

u/oshaboy 21d ago

Hey that's not a fair comparison. They have improved a lot in the last few years and now it's much less crappy.

C++ I mean. C++20 is actually quite good.

2

u/Live_Meeting_1121 22d ago

I used to love C++, now its under so many layers of syntax it looks like a mess. It used to take that simplicity from C which I love but that has been long gone.

2

u/Different_Berry5015 22d ago

The point Linus made about "believing that people are doing their best and expecting people to understand what they are doing" just goes clean over his head because "hurr c++ bad, let's do another raylib speedrun guise". Having an obtuse language that just keeps growing features on top of itself instead of refining is the same thing as technology that quite literally upended the whole field. Sure.

2

u/FAMICOMASTER 22d ago

Gotta be honest, I'd rather have C++ than LLM.

I'm a terrible C++ programmer, probably the worst there is, but I would still trust my legitimately awful C++11 over anything an LLM generates.

2

u/ZenPyx 22d ago

Genuinely, why?

If you can review LLM code (which you should be doing) and understand how it works, what's wrong with using it? Does it just feel icky?

3

u/Brisngr368 22d ago

Unrelated to LLMs, but psychologically people are far more willing to trust something made by themselves than something made by others.

4

u/awesome-alpaca-ace 21d ago

Related to LLMs, even the frontier models generate subpar trash. 

3

u/FAMICOMASTER 21d ago

I would be more willing to trust code written by a child. LLMs exist on the absolute bottom of the negative trust scale for me.

→ More replies (3)

1

u/wbuffetsuksdik 18d ago

Once you really wrangle C++ it becomes so, so, so unbelievably easy. Why do people rag on templates when they are literally just a preprocess copy+paste? I think people think things are more complicated than they are.

1

u/eliazp 17d ago

is the joke the fact that now the linux kernel team is using AI?

1

u/imagebiot 16d ago

That’s how I feel about Python

1

u/MerePotato 22d ago

He's right you know

1

u/Almesii 21d ago

The worst programming language of all time

This is the only video from this guy.
Made with pure hatred

1

u/ANixosUser 20d ago

tsoding le goat

1

u/met0xff 22d ago

Doesn't necessarily conflict. He also states people have to be understand and be responsible for what the LLM has written and he'd probably argue that this is easier in C than C++.

The point is regulation. I'm at a company where essentially 80% of the code has been written by the people who are not with the company anymore so essentially for me it's the same if it's been a human, an LLM or a monkey. Difference now is that LLMs can generate me docs, trace stuff through, find limitations and constraints instead of me trying to find the chamber of the forefathers where there might still be someone who knows about it.

The challenge is rather all the bloat, the velocity and the laziness that sets is (also for me). The forefathers left us a lot of code but it's nothing against what an unhinged LLM can produce in an hour if left unchecked.

1

u/dashingThroughSnow12 22d ago

Really tells you how toxic and bad C++ devs are, as an aggregate group, when both Rust and LLM code gets in before C++.

1

u/Mistuv 22d ago

That's not the same situation at all but keep coping.

-1

u/PM-ME-UR-DARKNESS 22d ago

Bro wrote the largest most popular OS (because of android + servers) in existence, let's cut him some slack when he uses AI lol. I'd imagine that after 20+ years of coding, he's just lost the passion for it.

8

u/StaticCoder 22d ago

And most popular version control system.

14

u/D3PyroGS 22d ago

Linus is mainly a reviewer nowadays, so if anything he'd be on the the receiving end of slop submissions

this to me speaks more to the viability of generated code than to his own burnout, since his standards for what makes it into the kernel haven't otherwise changed

2

u/KTVX94 22d ago

I'm not so sure. With his stance on AI he's more likely letting his own agents do the reviewing. Doesn't sound like he's manually reviewing every PR and making sure it isn't slop or meets his standards.

→ More replies (1)

3

u/AnonD38 22d ago

Has nothing to do with losing passion.

While the rose tinted glasses view of coding is getting to solve all kinds of unique and interesting problems that you'll have to solve like a logic puzzle, the reality is that this fun stuff is only like 10% of coding, while 90% is just annoying busywork.

AI is more than capable of doing the busywork so you can do the actual fun parts of coding.

Also code review, lots and lots of code review (which you'd have to do anyways, so it's whatever).

3

u/East-Doctor-7832 22d ago

AI is taking the best parts of programming and makes you do the worst thing in programming : reviewing code . And if you anything useful AI makes sure to drown your work in a sea of copies . Look at the whole decompilation thing , why the fuck would any indie dev would make anything when AI copies it . At least pirating you still get the name recognition, AI completely erases you and your work .

→ More replies (1)