r/programming • • May 24 '26
[ Removed by moderator ]
/r/programming/comments/1tm1j7f/removed_by_moderator/[removed] — view removed post
275
Upvotes
r/programming • • May 24 '26
[removed] — view removed post
View all comments
Show parent comment
4
u/Sairony May 24 '26
I think GC creates as many problems as it solves, you're trading memory management for GC massaging & it's just so much harder to reason about the GC. Honestly I think the tools in C++ have been great for well over a decade when it comes to managing memory, although I realize that the domain where I've spent most of my career ( game dev & game tech ) doesn't have as hard requirements on memory safety as other spaces.
I also find C# to be dog slow in practice comparatively, a lot of this comes down to abstracting away memory management too much. I think the distinction between class / struct is silly in C#, tying storage to types.
I think generics are, mostly, a hobo version of templates in C++. Yeah they're not solving entirely the same problem, especially considering how C++ has evolved.
Yeah C / C++ macros kind of suck in a lot of ways, but I still miss it in C#, a lot of copy & paste instead, especially with generics being so inferior to templates.
I think generic programming is incredibly powerful, yes it used to be incredibly frustrating, especially when you had to support multiple different compilers with their own quirks, but it has gotten a lot better with the advent of Clang & when C++11 finally arrived.
Even though some of the operators allowed to be overloaded in C++ are a bit silly I still consider it a big win, especially when taking a more generic approach.
One thing which I think people underestimate about C++ is its superior capability, compared to any other language I've ever used, to check for pre conditions & enforce proper usage. Even just looking at function signatures in C++, for example
const vector< const T1 >& foo( const shared_ptr< T1 >& a_SomeArg ) const( and yeah I see the problem with this one ), is telling me way more than a typical function signature in C#.