Double Negatives
Tuesday, July 22nd, 2008I’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.
