r/C_Programming • • 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.

51 Upvotes

114 comments sorted by

View all comments

6

u/UltimatePeace05 Oct 18 '26

In my, and many in the handmade community's opinion, C++ is just C with templates. Modern C++ features are horrible and full of traps. The standard template library is, I guess, better than C's stdlib, but not by much... Which is kind of impressive, since C's standard library is horrible. 

The advance of C++ is just that you can define a Dynamic_Array, Slice and Map template structs and then you don't have to deal with weird macros and codegen... everything else is, imo, extra... (if those 3 were actually in C, I would say that C++ has no significant advantages)

But I also use C over C++, so take my absolute hate speech here with a grain of salt...

3

u/Rabbitical Oct 19 '26

I would add properly typed enums, namespaces, static_cast, having the option of references, and auto are nice as well. Probably forgetting some others...

2

u/realhumanuser16234 Oct 19 '26

auto is part of c

1

u/Rabbitical Oct 19 '26

Sorry I always forget that it was incorporated in C23! (The C++ meaning obviously)

1

u/masorick Oct 19 '26

I’m curious about which specifically modern C++ features you consider to be horrible.

2

u/UltimatePeace05 Oct 19 '26 edited Oct 19 '26

The main thing that I've seen the committee do is "improve" the template language so that you can do more and more at compile time, even though it results in some of the least understandable code, I'd say, anywhere... Take: https://github.com/microsoft/STL/blob/main/stl/src/print.cpp which, I think, maybe defines std::print??? or https://github.com/marzer/tomlplusplus/blob/master/toml.hpp Which is a TOML parser (first search engine result). I tried to find the parse function here to link you to it, but I couldn't... :( In my experience, you don't really see this with applications, might be that it's a lot harder to justify there. Might be survivor-ship bias. Dunno...

Although I also particularly hate the memory management. In my opinion, arena allocators, pointers & handles should be the default, while smart_, shared_, unique_pointers should be incredibly niche tools... (not to be confused with C++ std::allocator which allows overriding allocators for different types??? for some reason..?). This is very much a per-problem sort of thing and every allocation strategy has at least some use case... If you want more things to read there is gingerBill's article series on allocation strategies: https://www.gingerbill.org/article/2019/02/01/memory-allocation-strategies-001/ and Ryan Fleury's big blog: https://www.dgtlgrove.com/p/untangling-lifetimes-the-arena-allocator

But like, go to cpp history or whatever. Throw a dart. Chances are, I will dislike the change (if I have the slightest clue what it is).

2

u/masorick Oct 20 '26

Thank you for your response. To be honest, as a C++ developer, I always find it wild when people rant against "modern C++", because I’m my opinion, most of the changes from C++11 onwards (auto / decltype, lambdas, constexpr, variadic templates and even the dreaded move semantics) have only made the language more useable, and most of what I would consider terrible are things that were there from the beginning, stuff like OOP and iostreams.

In the end, it comes down to a difference in philosophy. What I like about C++ is that it allows me to build powerful abstractions that I can use within the language itself (for instance, I don’t need defer in C++, since I can build it myself using destructors, lambdas and templates), whereas C is quite limited in that regard (you can use C to build an interpreter for a high level language, but not to augment C itself, so to speak), but I also understand why some people would rather deal with all the complexities that come from C itself being simple.

As for memory management, I agree that C++’s type system makes it more difficult to use arenas, but I also like that smart pointers are a thing (if only there was a warning that told people that a shared_ptr is probably not what they need, sigh).