A few months back, Joachim Roppert had to go to the hospital for a few weeks. Unfortunately, he was in the middle of a "mission-critical" development project, so his company decided to bring on a short-term consultant to keep the project alive. They were a bit concerned about the quality of work the consultant might provide and figured that the best consultant probably charged the second highest rate. So, they hired him.

Surprisingly, the "second highest" formula didn't work out so well. Aside from setting the project back even further when Joachim returned, he seemed to have a very interesting interpretation of the coding guidelines his company requested use ..

Standard:
Initialize all variables at the point of declaration; null is prefered for reference types and strings while min- and max- values are preferred for value types, e.g. DateTime.MinValue.

Code:

string docOwnerUsername = "null";

Standard:
Use speaking variable names. A variables name should identify what kind of value variable represents and how the variable is used.

Code: (all from a single 500+ line function added)

docOwnerUsername = "traslations.xml";

...

docOwnerUsername = DateTime.Now.ToString();

...

docOwnerUsername = "true";

The consultant also seemed to have a thing for variety; although most of us would use "someString = anotherString" to assign a string value, the consultant had used four different techniques for assigning strings, all used in random places ...

someString = anotherString.Clone();

...

someString = string.Copy(anotherString);

...

someString = (string)anotherString;

...

someString = anotherString.ToString().ToString();
[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!