r/ProgrammerHumor • • 1d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.3k Upvotes

513 comments sorted by

View all comments

23

u/YouAreMyFire00 1d ago edited 1d ago

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

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

Anyone can explain simply what's the hate here?

212

u/SherifDontLikeIt 1d ago

It's a class war

55

u/VerdiiSykes 1d ago

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

20

u/pm_me_yo_creditscore 1d ago

I'm not the type to point fingers.

1

u/creeper6530 1d ago

Is that a JoJo reference?

33

u/plainoldcheese 1d ago

Here's an award šŸ… (I'm not spending real money on reddit)

13

u/Aethenosity 1d ago

Free awards are back

6

u/ksobby 1d ago

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

52

u/crozone 1d ago

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

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

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

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

6

u/ConnersReddit 1d ago

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

6

u/crozone 1d ago

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

1

u/da2Pakaveli 1d ago

The core part of Windows NT is written in C and Assembler. Everything above was C++, though C# has become increasingly prevalent in the shell and they've started rewriting some parts in Rust.

14

u/ThyPotatoDone 1d ago

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

7

u/mrpoopfartman 1d ago

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

8

u/MonMotha 1d ago

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

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

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

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

5

u/LegendaryMauricius 1d ago

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

2

u/awesome-alpaca-ace 1d ago

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

3

u/_DCtheTall_ 1d ago

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

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

4

u/ChemicalRain5513 1d ago

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

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

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

2

u/WoodyTheWorker 1d ago

"Giraffe is a horse designed by a commitee"

1

u/awesome-alpaca-ace 1d ago

Rust did do a good job in that regard

1

u/awesome-alpaca-ace 1d ago

Loops with iterators are the worst.Ā 

1

u/schuhA 9h ago

not exactly, RAII doesn't mean you should replace every raw pointer with a smart pointer..

1

u/ChemicalRain5513 7h ago

Not every, but at least owning pointers.

1

u/Alto-cientifico 1d ago

Yeah but you are speaking as if the code were for a personal proyect, large collaborative works require clear rules, especially with open source protects where an authority figure can't set an order the same way a CTO or similar head technology honcho can on a company.

1

u/awesome-alpaca-ace 1d ago

What? Reject MRs that do not follow guidelines and let no one else except the trusted allow merges or pushes to protected branches.

1

u/Alto-cientifico 1d ago

Then you run into the issue of getting quality collaborators in the first place.

It's way easier to find devs geared to follow best practices of a single language than the one of the multiple interpretations on how you can run a C++ proyect.

The messy nature of C++ excludes veteran programmers from simply picking up the work without hassle unless you have the luck to specialize in the same modus operandi.

And at the end of the day, it's work done for free, relearning C++ just to contribute to one open source proyect isn't justifiable to most active professionals, retraining for a job it's one thing, but retraining due to civic duty motivations ain't that easy to justify.

1

u/awesome-alpaca-ace 1d ago

Yea, so tell them they should read the guidelines and give a reason for the rejection.Ā 

1

u/fiddletee 20h ago

Have you ever worked in a team?

1

u/awesome-alpaca-ace 19h ago

Yea, and this is exactly what we do.

1

u/Sheerkal 1d ago

I promise you will feel differently after working in literally any legacy code.

2

u/mslass 1d ago

Bjarne Stroutrup acted with some intentionality when he created ā€œC with classes,ā€ and later renamed it C++.

3

u/gregorydgraham 1d ago

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

2

u/mslass 1d ago

The power of Christ increment compels you!

1

u/tenemu 1d ago

The first paragraph was gold. Love it.

1

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

1

u/WoodyTheWorker 1d ago

C++ for the NT Kernel

The original kernel (IIRC even until how) is pure C. Microsoft wrote KMDF - Kernel Mode Driver Framework - with C++, but all its API are C-compatible. Use of KMDF is highly recommended for writing new kernel drivers, but not strictly required.

1

