3 ms·
That particular version opens the way for massive typo footguns and results in the insanity of defensive programming patterns like yoda expressions.
by hyperion2010 7y ago
That particular version opens the way for massive typo footguns and results in the insanity of defensive programming patterns like yoda expressions.
- vkaku 7y agoWell, for those used to those expressions, it definitely helps write that code with one line lesser (assignment by itself). Most likely, the assigned value is stored for use in one of the conditionals, so it really doesn't change any of that. Let's also understand that we are dealing with a decorated assignment here, so a = (b = c) should be no different from evaluating (b = c). It's not complicated, the way I at least look at it.
- vkaku 7y agoBut now I see your point. A language must not give beginners an option to shoot themselves in the foot.