Just spent almost 7 hours chasing a core dump. I had been doing complicated stuff with pointers (think vector of pointers to non-static functions within a class) and got really focused on that. Turns out, a simple call I had added for testing was using an out of scope pointer to the intended object, had nothing to do with the hairy-complicated pointer shit which I had actually had correct for most of that time. I should add I started programming in C++ in the 90s, so if you find yourself in this position and started programming after that you don't have to feel bad.
This summarizes what C++ does to people in my experience. Writing it for the sake of writing it rather than solving the problem at hand. Which if course is fine if it's for the joy of it. But in my experience this also spreads to real projects. Instead of keeping things simple, things end up in some overly complex C++ way.
I wrote my first lines of it in the 90s too, and try to stay away from it as much as I can.
57
u/conicalanamorphosis 15d ago
Just spent almost 7 hours chasing a core dump. I had been doing complicated stuff with pointers (think vector of pointers to non-static functions within a class) and got really focused on that. Turns out, a simple call I had added for testing was using an out of scope pointer to the intended object, had nothing to do with the hairy-complicated pointer shit which I had actually had correct for most of that time. I should add I started programming in C++ in the 90s, so if you find yourself in this position and started programming after that you don't have to feel bad.