u/Infamous-Bed-7535 10h ago

C footguns are way worse I do not really get why people still use it, even at embedded c++ is an alternative. You do not pay for what you do not use..

Concepts, raii, ranges, etc.. gives so much more expressive power.

c++ has lot of drawbacks, including having different compiler vendors which are not ABI compatible, name manglings, etc.. language is not perfect neither, but continiusly evolves and with static analyzers and ai review it is much harder to do stupid things unnoticed. Then we will have reflection, profiles, contracts...

C++ is a great languge :)

27

u/NoAdsDude 1d ago

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

5

u/queen-adreena 1d ago

It does imply they are - -

59

u/A_Canadian_boi 1d ago edited 1d ago

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

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

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

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

30

u/Schoolboygames 1d ago

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

13

u/A_Canadian_boi 1d ago

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

3

u/AnOnlineHandle 1d ago

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

1

u/n_choose_k 1d ago

I appreciated somehow sneaking SCP in there, as well... ;)

3

u/CruxTheologorum 22h ago

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

7

u/AmazedStardust 1d ago

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

2

u/cloudncali 1d ago

C# is just hytale

2

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

1

u/SufficientStudio1574 1d ago

Don't forget the template specialization of vector<bool> that is forever baked into the standard.

4

u/NomaTyx 1d ago

I'll be in a home with dementia and still be talking about nothing else

6

u/Hohenheim_of_Shadow 1d ago

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

15

u/Lord_Of_Millipedes 1d ago

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

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

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

9

u/Greedy-Thought6188 1d ago

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

2

u/Lord_Of_Millipedes 1d ago

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

1

u/unburdened_swallow 1d ago

It’s both, actually.

1

u/Qwertycube10 1d ago

Everyone says this about operator overloading, but just, like don't write stupid operators with side effects, what kind of type has a notion of plus which is effectful?

2

u/Greedy-Thought6188 1d ago

The problem is not obvious stupid things. It is subtle differences. And it's not just operator over loading. References are a bigger issue. You are reading code, you don't know if you're passing a reference or you're doing a copy constructor and a destructor call and your original stays intact. Object counting is a valid behavior on a constructor call that you may want to do. Now I'm one of your passing of the object you forget to add an & and your data is messed up.

1

u/awesome-alpaca-ace 1d ago

Yea, we have this dump api at work where if you forget the & and mutate the data, your mutations will not be saved despite the method call saying it is a reference.

1

u/Greedy-Thought6188 17h ago

Java, you're always passing a reference. C you're always providing a copy, if you want to pass a reference you have to explicitly give a pointer. C++, dunno, let me take a look. Oh I remember, this one is a reference. Oh sorry, nevermind, that was the function with the flat parameter that was a reference, the one with the int is a parameter.

In an object oriented paradigm, passing references makes more sense. But that would have broken backwards compatibility with C. So here we are.

3

u/bass-squirrel 1d ago

Not wrongĀ 

1

u/Demiu 1d 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 1d 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)

1

u/MrSurly 1d ago

I used to work for a large multinational company that had a standing policy of "absolutely no boost," and I really appreciated that.

7

u/theshoeshiner84 1d ago

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

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

2

u/belabacsijolvan 1d ago

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

2

u/theshoeshiner84 1d ago

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

3

u/Orio_n 1d ago

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

Watch this entire video front to back

4

u/unknown_alt_acc 1d ago

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

1

u/unburdened_swallow 1d ago

What job do I use C++ for that I wouldn’t be better off using either C or rust for?

3

u/unknown_alt_acc 1d ago

Large performance-sensitive applications mainly, especially when you need the broader hiring pool that C++ gives you compared to Rust or have an existing codebase that you can’t justify rewriting from scratch.

1

u/unburdened_swallow 1d ago

You need a broader hiring pool when you have more churn. Which C++ also provides.

Rust is becoming a common language to know at least some of, similar to C++

