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

You're right that the language doesn't protect you here.

One easy way to prevent these sorts of errors is to always return default literals with errors (in the same spirit of "value == var" from c to prevent accidental assignment).



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

Search: