this post was submitted on 30 Sep 2023
317 points (91.6% liked)
Programmer Humor
32472 readers
866 users here now
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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.