Frank is a contractor. His company has been brought in to refactor some back-end web services that were all developed by a single person, "Nicholas," over the course of a couple of years.

From the front lines,

Having looked at it, we've decided that a complete rewrite is the only solution. Here's just one example of what can only be called "paid by the line" programming.

  private int GetMessage( int selected )
  {
      int index = 0;

      // Get the Message
      switch( selected )
      {

          case 0:
              index = 0;
              break;

          case 1:
              index = 1;
              break;

          case 2:
              index = 2;
              break;

          case 3:
              index = 3;
              break;

      }

      return index;
  }

According to the submission, we can "only imagine what other fun things this codebase does" but I can't think of anything. Instead, the challenge of the day is to rewrite this function as many different ways as possible. Keep in mind, you're not being paid by the line.

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