Why using Yoda conditions you should probably not be
Aug 8, 2017 · 1 min read
Grégoire Paris wrote down his opinion on why he dislikes Yoda conditions.
So how do Yoda conditions work? Well it is basically a knee-jerk reaction you have to develop: whenever you write a condition, put the operand that cannot be assigned on the left. This should give you an error message if you make an assignment when you actually meant to make a comparison.
Personally, I’m not a big fan of Yoda conditions either. My feeling is the the cost of decreased readability is just too high for the small value that Yoda conditions bring to the table.
