It wasn't easy for Ben to find a snippet from the monstrous codebase he maintains that fully demonstrates the Whiskey-Tango-Foxtrot rating it deserves. Sure, there were calls to the data layer from the UI, and, yeah, there was at least one method called DoSomething() that no one dared to modify. But those are all de rigueur at The Daily WTF. He needed something... more. Something worse. Something layered, like an onion, and twice as eye-watering.

He needed this:

Application.DoEvents()

'If PrivateApplication.Globals.isInXXXXXMode And gstrAirlineCode = "XXX" Then 
'    Utils.WriteMsg("Loading Results...")
'End If

' NOTE: do NOT remove the word 'Complete' from the message below.
' It is used as a signal (to Utils.QStatusTimerProcess) to display the editor
' and hide the main screen and dialog box
'If PrivateApplication.Globals.isInXXXXXMode And gstrAirlineCode = "XXX" Then 
'    Utils.WriteMsg("Loading Results Complete. Please Wait...")
'End If

'JCXL: if XXXXX, notify XXX that the XXXXX optimization is complete
' *** NOTE: do NOT remove the word 'Complete' from the message below. 
' It is used as a signal (to Utils.QStatusTimerProcess) to display the editor
' and hide the main screen and dialog box
If gstrAirlineCode = "XXX" And Globals.isInXXXXXMode Then
    Utils.WriteMsg("XXXXX Optimization Complete.") 
End If

To enumerate, this code:

  1. Suspends UI redraw rather than use asynchronous UI and callbacks
  2. Uses a custom logging framework with no notion of log levels
  3. Is riddled with Hungarian Notation (not to mention the global variables it's used to indicate)
  4. Comments as a form of version control (what do you think the "C" in "CVS" stands for, Ben?)
  5. Best of all, passing control information via a poorly-named function that updates the text in a UI element. After all, why have separate signals for the program and for the user? Efficiency!

Don't worry, Ben: we won't remove the word "Complete" from "This is a Complete WTF", either.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!