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

https://en.wikipedia.org/wiki/Yoda_conditions

Works especially well in languages that can make assignments in if statements, e.g:

if foo = 42 { }



Thank you, I was unaware of this label. Quite descriptive.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: