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

Making an analogy between a car with a bowling alley being as useful as having the ability to know you have a valid selection from a list of choices does not exactly reflect well on your priorities.



I take it you use enums fairly regularly?

I don't really use them that much, so they're superfluous for the most part. Sort of like a car having a bowling alley. I mean, I'll take them if it doesn't complicate the language or impact compile time, but if they're doing to do either of those, I'd rather just leave them.

Adding default branches into the couple of switch statements and a couple spots for custom json parsing that return errors for values outside the set doesn't seem like a bad tradeoff.


It's not optimal but one can still implement enums in userland using struct and methods returning a comparable unexported type.




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

Search: