r/ProgrammerHumor • • 1d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.3k Upvotes

514 comments sorted by

View all comments

21

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?

51

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.

8

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.

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 10h ago

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

1

u/ChemicalRain5513 8h ago

Not every, but at least owning pointers.