Archive for the ‘Programming’ Category

Double Negatives

Tuesday, July 22nd, 2008

I’m cleaning up the some craptastic code and I come across this gem.

    if (isRegistered)
    {
        //not registered
        message.MessageDefinition = MessageDefinitions.Confirmation;
    }
    else
    {
        //registered before (email exists in the database)
        message.MessageDefinition = MessageDefinitions.ConfirmationExistingUser;
    }

Fun times! I wonder why this code is buggy and constantly breaks.


Kurt Koller aka Minimalist360
LinkedIn . Facebook . Xbox.com