News for hackers. Stuff that matters.
Re:Yoda Conditions by marcosdumay on Friday February 17, 2017 @12:22PM (#13669948)
Well, languages can either use another assignment operator or have type system that wont check that kind of statement. Both ways fix it.

In fact, it's not easy to have this kind of bug on your language. C just has it because people wanted to write stuff like `int a = b = 0`.

Re:Yoda Conditions by jordigh on Friday February 17, 2017 @03:28PM (#13671427)
`int a <- b <- 0` or `int a := b := 0` would have worked just as well.

Programmers using equals for assignment is a bit of a misunderstanding of what the mathematical idiom "let x = 5" means. The assignment is signaled by "let", not by "=". In fact, several programming languages use "let" exactly for this purpose too.