What if I want to undo my life’s mistakes.
Developmental informatics hacker
What if I want to undo my life’s mistakes.
I rarely use the debugger. When I do it’s because I’m tired and I always regret it tbh. It’s just a waste of time and clutters my screen.
The fastest way by far is to simply read and think. You have to do it any way.
The print is the last resort, I tend to use it maybe once per day. Doesn’t clutter my screen and works with the shortcuts I’m used to. Totally flexible. Can comment out and share with team or reuse later. The issue is often immediately clear.
For example today I used it on a position after a multiplication with a matrix. I didn’t explicitly convert it from a float3 to a float4, so w was 0, and it caused it to rotate instead of translate the position vector. Once I printed it it became clear.
Had I just read the code again and thought about what it was actually doing I would’ve found it more efficiently.
If you have optimizations enabled this can easily occur due to code being moved around behind the scenes. For example the body of a small function can be inserted where it is called. For example in c# if you get a null ref exception in such inlined code it will actually direct you to the place where the function is called from, rather than its body.
So if you know, you probably can find the issue. In the worst case just go to debug mode with opti off, or use an attribute on the function to force it not to inline.
//TODO write todo comments in your wip code.
Your IDE will make them easy to find or you’ll just run into them.
Tja in a world where every OS has its own stupid little UI system, language and IDE…
Apparently my brain compiler does hang. Where’s that whiskey.
Customer support level: People’s person
5 ways to emotionally scar your kids for life!