4 ms·
I feel like an abused spouse after C++. I now avoid: - Inheritance - Reference counting - Threading - Templates - Classes if possible - Hidden memory allocatio
by thefourthchime 2y ago
I feel like an abused spouse after C++. I now avoid:
- Inheritance
- Reference counting
- Threading
- Templates
- Classes if possible
- Hidden memory allocation
- Anything that looks clever
Anytime I use them I get flashbacks to some mangled mess of templated threaded classes with some memory leak that shows up after 3 days.
I remember writing C++ and trying to figure out how the design would work between these classes, I would end up with something complicated and not entirely correct. Eventually, I thought, what if I did this in C? What would it look like, 90% it turns out with 90% less design and code (and bugs).
- pjmlp 2y agoThere is no rule that requires "programming in C++ proper" being equal with using 100% of the language standard. There is a middle layer, without having to keep repeating all the security flaws of coding in plain C.
- unclad5968 2y agoYou don't have to use any of that and you still get lots of nice things like range based for loops, STL containers, algorithms, namespaces, and constexpr.