C++ vs C Debate

Comments debate the merits of C++ compared to C, focusing on C++'s excessive complexity, multiple paradigms, lack of opinionated design, and challenges in producing consistent, maintainable code across teams.

📉 Falling 0.5x Programming Languages
8,970
Comments
20
Years Active
5
Top Authors
#7630
Topic ID

Activity Over Time

2007
12
2008
75
2009
185
2010
207
2011
285
2012
348
2013
448
2014
435
2015
415
2016
642
2017
581
2018
536
2019
528
2020
680
2021
751
2022
788
2023
743
2024
613
2025
644
2026
56

Keywords

PITA IMHO IMO UB RAII STL ANY OOP JavaScript i.e language features code raii std pointers languages exceptions modern writing

Sample Comments

hossbeast Sep 15, 2017 View on HN

Just use C, and retain your sanity. C++ is full of awkward heavyweight hard to understand abstractions like this.

shadowgovt May 30, 2023 View on HN

Yes. My biggest frustration with c++ as a language is that there are often two ways to do things: the right way, and the way you will find in tutorials and codebases because the right way didn't exist yet when they were written. This means the cognitive load to use the language in any context that isn't "greenfield project with experts" is significant relative to other languages.

_ph_ Jul 1, 2017 View on HN

The problem with C++ is, that for all its added complexity and powers, most C code still is correct C++ code, especially all the unsafe pointer manipulations. And there is no real performance reason. Many static typed languages compile to code as fast as C - if not faster thanks to tighter semantics. (Other than that some C compilers are better quality because of the effort went into them due to language popularity rather than any language feature)

taneq Feb 15, 2016 View on HN

C++ is a language that's easy to code badly in, but that doesn't mean it's hard to code well (portably, maintainably, effectively) in.IMO it's a language that well suits pragmatic programmers who are willing to cherry-pick the most convenient and productive features for their projects and leave the rest alone.It's a terrible language for those of us who compulsively try to be clever and use every little nook and cranny of the language they're using. They get l

DominikD Aug 16, 2015 View on HN

It's true. But bad stuff is still there for you to (ab)use. I don't like C++ because (at this point at least) it's not opinionated enough. 10 ppl can write 10 completely foreign (in terms of feel) pieces of code and all of them would be correct in some sense of the word.

shadowgovt Nov 28, 2023 View on HN

The biggest problem with C++ isn't that you can't write clean, structured code with it.It's that the language is so vast that the odds of any two developers working on two different projects agreeing on what that means are low. I programmed in C++ for a decade, then for a year or two at a second place, then picked it up again in a third... And all three places had nearly completely different best practice protocols. Pre-processor macros are banned, but deep template abstraction

fndex Jul 12, 2023 View on HN

One could argue that C++ is much more complex and hard to write correct code.

greatgib Dec 14, 2020 View on HN

Despite being convenient,I have the feeling that it might be a bad idea.One of the key interest of C compared to more recent languages is that everything is explicit. With a finger you can follow the code as it runs and know exactly what is going on and when exactly.At the opposite, there is c++ that does a lot of things automagically. And it is often hard to understand why you suddenly get a segfault out of blue, just because a destructor was randomly called at the wrong time.

halayli Dec 15, 2014 View on HN

One of the main problems of C++ is that programmers treat it as C with classes because that's what it feels like at the surface. They think they know it because it feels like C and many decide not to learn its patterns and details. From the examples given, it's clear that the author is not very familiar with C++ and is also comparing Rust to C++98 which is not fair. C++11 is almost a new language.

olvy0 Nov 20, 2020 View on HN

You’re right about typescript, but in my opinion the same thing could be said about C++. You can say that, superficially, C++ is also just “C with types”. You can write “C in C++” and ignore the types, as many developers do, and risk runtime crashes or errors.I have to deal with this sort of code on a daily basis. When I talk to the people who wrote that code, they mostly shrug and say that C++ was too complicated for them, they just used what they know.The flip side of this is people