This morning, I set out to work on one of those bugs that's easily solved if you're one of the sort who knows where to make the chalk mark. (As in the old joke that ends, "How can you charge me $10,000 for making a chalk mark? I want an itemized bill!" And the itemized bill read:
But I digress...)
So I made the chalk mark in the appropriate place in the code and watched in horror as it didn't work. In fact, not only did it not work, but the debugger started pitching an unending stream of errors in my direction. What the heck?
A bit of research later, I discovered that another programmer had tossed a brick into the middle of one of the functions whose well-defined behavior I was relying on. When I asked him why, he said that was the way that he wanted it to work. Roughly paraphrased, the conversation was like this:
"But that's bad application behavior."
I talked to our group's development manager. As a result, I've removed the offending code and we are once again a well-behaved application. As it turned out, the ill behavior resulted in yet another bug that no one else had found and that I documented and fixed as part of the process. Since this one would have caused our users to lose changes with little warning -- normally, if you hit "Cancel" in this particular dialog, you get a chance to go save your changes; the ill-behaved code closed the app out from underneath you -- I'm thinking it was probably a good one to fix.
*sigh* At least it didn't get out the door that way.
Edit: And just to clarify, it probably wouldn't have gotten out the door that way, as our QE group has just started serious testing for the next release and probably would have found this bug eventually. I just found it first.