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

> You could put 999 into a variable that's supposed to hold the outside temperature

I've never done this, but you could also define types for stuff like this. type: PositiveInteger, or type: BoundedTemperature that would only ever hold valid values.

Or one thing where it might come in handy would be when dealing with user/potentially malicious input - SanitizedString etc.



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

Search: