Vote UpVote

“Yoda Conditions” (from: stackoverflow – New programming jargon you coined?)

The Wiert Corner – 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 ...
Favorite? Off-Topic? jpluimers @ 2010-05-25 06:00


Visits: 665
Votes: 2
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Charles Ardour
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)