Jonathon recently got a new co-worker who is an enterprise systems developer, with an emphasis on enterprise. For an enterprise-level WTF, today’s code is short, but it packs itself up with everything it could do wrong.

using System;

namespace Business.Common.Services
{
    /// <summary>
    /// Guid service.
    /// </summary>
    public class GuidService : IGuidService
    {
        /// <summary>
        /// Initializes a new instance of the System.Guid structure.
        /// </summary>
        /// <returns>A new GUID object.</returns>
        public Guid NewGuid()
        {
            return Guid.NewGuid();
        }
    }
}

You might say, “where’s the WTF?” To which I reply, “everywhere!” The number of things this developer did to annoy me, in such a tiny space, is amazing.

Let’s start with the comments. Look at those comments. They provide no information. Why should they? The class provides no functionality, either! It’d be one thing if this service was an attempt to patch the fact that JavaScript has no native GUID functionality, but this code isn’t called by JavaScript- it’s consumed by other services in Business.Common .

Speaking of: Business.Common. Business.Common. For some reason, enterprise developers think this is an acceptable naming convention for their enterprise code. I suppose once you’ve adopted an n-tier architecture, it doesn’t really matter what’s in those tiers any more.

There’s a psychological effect where, if you say the same word over and over again, your brain stops thinking about it as a word and it just becomes a meaningless jumble of noise. Try saying this aloud: “The GuidService implements the IGuidService contract, and contains a method NewGuid which returns a Guid generated by the static NewGuid method on the Guid class.”


For the Pittsburgh readers, Remy's "Technical Storytelling" workshop is less than two weeks away, and seats are filling up fast. He's teamed up with master storyteller Kevin Allison. Learn how storytelling, combined with a technical perspective, can make you better at your job and advance your career. For a taste of what we'll discuss, check out these essays: Characters and Personification, Failing Upwards, Driving Change, and Detail Oriented.

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