Some days I despair at the code I write.  I’ve been doing it for enough years now that I should be avoiding the stupid bugs, like keying a hash on a non-unique value over the run of the program.  The brilliant part about that bug though, was that it looked distinctly like a random bit-flip.  A value from the database appeared to be getting modified, even though there was no code that actually modified the value at any point.

A quick change to the keying value to be a composite of two values that would ensure uniqueness, and life was groovy.