When it comes to bad code, everybody thinks they’re a comedian. Heck, look at us! Stupid programmer jokes are a game everyone can play, though, so let’s enjoy an evening at the Improv with some code comedians.

Brian sends us this enum, which I’m sure was very funny back in 2007.

Public Enum TouchMessageBoxResponse
       [Ok]
       [Cancel]
       [Yes]
       [No]
       [DontTazeMeBro]
End Enum

Brian claims that [DontTazeMeBro] is never returned, but if it were, I’m certain it would cause the application to Rickroll the user. Or taze them, I suppose.

Sometimes, a developer just has to puzzle over the application logic. Jeremy’s predecessor had some questions about this block of code:

public function Sanitize($string){
    return null;
    #wtf is this doing here. That's a hell of a sanitization lol.
}

Not all jokes in code are intentional. Tony sends us this code block, from Polish developers. He assures us that this is an innocent misuse of English.

//Don't expect much work to get done after this event is triggered
CometWorker.OnFirstJoint += new FirstJointObjects(CometWorker_OnFirstJoint)

Hopefully that’s not the same Tony that worked in Gavin’s office, writing Excel macros.

On Error GoTo holysheet
'… snip
holysheet:
  MsgBox "Enter a sheet name Tony", vbOkOnly, "You sheethead, you bungled."

And finally, some developers make sure the joke is on those that come after them. David found this.

'Saw a lot of instances where the same box_num would get used elsewhere
'which caused this screen to show more units than were actually in this batch
'This is probably a serious issue
'I'll let you guys discover it after I'm gone. ;D
'Love,
'Martin
strSql = "SELECT …"