
Originally Posted by
softtouch
Yes, I saw this too, quiet weird in my opinion...
Make more sense for me when if (mymoney == 100 pesos) then if (100pesos == mymoney)
Yepp, makes more sense too. "If my money is equal to 100 pesos" sounds more natural than "If 100 pesos is equal to my money." Naturally, people's mileage will vary, but I personally find that doing if (x == constant) leads to fewer bugs because I only need to remember that the left operand is usually the variable that I need to focus on.
Inside my brain, all equality operations are reduced to "does the left operand, which is always changing, have a value that is the same as the right operand
now?" A constant doesn't change, so I need to create a special case inside my brain if I put the constant on the left.
I like to keep my mental models generic, simple, and direct to the point. Lesser cognitive load on my brain frees it to concentrate on more important tasks...