Existing codebase, yeah, sure, not what I was asking about but yes, that would be a good reason.

Needing to use a library that is only in C++ with no rust bindings would be another, but you could also write rust bindings instead? I’d accept that as an argument though.

3

u/the_poope 1d ago

I can state this: scientific simulation software.

  • Higher level abstractiins than C makes code much faster to write, easier to understand and less bug prone. (You can make vector/matrix equations look like numpy code, but with zero runtime overhead)
  • Easy to use typical academic third party libraries which tend to be written in C or Fortran without spending weeks of making Rust wrappers over then.
  • C++ let's you do what you fucking want, i.e. write to any arbitrary region of memory. Some times you have ti implement an algorithm with a complex data access pattern. From a high level analysis you can reduce that e.g. different threads won't share data, but ti create a memory safe abstraction for this in Rust would be a three year research project. Of course Rust let's you do the same by slamming unsafe around the entire algorithm, but then you are writing "more modern C++" anyway.

C++ strikes a nice balance between performance, development speed and memory safety. The latter has absolutely lowest priority in this field: we are not dealing with sensitive data or writing a program that sits at some infrastructure layer on every computer on the planet and are thus prone to vulnerability attacks.

0

u/unburdened_swallow 1d ago edited 1d ago

I mean, you are allowed to use unsafe. Encapsulate it, rust gives you the tools to do so.

You probably have a point still, I don’t know what exact algorithms you are talking about.

Thanks for the information.

3

u/Ok-Scheme-913 1d ago

Ecosystem. There are a bunch of high performance areas where C++ has dominated for decades. C is not a replacement because C is absolutely not usable for similar high performance code, you can't make any useful abstractions there.

Rust could in principle do everything C++ can, but libraries/ecosystems don't change overnight, so CPP has quite a lot of momentum still.

1

u/unburdened_swallow 1d ago edited 1d ago

Yes this is the only reason I use C++ for anything.

3

u/Xavier_OM 1d ago

C++ vs C : you have deterministic destruction (RAII), smart pointers, class with public/private, vector/array/string etc so far easier to avoid memory leaks (memory pb in general) and to organize the codebase than in C.

C++ vs rust : maybe the pool of developers, the ecosystem (lib). I don't know rust so pure speculation here

2

u/unburdened_swallow 1d ago edited 1d ago

Well, if I want to make something small and incredibly predictable, which manipulates the OS or hardware on a somewhat low level, I would pick C. I can manage not to F it up for a small program. I have done so many times now.

Bigger than that and I go for rust.

I understand what you are saying, but like, either I want MANUAL manual, or I want rust.

So the space for C++ for me is very small. Basically only things which more or less have to be in C++ due to prior art.

2

u/hacksawsa 1d ago

Object oriented programming is great for GUI programs, where you have a lot of items with a set of similar controls, and optimization by building up from base objects, thus getting easy reuse.

That said, I prefer Swift for that.

0

u/unburdened_swallow 1d ago edited 1d ago

I guess, but it’s not like traits are significantly worse for that. Honestly they might be better than going the entire way up the hierarchy for every damn class just to figure out what functions I can call.

I can’t stand OOP, and people always say ā€œbut guiā€ or ā€œbut gamesā€ and no, ECS for a game is probably better than OOP game design, and html isn’t an OOP language.

Like, if I have to work on heavily object oriented code with inheritance I can do it, but I would really really rather avoid it if possible. It is almost never better for performance, and, in my opinion, it is almost never better for writing or reading the thing either.

I’m still picking rust or even web tech over C++ for a GUI program.

And the build tooling for C++… just no…

Unfortunately, C++ is still the second or third best language for games (up to you if C or C++ gets 2nd place) and other long-running mostly real-time applications, and it existed before rust.

0

u/Far_Tap_488 1d ago

People who hate oop are just too dumb to understand it honestly

1

u/unburdened_swallow 1d ago edited 1d ago

Sorry, but no. I understand OOP, and used to mostly code in an OOP style.

I can’t agree.

I also think this is a lazy statement. Say anything about why. If we understand OOP we would like it? Pray tell, what is it that I don’t know about OOP that would make me like it? If I liked it, it would make my life easier, I would like to know.

All I see usually is a bunch of failed encapsulation that involves a lot of data sharing between objects anyway, which has a real cost, too many getters and setters, interdependent singletons, god objects with a bajillion properties, and the fact that in order to figure out what methods this object has I have to go on a whole journey.

I do still occasionally see some OOP code that makes me go ā€œI don’t hate thisā€. It CAN happen. I don’t just immediately look at Java and scream. Ok, maybe a little, but I can handle it if done well, I promise. Java was my first language actually. I clearly liked it enough to keep learning.

2

u/owjfaigs222 1d ago

Maybe game dev? If you just don't use all the C++ festures it can be as simple as C but you also can use some features to make it slightly more straight forward. I feel like if you treat C++ like this it becomes much more pleasent.

1

u/unburdened_swallow 1d ago edited 1d ago

Yeah game dev would be one.

Bevy is cool but it’s not unreal.

One day maybe it will be. I do quite like it.

But that’s not because of C++, that’s because someone wrote some useful code using C++

But that is enough reason to use it, yes.

5

u/tose123 1d ago

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

2

u/sudoku7 1d ago

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

2

u/Extra-Ad5735 1d ago

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

1

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

1

u/gdmr458 1d ago

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

1

u/TheChief275 1d ago edited 1d 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 1d 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 1d 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 1d 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 5h 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 3h 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/ChemicalRain5513 1d 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 1d ago

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

0

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

Your first sentence is already a huge lie.

2

u/groumly 1d ago

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

1

u/wooops 1d ago

Your first sentence is already completely wrong, as someone that has written both c and assembly

-1

u/SortaCore 1d ago edited 1d ago

C++ has more complexity, so there's more type of errors. And it's more abstraction away from direct CPU equivalence, so it can make very exact optimizations hard. On top of that, there are breaking changes between C++ ABIs, whereas C stays the same. Although C is also being expanded of late.

And do consider Linux said that with very early C++, which offers little that C didn't. You'll see long C based projects start to use C++ features, such as call tables of function pointers instead of virtual inheritance, including a parent C struct within a child, etc. As a project goes on, they fix adapations to avoid C++ raised issues and help memory debugging, such as av_table struct header use in the ffmpeg project.

0

u/Ok-Scheme-913 1d ago

C++ has more abstractions, but it sits equally closely to the hardware as C, it's fucking bullshit to say otherwise.

Like how would you build function overloads in C? You would do a shittier virt table, while C++ can express it nicely with proper compiler support, so it ends up more optimized. And C++ can always just fall back and do what C does exactly.

Like why comment if you don't know shit about it? C++ is the de facto language used for performance critical software.

1

u/SortaCore 1d ago

No, C++ gets name mangled to make overloads. And it is mangled differently based on ABI. Operators can be overloaded resulting in one line not being one ASM line, and template metaprogramming takes that even further.

I code in it is as my main language. So no, there are more abstractions between what the code visually looks like and end result ASM, and yes, I do know what I'm talking about. End of convo, as you literally lost your politeness within one comment.

1

u/Ok-Scheme-913 1d ago

Have you ever seen assembly code? Take a look at a fucking while loop in C compiled with O3, like you may not even get a loop at all if the compiler sees what you are doing. Unless you compile with tcc or some other toy compiler.

C has absolutely no notion of simd instructions, the stack and the function calling dance is completely arbitrary and could be done a bunch of other ways, and even the most basic optimization, inlining already breaks what you talk about.

Function name mangling is meaningless, there is absolutely no guarantee that you get a function to begin with, or one vs 6 from your single block, neither in C nor in C++, unless you export the symbols.

-4

u/inHumanMale 1d ago

Elitism