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
2
u/LordRybec Oct 19 '26
This is the fallacy of the "do everything" language that drove Java into common use. "My language is a big language that can do all of the things really well" is never true. That's called bloat, and it's part of the reason C++ is substantially less performant than C unless you avoid using most of its non-C-like features.
I understand that it's normal to pick a suitable subset of code/syntax from a massively bloated language. This is part of the reason most modern applications are garbage under the hood. You assume that normal means good, but this is not always the case.
The reality is, the more generalist a high level language (or library, or framework, or platform...) gets, the worse it gets at doing any particular thing. This is because it has to support a huge amount of use cases that any given application only uses a small handful of, and that generalization adds a lot of overhead. This is why cout is so much more expensive than a write system call. (And even printf is moderately more expensive.) The write system call is perfectly well suited to printing out any string you give it, but cout wants to handle type conversion to text for a massive number of different things. write is very narrow and leaves things like conversion to the user. cout is extremely generalist and tries to do everything, the consequence of which is that it can't do anything with good performance or memory usage.
This extends to C++ in general. C is very narrow and leaves the vast majority of things up to the programmer, providing only a handful of basic tools. C++ tries to gives you the kitchen sink, but as a result it's not ideal for any application. (And Java tries to give you the moon on top of that.) If you are only using a small subset of C++ specific features, you are better off using a less generalist language that doesn't have the features you aren't using, because tossing a bunch of the generalist stuff will save you RAM, CPU time, and other resources (often including development time). Maybe you don't care about those things as much as the few C++ features you want to use, but the point is that there are significant, objective benefits to choosing a better suited language if your application requires cutting out a significant portion of the language you are using. Personal preference is purely subjective and does not magically make the objective benefits go away, no matter how strongly you disagree. Anyone can choose to use a poorly suited language for their application, but that doesn't make it wise or good to do so, even if it is normal to do so.