DEV Community

loading...

Discussion on: YoDa Expression!

Collapse
tharindadilshan profile image
Tharinda Dilshan Piyadasa

Aren't they both the same?

Collapse
kais_blog profile image
Kai

More or less. Usually the constant portion of a conditional statement is placed on the right side. Yoda conditions reverse this typical order. This should avoid certain errors. Yet, their use is controversial.

Collapse
slimdestro profile image
D\sTro Author

Same ofcourse but they are in place to avoid those million dollar bug NASA scientists creates years ago

Collapse
dansilcox profile image
Dan Silcox

Wow really, didn't know about that million dollar bug! Maybe I will convert to start using them :D :D