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

Using "if myvar is 0" exposes you to more implementation dependent behavior than "if myvar".


I agree, but it's still more explicit in terms of what process is used to evaluate the content of myvar and what it should match, especially in a context where you're expecting a numeric value rather than a boolean.




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: