Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That particular version opens the way for massive typo footguns and results in the insanity of defensive programming patterns like yoda expressions.


Well, 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.


But now I see your point. A language must not give beginners an option to shoot themselves in the foot.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: