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 comments

18

u/Raknarg Jul 25 '24

sure but the contraints tend to be more explicit. Usually if you "need something capable of this thing" its documented with SFINAE or concepts, whereas in C you just hope the user uses your thing correctly. And it makes those things much more traceable, and language servers/intellisense/whatever youre using can usually catch these problems early whereas they don't really with macros.

2

u/SkoomaDentist Antimodern C++, Embedded, Audio Jul 26 '24

It's not a matter of needing "something capable of that thing" but C++ templates giving way too many possibilities for "If I do this clever thing I can make it more generic" that enthusiasts cannot resist. Said enthusiasts of course fail to realize that making something used in a total of three placeds slightly more generic at the expense of making it much more difficult to read and understand is almost never worth it.