Don’t forget to bring your Towel today…
–jeroen
Posted by jpluimers on 2010/05/25
Posted in .NET, About, Delphi, Development, Opinions, Personal, Software Development | 1 Comment »
Posted by jpluimers on 2010/05/25
Having done quite a bit of C and C++ work in the past, I often still use “Yoda Conditions”, especially in environments where you have both = and == as an operator.
So, in a boolean expression, I often put the constant to test in front of the test.
I recently learned at stackoverflow that quite a few people call these “Yoda Conditions”:
“Yoda Conditions”— the act of using if(constant == variable) instead of if(variable == constant), like if(4 == foo). Because it’s like saying “if blue is the sky” or “if tall is the man”.
Thanks to dreamlax for helping me find that.
This is a problem in languages that have both the = and == operators, and the result of an assignment itself is also a value (i.e. allowing a = b = true). Read the rest of this entry »
Posted in .NET, C#, Delphi, Development, Java, Ruby, Software Development, Web Development | 22 Comments »