A very common error in C, especially for the beginner, is to do an assignment where a test for equality was wanted.
What is done is:
if( x = 0xBE ) /* Error in any general case */
when what is wanted was:
if( x == 0xBE )
A very simple way to prevent this is to always place the constant on the left:
if( 0xEF == x )
will do what is wanted, while:
if( 0xEF = x )
will refuse to compile at all, because it is impossible to assign a variable to a constant in C.
Best way to debug a program is to not put the bug in the program in the first place, so have the compiler tell you when you have made this error.
I've heard some silly arguments against this simple bug proofing technique over the years, and no rational ones.