News for hackers. Stuff that matters.
Re:C++ Is an Absolute Blast by thefourthchime on Monday December 23, 2024 @12:29PM (#42496012)
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).

Re:C++ Is an Absolute Blast by pjmlp on Monday December 23, 2024 @12:40PM (#42496126)
There 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.

Re:C++ Is an Absolute Blast by unclad5968 on Monday December 23, 2024 @10:12PM (#42499447)
You 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.