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
1
u/LordRybec Oct 19 '26
Polymorphism in C isn't that hard. In fact, I think I've worked out at least three models for doing polymorphism in C (and at least two in assembly...). I've never used even one in practical code though. There's always a better way. (Typically unions with a type identifier.) Coming up with those was a good exercise though, in part because when you do it manually, it helps you to realize what a horrific mess it really is. After doing those, I feel no temptation to use polymorphism anywhere, and I don't even feel much temptation to use objects anymore.
(Side note: I program mostly in Python and C. I occasionally use objects in Python (handmade objects, I use built-in objects constantly, because you can't avoid that). I never use polymorphism in Python, because you almost never need to. The dynamic typing means that I can give every renderable object a render() function, every updatable object an update() function and so on, without any need to inherit from the same parent, and together with heterogenous lists that means I can throw them all into the same list and then iterate through calling the appropriate function with no need for any kind of polymorphism. There are some fringe use cases for polymorphism in Python (mainly when inheriting from built-ins designed to be extended), but the vast majority of the time you can just take advantage of dynamic typing and maybe a bit of metaprogramming to achieve the same results more cleanly and efficiently.)