Everyone makes mistakes
I had a problem with a piece of code last night. An apparent infinite loop without apparent cause. Because I’m working on in-development tools, though, I couldn’t even go to disassembly.
I sat and stared this morning at the offending code, knowing I must be missing something.
I finally went down the hall to grab Nathan (I like Nathan. He’s bright and hard working, and he laughs at my jokes. Good man.). He isn’t as experienced with C++ as I am, but my experience wasn’t helping me. Besides, it was a problem with a bloody for-loop.
Nathan sat down, complained about what I named the function, and then point out the error. Less than two minutes.
Can you see the error?
for (GenericParam* Param = StartOfListOfParams; Param; Param->GetNext())
I feel a little dumb, but vindicated for my position on code reviews, especially for my own code.
Edit 08/11/07 11:28am: Added a space.
It doesn’t look like you’re modifying the variable you’re testing. 🙂
Which, oddly enough, leads to slight performance issues, like never finishing. Good call! You get a gold smiley: 🙂
Hooray for gold similies! 🙂 🙂
Wait, I meant smilies, not similies, though a gold simile would also be awesome.
(What’s up with the gold smiley converter? Does it only do the first smiley in a paragraph? Smiley 1 :-), Smiley Two :-), Smiley Three :-).)
Err. Honestly? I didn’t know it was there at all. I’m going to have to look into it. Personally, I was looking for a gold star: (s) ?
❗