I had to share this – Having written stuff myself where I felt dirty for coding like that I understand the issue. Read the whole thing.
There is a large comment at the top of a particular student’s assignment. Actually, it isn’t a comment so much as it is an apology… the code we are about to see is so bad, the programmer felt remorse in advance for John Connor:
/** To the grader:
I realize that by now, you are in either a complete state of shock or disgust at the length of my program. Perhaps even both. To this, I deeply apologize that I can offer no consolation. I, myself, am quite ashamed of this program, and can speak no more good of this massive blob of text other than that it *should* work.
If it doesn’t, then please feel free to dock as many points as necessary to vent your frustration that you, of all TAs, chose the unlucky pile that contained my program, for I too would be quite vindictive while grading.
I also realize that this program is a messy compilation of inefficient coding, and perhaps even stands as something blasphemous in your eyes. Coming midterms forced me to write the program as is because this format required the least amount of thinking as well as the least amount of time. Therefore, I only ask one thing of you: Be gentle.
I once worked for a company that did contract programming and we were tasked with writing a self-test system for mechanics that worked on cars for a major Japanese manufacturer. The aim was that the the mechanics would study and then use the program to take a certification test. The original programmer went missing and the customer came to us with less than 72 hours before they had to ship.
I started on the morning after meeting with the customer and then about 80 hours later, at 0300, I shipped the product. It worked (unlike the code referenced above) but it was such an abomination that I didn’t even add my name to the comments section.
Fortunately the customer liked the result so much they asked us to write the next version for them so I was able to get enough time to actually build it in C++, create a supporting class library and actually improve the overall performance. I put my name on that one….