When writing up a Code SOD, a big part of the goal is to provide context for the bad code. Why is it bad, what would be better,, etc. In other words, we need to… ShowContext. Vasco O has exactly the method for that.

protected string ShowContext(string context)
{
    if (!string.IsNullOrEmpty(context))
    {
        return string.Format("{0}", context);
    }
    else
    {
        return string.Empty;
    }
}

If the context string has content, return a new string, via string.Format which is exactly the same as the input. If it’s null or empty, return an empty string. This does at least mean that the function isn’t entirely useless- it guarantees no nulls will get returned.

This method was called everywhere, but it did nothing. Vasco removed it.

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