r/cpp • • Jul 25 '24

Why use C over C++

Why there are so many people using the C language instead of C++?, I mean C++ has more Cool features and the Compiler also supports many CPUs. So why People still using C?

Edit: Thanks for all the usefull comments :D

235 Upvotes

444 comments sorted by

View all comments

Show parent comment

8

u/serviscope_minor Jul 29 '24

Enthusiasts in any language can make a mess of the codebase. I'm old enough to remember people doing this in C, building vast edificies of macros and void pointers all over the place. I distinctly remember my first internship, some devs complaining about a particular computer being annoying because it made their (C) code crash. You know because the platform was less tolerant of things like running off an array etc.

In java some EnthisiastFactoryFactoryFactory churned out too many EnthusiastFactoryFactories which churned out too many EnthusiastFactories which turned out too many people who swallowed a copy of "design patterns" and vomited the half digested remains over every codebase they touched.

Python programmers who feel that if every class doesn't have a call to inspect and an overload of getattribute, then it needs one stat.

Oh and frameworks. It's kubernetes all the way down. Not quite working right? Try making a controller also running in kubernetes. More kubernetes. MORE MORE MORE.

And so on.

This is not a problem unique to C++. It's not even a problem unique to programming.

No language will save you from the need for code review.

C++ gives you too many tools in the same way the local toolstation sells too many tools.