"The company I recently started at creates products for military and law enforcement use," writes John, "naturally, fixing bugs is a high priority for us in the software department, despite the legacy code we have to work with."

"One day, when I was feeling especially masochistic, I thought I'd run our code through FxCop, a static analysis tool to see what came up. As I was scrolling through the infinity billion warnings, I noticed one about an enum I had never seen. So, I clicked on the warning to find this:"

public enum DebugId
{
    beta = 0,
    _1,
    R22,
    R456,

    NUM_IDS
};

John continues, "I didn't even realize that _1 was a valid identifier. Being the sensible developer that I am, I emailed the team that we refactor the code. A coworker replied back, I'll see your DebugId enum, and raise you Enum enum:"

enum Enum
{
    _1 = 1,
    _2,
    _3
};

"Bold play, another coworker responded, I wasn't planning on doing this, but you've left me know choice:"

enum Version
{
    _1 = 0,
    _2,
    
    NUM_VERSIONS,
    INVALID = -1
};

"I folded."

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