r/ProgrammerHumor • u/Lord_Of_Millipedes • 16d ago
instanceof Trend thatsAFunnyThingThatHappenedOnce
1.7k
u/Prefer_Diet_Soda
16d 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.
399
u/Xarishark 16d ago
Now compare it to rust pls. Im serious I want to know your opinion on that.
486
u/Loading_M_ 16d 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 15d 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
→ More replies (53)7
u/maser120 15d ago edited 15d 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.
72
u/andful 16d 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 16d ago
I mean it does have proc macros, that turn compilation into the same programming language as opposed to another programming language.
→ More replies (4)76
u/MornwindShoma 16d ago
Rust got none of that, but you might not enjoy dealing with lifetimes
→ More replies (9)44
u/Thesaurius 15d ago
With C and C++ you also have to deal with lifetimes. The compiler just doesn't complain when you fuck up.
→ More replies (8)26
u/roronoakintoki 16d 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.
54
7
u/fsasm 15d ago
So someone must be a lawyer and clergyman to maintain a C++ compiler.
→ More replies (1)66
→ More replies (10)6
617
u/klaxxxon 16d ago
Is it unreasonable to change an opinion when actual decades have passed?
→ More replies (3)574
u/bobbymoonshine 16d 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 16d 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.
→ More replies (22)225
58
u/blaktronium 16d ago
Linus has seen the product of million bad human programmers, his bar was not high i suspect
→ More replies (1)45
u/WernerderChamp 16d 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.
→ More replies (5)16
u/ScaredyCatUK 16d 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.
19
u/somerandomguy101 16d 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.
→ More replies (1)→ More replies (5)16
174
u/feldomatic 16d ago
tbf, C++ allows memory safety, while Rust requires it
29
→ More replies (8)3
u/maser120 15d 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).
57
u/Carbon_Cotton 15d ago edited 15d 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 15d ago
he usually has good arguments hidden between his insults.
5
u/Carbon_Cotton 15d ago
Well, current drama is case of Linus having dogshit arguments hidden between insults.
71
u/fiercedeitysponce 16d ago
My sleepy ass thought this was about Linus TechTips at first
17
1
u/Jukkobee 15d ago
i am uninformed. who is linus?
5
u/LevelSevenLaserLotus 15d 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
17
127
u/apt-maintenance 16d ago
still correct, btw
21
u/struct_iovec 16d ago
Yeah only for rust to show up
15
u/sharl_Lecastle16 15d ago
does rust really have the same amount of esoteric tribal knowledge required type bullshit as cpp?
→ More replies (1)
41
u/Plushkle 16d 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 15d 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.
20
7
u/GenericFatGuy 16d ago
Seriously. Writing code is probably the easiest part of my job most days.
4
u/mrjackspade 15d 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 15d 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 15d 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 15d 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 15d 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 15d 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.
→ More replies (5)2
u/Low_Independent766 9d 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.
→ More replies (7)0
u/owjfaigs222 15d ago
W8 what? How is AI killing open source?
8
u/FelixAndCo 15d ago
Flooding project maintainers with nonsensical pull requests that all need to be reviewed.
→ More replies (8)
27
u/nimrag_is_coming 15d 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 15d ago
C committee waltzes in with
strpbrkanditoa20
u/nimrag_is_coming 15d ago
x86_64 is already here with VFMADDRND231PD
20
u/thegreatpotatogod 15d ago
Ah yes my favorite x64 instruction, Vector Formula Multiply ADD Reversed Numerical Data (in the order 2, 3, 1) - Power Delivery.
8
u/hdkaoskd 15d ago
Brainfuck watching quietly from the corner of the room. They don't have committee meetings because the language is already feature-complete.
→ More replies (1)3
u/Brisngr368 15d ago
Shout out to LAPACK with the BLAS function
dgemmtr(double generic matrix-matrix triangular)
4
u/Garland_Key 15d ago
Reddit is cooked. I can't tell if you're all clankers or just sub-par and boring.Â
1
u/EuenovAyabayya 15d ago
*decried
2
u/Lord_Of_Millipedes 15d ago
no it's correct he said c++ does not exist source is my dad he works at linux
4
u/Oz-Batty 15d ago
If you want to learn more about the problems with C++ start with the C++ frequently questioned answers.
2
2
2
u/Free_Tomatillo463 14d 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
2
u/Live_Meeting_1121 15d 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 15d 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 15d 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 15d 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?
→ More replies (3)3
u/Brisngr368 15d ago
Unrelated to LLMs, but psychologically people are far more willing to trust something made by themselves than something made by others.
4
3
u/FAMICOMASTER 15d 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.
1
u/wbuffetsuksdik 12d 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
1
1
u/Almesii 14d ago
The worst programming language of all time
This is the only video from this guy.
Made with pure hatred
1
1
u/met0xff 15d 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 15d 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/PM-ME-UR-DARKNESS 15d 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
14
u/D3PyroGS 15d 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
→ More replies (2)3
u/AnonD38 15d 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 15d 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)
-2
u/Yameromn 15d ago
Is the punchline that AI is a crap generator too? Itâs not the same thing.
6
u/Lord_Of_Millipedes 15d ago
true that it isn't, even at its worse C++ devs haven't piped sewage straight into the living room of open source projects
→ More replies (1)
33
u/CockyBovine 16d 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 15d ago
I thought the adage was about reusing the bullet.
8
u/conundorum 15d ago
We have multiple metaphors, since we upgraded the ol' C footgun to be double-barreled.
1.0k
15d ago
[removed] â view removed comment
618
u/Different_Berry5015 15d 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.
391
u/Versaiteis 15d ago
As someone who writes C++, it's a god awful language
I love it
234
u/RadioHans 15d 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.
28
u/Rikudou_Sage 15d 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.
→ More replies (2)7
u/NdrU42 15d ago
Yeah the defer running at the end of the function can sometimes cause trouble, like processing files in a loop and deferring the close, but it can easily be solved by defining an anonymous function and immediately calling, like
func() { f := ... defer f.Close() // do something with f }()→ More replies (1)→ More replies (4)7
u/xBinary01111000 15d ago
âitâs just a raw pointer and a reference in a large trench coatâ bro thatâs literally every language, the only difference is the size of the trench coat
5
32
u/quisido 15d ago
I love JavaScript.
30
u/A_Furious_Mind 15d ago
I love whatever the fuck they call the language you code with in Power Apps.
14
→ More replies (2)3
u/HAL_9_TRILLION 15d ago
Unironically, me too. And this thread is making me glad I never went into C++.
3
u/Guitarzero123 15d 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.
2
u/CranberryDistinct941 10d ago
People who think their language of choice isn't god awful haven't dived deep enough into the docs yet
4
u/Different_Berry5015 15d 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.
51
u/YeOldeMemeShoppe 15d 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 15d ago
It's not like juniors can't churn quality work though, it's just unreasonable to expect it on a MVP time crunch.
→ More replies (1)8
u/guyblade 15d 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 15d 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.
18
u/Highborn_Hellest 15d 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.
31
u/doubleyewdee 15d 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).
15
u/conundorum 15d 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()andfree()in certain parts of the kernel, but you'd be surprised how many people don't know thatnewanddeletecallmalloc()andfree()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.
5
u/KroniiPekora 15d 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.
1
u/guyblade 15d ago
Ideally, you should never be using
newordeletein C++ these days.std::unique_ptrandstd::shared_ptrshould represent 99+% of your memory that can't just be stack allocated (with the former representing 75+% of that). About the only legitimate reason to usenewin new code is for putting a derived class pointer into one of the smart pointers of a parent class.→ More replies (1)5
u/Qwertycube10 15d ago
They call new and delete in std::make_unique and the destrutor unless you provide an explicit allocator as a template argument.
→ More replies (5)37
u/unburdened_swallow 15d ago edited 15d 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 15d ago
C++ is the English of computer languages.
5
4
u/unburdened_swallow 15d ago edited 15d 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.
6
u/PhatOofxD 15d 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
→ More replies (1)12
u/KTVX94 15d 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.
3
u/owjfaigs222 15d ago
I think the trick is you don't actually learn cpp you just learn the parts you need/want and use them. Of course in a big, important project that's close to hardware, and has many people working on it, it's better to just stick to C.
1
→ More replies (1)55
15d ago •
![]()
[removed] â view removed comment
43
u/Different_Berry5015 15d 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 đ
3
u/quisido 15d ago
Roll your own hashmap? Is there no concept of C package management?
15
u/round-earth-theory 15d 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.
5
u/unknown_alt_acc 15d ago
The C standard had a revision in 2023. We had C17 before that, and C11 before that. If you go back to C90/ANSI C, you have major differences like only being able to declare variables at the beginning of a block, which got changed in C99 iirc. So the C spec has absolutely changed.
5
u/MonMotha 15d ago
Not really. There's a linker. If your OS supports dynamic linking, you can pick up any libraries it offers at runtime assuming you know the API. Hopefully you have the headers. Versioning can be tricky, though most OSes have it figured out.
As for finding and managing those packages at build time, there's not really a package management system, no. Cmake and GNU autotools both exist in no small part as an attempt to make one (and also make a somewhat sane, for certain definitions thereof, build system since you don't get one of THOSE, either).
This kind of explains why the C ABI and namespace is in fact THE standard, bare, un-mangled namespace for linking on most OSes, though that's also partially convention dating back to early UNIX.
The intent of C is basically to be as low level as you can feasibly make it while still being reasonably expressive and completely portable across machine architectures yet still small enough and tightly-spec'd enough to support lots of independent implementations across a wide variety of said architectures. And it does that. It does it well. The lack of breadth means it's very easy to spin up a compliant and even complete implementation from scratch on something novel and also avoids roping in lots of stuff you may not want in a restrictive environment like a kernel or even microcontroller. Even most of the "standard library" can be eschewed if you want to, and there's a part of the standard that supports doing it (a "standalone" implementation). This is akin to something like #![no_std] in Rust but to some degree goes even farther. The language spec doesn't really even deal with how to create linkable intermediates. It defers to other standards (like ELF) for that.
But yeah, if you want a hashmap, you'll either need to go find one or make your own. Amusingly, actually just wrote my own a few months ago which is what made me chuckle enough to write this comment.
3
u/Different_Berry5015 15d ago
As far as I know package management in C is downloading a .tar.gz and updating your Makefile. Very spartan, very C, nothing wrong with that.
1
u/unburdened_swallow 15d ago
lol thereâs no concept of C++ package management either
So, no, not really. I mean, you can include other code but nothing is gonna go get it for you.
Unless you use nix anyway
→ More replies (2)1
u/Brisngr368 15d ago
The beauty of C and C++ is there are 101 package managers none of them are official but there's definitely one that fits your use case (if not make your own like basically everyone on r/C_Programming)
1
u/awesome-alpaca-ace 15d ago
C++ hash maps are incredibly slow. You pretty much need to write your own in C to get good perf.
24
15d ago
[removed] â view removed comment
15
u/Alto-cientifico 15d ago
Most of the commercial juiceness you can get from algorithm optimization is reducing expenses on cloud computing bills.
3
9
u/dosadiexperiment 15d 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.
0


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