r/cpp • u/ilPlayerdiGD • Sep 25 '26
Why C++ is so hated!!!
I love C++. High level + low level at the same time. But Linus Torvalds don't want C++ in the Kernel, industries hate it, people hate it but why? Why be so angry? Memory management? I mean ok maybe it has problems that I don't even see but why so much hate.
For me it's really sad! š
Why something so powerful it's so hated. Now I feel "strange" doing projects in C++ because⦠sometimes I question myself "Why do I write C++ code if people hate it". Can someone explain what is happening and⦠can I use C++ for fun in peace?
0
Upvotes
33
u/FckXFckMusk Sep 25 '26 •
Most people don't know why they hate stuff, they just hate it because someone or something told they should.
36
u/No-Dentist-1645 Sep 25 '26 edited Sep 25 '26
It's not hated. Tons of companies and software use C++, it's extremely popular in that aspect. There are just places and contexts where it is a good choice, and places where it isn't.
They tried to use C++ in the kernel before, realized it wasn't that good of a fit, and moved on. Nothing to be sad or hold grudges about that.
13
u/Aprelius Sep 25 '26
C++ is one of the most used programming languages in the world. It can compile and run on almost anything. I use it every day in game dev.
C++ is a tool. It solves a problem. Are there different tools that solve that same problem: yes, Rust and C are both great alternatives.
Stop caring what other people say about their favorite tool for the job they do.
8
u/AshKetchupppp Sep 25 '26
Ignore what other people think, if you like it then use it, if you're not being paid to write it then enjoy your programming hobby! There's good reasons why other languages are preferred to C++, memory (mis)management is why languages like Rust have come about. I love C++ also but encounter pitfalls I wouldn't run into in other languages
6
u/Thesorus Sep 25 '26
it's not hated.
It's just not the shiny new language
it's just that there is a lot of existing software using old(ish) C++ that needs maintaining and that it sucks that is nearly impossible to upgrade to better language features.
Linus is also a dick (rightfully) in what he wants to do with the linux kernel and what language he wants people to use.
30
u/jwezorek Sep 25 '26
C++ haters are just really loud online.
4
u/Tamsta-273C Sep 25 '26
Never ever i saw a man who really hate it, frustrated - yes, mad because miss semicolon - also yes, to the Hades all the linking - call me in.
But i never heard anyone to hate it for real.
Look up Java boys if you wish to learn what true hatred is.
5
u/KAMEHAMEHAMEHAAAA Sep 26 '26
The hate for a language is proportional to the number of languages created with intent to replace the said language.
It is a long and sad list for C++ replacements, each more ambitious the next yet none stood the test of time.
5
u/pdp10gumby Sep 26 '26
Torbaldās position is a left over and very common belief (once correct) that compiled C++ code is bulkier than equivalent C code. its been true for a long time that C++ code can actually be more efficient than C code because C++ is more expressive, but itās true that itās easy to casually do something that will make the code bulkier.
As for the general case: most C++ complaints boil down to āwhat have the Romans ever done for us?ā
2
u/Technical_Introvert0 Sep 25 '26
Because it's not abstracted like Java and because it's useful
8
u/kevinossia Sep 25 '26
Itās hard and complicated. Ignore the haters.
4
u/tinrik_cgp Sep 26 '26
IMO, C++ is a great language to work alone (e.g. as a hobby). But it's a horrible language to work together with other people (e.g. in a large company).
There is too many pitfalls and ways of doing the same thing, therefore it's very hard to have a consistent style. Some people will overengineer the simplest thing just because the language allows them to.
Linters don't enforce everything. So you have to spend a lot of time creating guidelines about how to do things, and have a lot of friction about it during code review.
10
u/HxSigil Sep 25 '26
itās also a massive, messy language with UB, insane complexity, decades of baggage, and a pretty painful ecosystem. CMake alone should tell you that much
the Linux kernel is probably the worst example here. It already has decades of C code, tooling and conventions built around C, and kernel code generally wants very explicit control over allocation, runtime behavior and failure paths. You can disable exceptions, RTTI and avoid most of the standard library, sure, but then youāre already using a heavily restricted subset of C++, so the obvious question is what you actually gain by switching.
Nobody is stopping you from using C++. If you like it, use it. But treating āpeople hate my languageā like some personal crisis is a bit weird. Itās a programming language, not a personality trait
5
u/Ok_Independence_9841 Sep 25 '26
Those who can't write C++, hate it, and find excuses for that hate. Just like those who can't do object oriented falsely claim that OO is a bad idea while they continue to use the very same ideas themselves, often while not understanding that's what they're doing. It's just humans being human. Anything excellent and difficult will garner hatred.
5
u/amoskovsky Sep 26 '26
Several reasons, all related to Rust.
1 - memory safety of Rust.
Rustaceans believe the memory safety of Rust is enough for other languages to stop existing.
It's definitely not true for C++ as it has much more features than some safety concerns can address. And not every project needs "guaranteed" memory safety (don't get me started on the guaranteed part in Rust; spoiler: it's not).
And when C++ devs ignore them, rustaceans become aggressive and loud, which looks like many people hate C++. It's just an illusion
2 - AI
In the era of AI, big corporations hope to replace devs with AI, and based on the memory safety promises of Rust initiate migration from C++ to Rust, expect the slop code AI produces in Rust would require less efforts avoiding crashes/vulns than C++ slop. That's partially true, but since the migration can be only automatic due to huge C++ code bases - the resulting code is just a huge pile of source code that no human has ever reviewed, which is a ticking bomb of tech debt.
This process though causes massive job market effects and people now suddenly want to dev in Rust just to be in the job market trend.
And when you have to do something you start hating those who don't have to do it :)
2
u/Able_Development2478 Sep 26 '26
Not every language is useful for everything. There are legitimate usecases like explosion of technical debt when you use C++ in a project which does not need it. C++ code can become very complex over time and that can make it very difficult for project heads, etc. to reason about it if managed poorly and they i guess do not want the headache so you often see specific features being banned from use.
There's also stuff about perception that people build over the years. If you think from how long C++ has been there and how initally the standard was so slow in adopting features (C++11) you can see why people would be upset and hold onto the negative perception. Then there's the other segment of people who feel it's progressing so fast to keep up and then people who want changes which C++ committee doesn't answer. The list goes on and on.
I'd say do not worry about why someone hates C++ as it's just a tool. I don't think you'll be super angry if someone doesn't like using a nailgun and prefers to hammer a nail in XD.
3
u/CletusDSpuckler Sep 25 '26
It all depends on where you hang out. You think there's any love lost for Java in this sub?
3
u/Electronic_Tap_8052 Sep 25 '26
C guys like C because it can really only do things one way. There's no hidden function calls (ex deleters when things fall out of scope, operator overloading, etc). Like assembly, what you see is what you get.
But at the same time that's why I like C++. There are many ways to skin a cat and it lets you hide implementation details behind a clean, foolproof interface.
Can it be abused? Sure. All tools can be. But so can C. C forces you to have raw pointers which almost always leads to subtle bugs later on unless you are very diligent about memory management and and lifetimes.
2
u/Resident_Educator251 Sep 25 '26
There are only two kinds of languages, the ones people talk about, and the ones people don't use.
2
u/cfeck_kde Sep 25 '26
If you really want to know why people hate C++, you shouldn't ask in a C++ forum.
2
u/TheRavagerSw Sep 26 '26
People write posts like that never actually worked on a C++ project
2
u/gfoyle76 Sep 25 '26
it's not hated, you are in the wrong company
1
u/CheesecakeTop2015 Oct 01 '26
Of course.
Don't waste time worrying about people who don't agree with you, know your arguments, be curious about their arguments, draw your (temporary) conclusions that work for you and accept there are many differing opinions out there, some more informed/valuable than others.
1
u/nacaclanga Oct 05 '26
C++ isn't hated. It is just widely used and extremely versatile and has plenty of overlapping areas of usability, meaning it is seriously considered in a lot of projects and thus arguments in favor or against it have to be presented frequently. And just like any other languages, it has tradeoffs so it loses sometimes.
Plenty of languages simply get discarded as serious options much faster, so nobody even bothers to spell out the arguments against them very often, which may give the illusion they are less hated. Probably Torvalds would be against writing the kernel in Ada, D, Objective C or the like as well, but we never know since nobody ever suggested that.
Kernels are a very specific uses case, that has quite peculiar priorities. Whether a language is good for that says absolutely nothing about which language would be a good choice for a game, a physics simulation, a webbrowser, a or quick and dirty utility tool.
1
u/rip_void_0 Oct 18 '26
i like c++ (i try rust but i did not like i cant just use int func(&variable)in rust you must write let and another thing !) but ask linux trovald or zig
1
u/fortsnek274 Sep 25 '26
Well, there's certainly a laundry list of grievances.
1
u/Wild_Meeting1428 Sep 26 '26
linus torwalds is using c++ himself for his private stuff. He doesnt hate it. Its the developers which are missusing c++ in a way that it may become unmaintanable or hard to review. Adding another language was not worth at the time the decision was made. Rust is accepted, because it cherrypicked the best of C++ while leaving the opiniated stuff out / took another approach. Like exception free, memory safe by design, no dynamic polimorphism via RTTI, other approach for templates and comcepts (traits and impl)....
C++ is catching up tho.
1
u/C00CKER Sep 25 '26
Some people may hate it, but there are areas that run almost exclusively on C++; e.g., high-performance computing.
It is hated mostly by people who don't really use it for anything or by people who know only some super-old legacy code.
What is somewhat true is that, due to how old it is, some design decisions are not ideal and there are many features that exist but shouldn't be used.
However, memory management in most use cases of modern C++ shouldn't really be an issue; you shouldn't manage memory manually unless you need to for some specific (performance-related) reasons.
1
u/neppo95 Sep 25 '26
Use what you want to use. In terms of companies, they (should) use what is best for their purpose. Sometimes that is C++, most of the times it simply isnāt. Itās not about hate, at least not to 99%
-1
u/Existing_Ratio_957 Sep 25 '26
C++ is god but for the industry is prefered something that is consider more "stable", the industry that i know uses c++ in majority is game industry for development purposes, but at the end it doesnt matter the language you program just do it with passion! You dont need the others like something you like.
-1
u/Technical_Introvert0 Sep 25 '26
C++ is literally like giving someone who's never driven a vehicle a car and telling them to figure it out.. if they crash and die oh well.. if they learn how to drive from that then great ... There's 0 safeties with C++.. literally.. in other languages like Java you can't run uninitialized variables like a+b=c without specified values.. you can in C/C++ and it will give you random garbage.. in java/python you are prevented from writing the same thing twice to be used differently outside of a class or rather naming conflicts..
In C++ nope.. it will use the 1st specified value of that variable until it reaches the next specified value of something named similarly but used for a different thing.. and still compile without error codes.. to of course give you garbage outputs...
C++ is God mode.. you create with C++.. then you manage your creation with abstracted languages like Java or Python.. but you better know what you are doing otherwise you will build an app that stays in the background eating RAM despite being closed like me.. java and others make this hard..
C++ makes making a virus or malware easy whether you intended to or not.. very easy to make something that is catastrophically dangerous to a system in C++. PS, stay away from malloc until you have 6 years of experience coding in C++...
This is part of why people don't like it...they just can't understand it well because it requires an understanding of the hardware you are coding for...it's not some high level crap like Java although it can be
-1
u/AutonomousOrganism Sep 25 '26
The power of C++ brings a lot of complexity with it. As Stroustrup said "Within C++, there is a much smaller and cleaner language struggling to get out".
Another more practical issue is that the c++ standard library is not stable.
-2
u/makmanos Sep 25 '26
I am not sure "hated" is accurate. However building and maintaining production level stuff in C++ is not "cheap" or "fast" or "easy" while there are alternatives, and absolute speed is not a critical factor in what you need to build. That's as far as the "industries" in general is concerned.
Not sure about the Linux kernel though.
0
u/Powerful_Attention_6 Sep 25 '26
I too love C++ but you really need to know your stuff, because C++ has very long rope it offers to hang yourself
And the new C++ standards has become so complex that you can take an actual PhD in it
However, if you are in a position to select your favorite/good subset of C++, then that language can help enormously in writing safe code that is easy to discuss
-3
u/[deleted] Sep 25 '26
[removed] ā view removed comment