Dan Duda got a call from a client that was getting more and more frustrated with their custom-built software. Gwen was an employee at the client who was responsible for forwarding emails from the system to others in her group. Unfortunately, she left, requiring someone else to contstantly check her email box. The client was pretty adamant that Dan's predecessor (who developed the system) constantly told them that the system was designed to send an email to the correct employee, but that they need to configure it to do that.

After a bit of research, Dan tracked down the problem. Now, ignoring for the moment that this was written in VB well before databases, flat files, and every other disk-storage method was invented, note why the method always bothered poor Gwen ...

Function DecodeAgentEmail( agCode As String )
  
  Dim agEmail As String

  Select Case UCase(agCode)
    Case "orbst"
      agEmail = "[email protected]"
    Case "jen"
      agEmail = "[email protected]"

    'ED: Snip ...

    Case "gwen"
      agEmail = "[email protected]"
    Case Else
      agEmail = "[email protected]"
  End Select

  DecodeAgentEmail = agEmail

End Function

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