Don't ask to ask, just ask | |
PerlMonks |
Re: PM Confessionalby ELISHEVA (Prior) |
on Jan 18, 2011 at 21:37 UTC ( [id://882994]=note: print w/replies, xml ) | Need Help?? |
My mea culpa: I had designed an C API where most of the functions were supposed to return 0 for "all is well" and an error code if something is wrong. This is a standard return value pattern for C. One of our team members went on vacation. His code was a "mess" so I thought I'd clean it up a bit. He came back a few days later. About that time, a big chunk of the API that had been coded and tested stopped working. We couldn't figure out what could possibly be the problem. Since I was the lead and we were really stuck, I went through the code looking for a bug. After laborously tracing code (this was back in the days of character monitors - VT-100 I think) I discovered that the bug was ... mine. Turns out that the programmer thought 0=OK, !0=problem was too confusing. 0=false and 1=true right? So within the code that was hidden from the public interface he'd gone by his own conventions and had successful functions return 1 and failed functions return 0. When I had "fixed" the code to match convention, I broke it because I didn't realize that his returning 1 where I expected 0 was by intent. We lost three days. Lessons learned?
In Section
Meditations
|
|