Hacker News new | past | comments | ask | show | jobs | submit login

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 Spring batch! Applications are open till Feb 11.

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

Search: