if(Integer = 1)
{
// Whoops, this always runs.
}
So why are we taught to put the variable on the left and the constant on the right? If we switched it around, we would NEVER have that error ever again.
if(1 = Integer)
{
// Compiler chucks an error.
}
So is there a reason why we're taught the first way, which is error prone and not the second way, which prevents the bug / error from happening?