“Our codebase is a bit... backwards, to say the least,” writes Aaron Silver, “things that should go up don’t go up or down... instead, they’re painted orange .”

“The postProcessAddress address method is a good example of all of this.”


string[] months =
{
 "Jan", "Feb", "Mar", 
 "Apr", "May", "Jun", 
 "Jul", "Aug", "Sep", 
 "Oct", "Nov", "Dec"
};

if (processingClient.StreetAddress != null
  && string.IsNullOrEmpty(processingClient.StreetAddress.Line1))
{
  for (String month : months)
  {
  if (processingClient.StreetAddress.Line1 != null
    && processingClient.StreetAddress.Line1.Contains(month))
  {
    writeError(processingClient,
      errorList,
      "Street address line 1 is in date format ("
        + processingClient.StreetAddress.Line1 + ").");
  }
  if (processingClient.StreetAddress.Line2 != null
    && processingClient.StreetAddress.Line2.Contains(month))
  {
    writeError(processingClient,
      errorList,
      "Street address line 2 is in date format ("
        + processingClient.StreetAddress.Line2 + ").");
  }
  if (processingClient.StreetAddress.Line3 != null
    && processingClient.StreetAddress.Line3.Contains(month))
  {
    writeError(processingClient,
      errorList,
      "Street address line 3 is in date format ("
        + processingClient.StreetAddress.Line3 + ").");
  }
  }
}

Aaron adds, Aaron adds, “I’m not exactly sure what thought process lead to this, but the powers that be aren’t too keen about changing it, leaving our end users to adding random hyphens and spaces for those unfortunate enough to live on ‘October Road’.”

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