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

The issue with Enums is that the "unnecessary" feature means that people have to encode the behaviour with things that aren't suitable. E.g. creating a new type that's a thin wrapper over string or integer means it can be set as some non-valid value, even without some sort of explicit cast that says "I know I'm doing something that might fail". I don't see that that is an improvement over any other language. It's not simpler because, as people have shown by the examples trying to prove that you don't need it, they don't have all the (necessary) behaviour that enums do to prevent this sort of problem.


There are some useful features that Go really should add, and enums might be one of them, but lacking a useful feature doesn't mean its not well designed.

The results are in for Go. It's already one of the most successful programming languages in history any way you measure it.

Of course Go should continue to improve and add features where the value outweighs the increased complexity. That's how it eventually got generic functions and other features.




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

Search: