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

This was an enum (class) member, so I didn’t really have one to spare that wouldn’t just hide the issue under the rug.


Ah, that sucks. I don't think there's a solution to that apart from just adding an "Invalid" field to every enum class and initialising to that, but checking for that (asserting not invalid) adds ugly boilerplate to every usage of every enum.


Right. Type systems generally don’t like having invalid states at any point, because after all that’s kind of what they do :)




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

Search: