Your Worst "Gotchas" ever in programming
Not-so-proud owner of blog: http://agathokakologicalartolater.wordpress.com/
Implementing a compiler front-end in Python. Write the prosaically-named 'SyntaxError' exception class. Realise that none of the methods on my SyntaxError class are accessible.
A little later, run 'pydoc SyntaxError' and realise the problem...
Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]
I don't recall the best.
But I'll tell you what I just fixed.
Updated an old project to new interface.
It failed on a custom string comparison.
Figured out the new project had optimizations all ON while dependencies didn't.
Previously "Krohm"
First time I used a treeset with a custom comparator and I couldn't figure out why it was loosing elements after calling sort().
Remember to mark someones post as helpful if you found it so.
Journal:
http://www.gamedev.net/blog/908-xxchesters-blog/
Portfolio:
http://www.BrandonMcCulligh.ca
Company:
Probably everything when I'm kinda sleepy.
When I'm doing something and I'm not pretty focused, sometimes I go into "auto mode" and I eventually just lose track of what I'm trying to do and how.
So I code, code, code then something doesn't works and I spend 40min trying to figure out what I was doing (like literally, just trying to understand what I was doing the last 20 seconds), why, how I tried to do it and only then why it isn't working.
"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"
My journals: dustArtemis ECS framework and Making a Terrain Generator
EDIT: I'm into some of those moments with Labview too. It's inherently parallel, so I'm sucking with queues and notifiers to avoid race conditions, sucking with messages getting lost and making workarounds to solve that.
Ah, yup, here's a gotcha: in Labview you draw wires (data flow) between icons (kinda like functions). I was debugging a bug for three hours, foaming at the mouth, breaking the keyboard in rage, when I accidentally noticed that the wire was hiding under the debugged construct (a case structure), and the wires from inside the case construct weren't actually connected with the outside. No wonder why values never changed. It was impossible to tell by eye, the wires where collinear, the little output "ports" were there on the structure, but not connected with the wire outside.
Yeah, I actually had one of these moments today...I implemented 3D sound with OpenAL, however it was clear to me that it didn't sound exactly right; like sounds switching from left ear to right ear randomly. I didn't manage to find what was wrong, so I closed the computer and went out...and on the cafe, I realized that AL_ORIENTATION would require 2 vectors, direction+upvector...just direction isn't logically enough no matter the API...so I returned home and sure enough, it expects 2 vectors instead of just the 1 I passed. Which, in OpenAL's C world means it expects a pointer to a 6-float array, which means it was just reading garbage for the up-vector. Don't you just love these kind of bugs?(OTOH, maybe I should have read the documentation more carefully :P)
My experience isn't interesting but is the only one I remember...
During last summer, when I started working on current project, at one moment I was implementing first collidable object. That time for tank I was using Vector2 Position and Vector2 Origin to tell spritebatch where to draw the sprite of the tank while keeping its bounding box as Rectangle. To be able to properly rotate tank, Origin must be set at the center of the texture itself. Position of tank was set the same as topleft point of its bounding box. I spent one week trying to figure out why was half of the tank going under the wall before eventually leaving it out of burnout and frustration.
2 months later, I remembered that Origin defines the point from which the sprite will be drawn...