r/C_Programming • u/Ok_Reserve996 • Oct 18 '26
C limitations
Hi all,
I am currently learning c++. Its okay. Not sexy but also not as bad as some say.
The reason I am learning c++ is that I have read that C has limitations as soon as a project gets more complicated. For example, if you make a scientific calculator with many features like graphs etc.
Trading engines/tools are also not recommended to programm in C.
Since I have not learned C and have only read from some old forum posts etc, I cannot confirm/deny these facts.
I am aware that "everything" is possible and that C++ comes with QoL improvements especially with Classes. But I assume that doesn't mean that someone has to use C only for kernel work. Embedded is also possible with C++ right?
I would appreciate your thoughts and opinions.
The goal of this post is to understand how and if C could fit me more with my goals and what real advantages or disadvantages C has.
View all comments
Show parent comment
3
u/Kriemhilt Oct 20 '26
I strongly disagree with pretty much all of this. I doubt I'll persuade you, but I don't really want this sort of reactionary misinformation floating around unchallenged.
The non-C-like features that are completely free include for example:
reinterpret_castescape hatch, and has no downside at all except for verbosity where you're doing something unusual (or non-portable, or inadvisable)entirely false, the entirely philosophy of C++ is that you don't pay for what you don't use.
No, it's because it's doing a lot more stuff. The design is now consider old & clunky anyway, and
std::printwas added for a reason, but it's not a fair comparison. If you don't need all that "stuff" (customizable typesafe formatting, facets, per-stream locales, etc. etc.) then just don't use it. There's no overhead for not using something, and it is again perfectly normal to just not use things you don't need.Scattering error-prone manual string formatting and buffer management through your code is empirically not an improvement, except in the very niche cases where that's your main focus or a huge bottleneck. Write being lean isn't an improvement if you still need to call
snprintfto generate the buffer to write. C isn't "bloated" for having a redundantprintffunction in addition tosnprintf+write, and C++ isn't bloated for adding a safer, more correct but slower, iostreams either.C++ is closer to the "batteries included" philosophy that the standard library should provide enough tools, to a good enough standard, to at least get started.
std::unordered_mapwill give you a fairly reasonable hashmap for literally no effort, and if that implementation turns out to be a bad fit, switching to the boost or absl or folly implementations just requires a typedef.C++ isn't limiting you at all by giving a sane default, and C isn't saving you time or overhead by giving you literally nothing to get started with.
Choosing what part of a language you're using isn't "cutting out" anything. You're still writing C even if you never use bitwise-XOR in a particular program. Nobody will accuse you of "cutting out" parts of the language, or suggest using a different language that doesn't have bitwise-XOR in the first place because "it's a better fit for your problem". Nobody will do this because the argument is insane on its face.
I understand this might be hard to believe if you're used to a single-paradigm language with a single reasonable way of doing things, and it's totally reasonable than not everyone likes languages that support lots of different styles, use cases, features etc. But deciding what language features or libraries support a given program is normal even in C. It's just less obvious because there's less scope to choose.
And the very obvious advantage to having a single multi-paradigm language is that I can choose different subsets for different parts of a program and still have it all interoperate without needing FFI bindings or multiple compilers. If I want my core logic to be purely functional, my support libraries to be templated, and the configuration library whose performance I don't care about at all, to use OOP and exceptions, there's no problem at all.