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

Go is focused on the distributed systems domain though. It's fine, even desirable, to have languages focused on particular domains, that make design decisions based on the constraints of the domain. In this domain, closed enums are footguns with costly consequences if you get it wrong.



As someone that doesn't work in that domain, could you give a short example?


You push Thrift clients out into the world expecting to a certain API field to be typed according to a 3-element enum. You add a 4th element to support a new feature in a new client. If you ever accidentally serve this 4th element to an old client, it will crash on deserialization. Bonus points if the client is old enough that it's not part of your testing regime anymore.




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

Search: