We have a process where every commit gets code reviewed and graded. I've had some good ones come my way and these were all rated as 'F' in the American grading scale. These are all real, so I hope someone gets a chuckle out of this. Keep in mind that we are a purely C++ shop.
void SetX(int iNewX) { iX = iNewX; }
Comment: int iNewX needs to be const.
float fMinDistance = 1.0e10f; // Some arbitrary large distance
Comment: This value is too large for a float. Use a double.
char szFilename[STR_LENGTH];
Comment: szFilename needs to be szFileName!!!!! (note: !!!!! is not exaggerated)
glPushMatrix();
...
glPopMatrix();
Comment: I don't know anything about OpenGL, but even I can see this is stupid!
// Foo is a POD type
struct Foo {
Foo() : x(0), y(0) {}
...
Comment: POD types can't be structs.
Comment: What does this even mean?
OK, I have paraphrased some of the comments, but they are real. Feel free to troll this thread for your own code review horrors.