One early Monday morning, Francesco awoke to the sound of his alarm and, instead of slamming the snooze button down, he eagerly jumped out of bed. What else could he do on such a beautiful day? The sky was clear, the sun was shining, the birds were chirping, and he had day three of a brand new job to look forward to.

Having read so many new job horror stories here, I'm sure that most of us would approach the third day cautiously. Not Francesco, though. He did read the stories, but he made sure that he would be staying far away from The Legacy System long before he accepted the offer. His role was to work exclusively on the new C# / SQL Server 2005 system.

When he got into work, Francesco's manager asked him if he could do "a huge favor." The financial statements were being was rejecting because they did not include a key field and Antony, the programmer who developed that area of The Legacy System was on his honeymoon. Though Antony offered to help while he was away, his manager thought it'd be nice if someone else could do it. Francesco agreed; how hard could adding a single field to an Excel report be?

Francesco skimmed the development guide for The Legacy System and downloaded the Financial Reporting modules from the repository. Within them he found hundreds of thousands of lines of VB6 code with no indentation, no comments, meaningless naming, event-handlers calling other event-handlers, and eleven different projects named NewProject1 through NewProject17. I believe his exact words, upon seeing the code, were "Mamma Mia! Thats-a lots-a Spaghetti codes-a!"

Francesco spent a good hour or two trying to understand how the financial reports worked. He got absolutely nowhere. To give you an idea of what he was up against, following is a single function that sits on a Form called by several different modules (both UI and non-UI modules) ...

'ED: mySecondFunction_3, superfluousParameter
Public Function miaFunzioneSecondo_3(superfluoParametro As Variant)

  Dim antony, gruppo1, gruppo2, gruppo3 'ED: group
  antony = False

  gruppo1 = ScoprireGruppo1(m_idA) 'ED: FindGroup
  gruppo2 = ScoprireGruppo1(m_idB)
  gruppo3 = ScoprireGruppo2(m_idC)

  If (gruppo1 = gruppo3) Or (antony = True) Then
    miaFunzioneSecondo_3 = 1
  ElseIf (gruppo2 = gruppo3) Or (antony = True) Then
    miaFunzioneSecondo_3 = 3
  ElseIf (gruppo1 = gruppo2) Or (antony = True) Then
    miaFunzioneSecondo_3 = 2
  End If

End Function

Not wanting to give up just yet, Francesco thought he'd try a trace on the SQL Server. He spent several hours looking through database calls made from the application and stumbled up The Final Procedure. It seemed to be what the excel report used to pull data and, therefore, was where he could sneak that needed field in. But when he opened up the stored procedure code, he had a pretty good idea that his new friend Antony would be getting a call on his honeymoon ...

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