Tuesday, August 18, 2009

Shoot Yourself in the Foot.Net

While C# is good about not letting me do foolish assignments in conditionals, it is still possible to shoot yourself in the foot.

This time, I used a foolish assignment when I meant to do addition:

this.failureSuccessfullyRecovered = (frame[offset = 1] != 0);

That line of code compiles just fine. That will teach me to use a keyboard with the plus sign on the = key. I think I’ll switch to a German Keyboard. That way I can foolishly do bitwise inversion, instead of addition. That should be even more fun!