re: Why using Yoda conditions you should probably not be VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Linters That's all we need. Linters can easily catch problems like this one. And many others, of course. So let's forget about Yoda conditions, l...
 

Or languages designed with code safety in mind, which prohibit these kinds of expressions.

For example in Swift (and other type safe programming languages), the following expression results in a compile time error:

if name = "Luke Skywalker" { // error: use of '=' in a boolean context, did you mean '=='?
    // ...
}
 
code of conduct - report abuse