12

I've seen a lot of shitty code. REALLY shitty code...but this. Calling this shitty would be a compliment, so I'm not sure what to call it. The following is copied straight from his source code, which I'm tasked with finding a production logic bug in. The original composer of this masterpiece of one-line clusterfucks is no longer with the company of course, so his pile of shit is now my problem. The program is littered with stuff like this.

if(((FrontLowerLeft.X > tempPack.FrontLowerLeft.X && FrontLowerLeft.X < tempPack.FrontLowerLeft.X + tempPack.Dimensions.Width) || (FrontLowerLeft.X + Dimensions.Width > tempPack.FrontLowerLeft.X && FrontLowerLeft.X + Dimensions.Width < tempPack.FrontLowerLeft.X + tempPack.Dimensions.Width) || (tempPack.FrontLowerLeft.X > FrontLowerLeft.X && tempPack.FrontLowerLeft.X < FrontLowerLeft.X + Dimensions.Width) || (tempPack.FrontLowerLeft.X + tempPack.Dimensions.Width > FrontLowerLeft.X && tempPack.FrontLowerLeft.X + tempPack.Dimensions.Width < FrontLowerLeft.X + Dimensions.Width) || (tempPack.FrontLowerLeft.X == FrontLowerLeft.X && tempPack.Dimensions.Width == Dimensions.Width)) && ((FrontLowerLeft.Y > tempPack.FrontLowerLeft.Y && FrontLowerLeft.Y < tempPack.FrontLowerLeft.Y + tempPack.Dimensions.Height) || (FrontLowerLeft.Y + Dimensions.Height > tempPack.FrontLowerLeft.Y && FrontLowerLeft.Y + Dimensions.Height < tempPack.FrontLowerLeft.Y + tempPack.Dimensions.Height) || (tempPack.FrontLowerLeft.Y > FrontLowerLeft.Y && tempPack.FrontLowerLeft.Y < FrontLowerLeft.Y + Dimensions.Height) || (tempPack.FrontLowerLeft.Y + tempPack.Dimensions.Height > FrontLowerLeft.Y && tempPack.FrontLowerLeft.Y + tempPack.Dimensions.Height < FrontLowerLeft.Y + Dimensions.Height) || (tempPack.FrontLowerLeft.Y == FrontLowerLeft.Y && tempPack.Dimensions.Height == Dimensions.Height)) && ((FrontLowerLeft.Z > tempPack.FrontLowerLeft.Z && FrontLowerLeft.Z < tempPack.FrontLowerLeft.Z + tempPack.Dimensions.Depth) || (FrontLowerLeft.Z + Dimensions.Depth > tempPack.FrontLowerLeft.Z && FrontLowerLeft.Z + Dimensions.Depth < tempPack.FrontLowerLeft.Z + tempPack.Dimensions.Depth) || (tempPack.FrontLowerLeft.Z > FrontLowerLeft.Z && tempPack.FrontLowerLeft.Z < FrontLowerLeft.Z + Dimensions.Depth) || (tempPack.FrontLowerLeft.Z + tempPack.Dimensions.Depth > FrontLowerLeft.Z && tempPack.FrontLowerLeft.Z + tempPack.Dimensions.Depth < FrontLowerLeft.Z + Dimensions.Depth) || (tempPack.FrontLowerLeft.Z == FrontLowerLeft.Z && tempPack.Dimensions.Depth == Dimensions.Depth)))
{
//code that did stuff
//removed for "clarity"
}

Comments
Add Comment