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

It is Pascal that does not truly support enums, if such a thing can be said. It has them, technically, but the language is not designed to meaningfully make use of them. The poor man's sum types abstraction works to hide their existence.

While sum types first appeared in Algol 68, there were some unsolved issues at the time. So Pascal came along with its half-assed 'sum types' as a tradeoff between the benefits of true sum types and what was tenable given the constraints of the time. But there is no reason for any language created in the last 50 years to follow in that path. We've long solved the problems they had.

Go benefits from enums because it has a very basic type system.

Trying to improve on enums by extending the type system, along the lines of what Pascal did or otherwise, is hilariously nonsensical. If you are going to build a better type system, just get rid of enums completely. You don't need them.

Sure, it was a reasonable compromise in 1970, but it is not 1970 anymore.




Go still hasn't catched up with either 1970 nor 1976, no matter how many words you happen to write.

An idiotic hack, remains an idiotic hack.


Are you expecting this straw man that you keep wanting to talk with to come to life and follow you down a yellow brick road, or what?

Yes, enums are a hack, forever and always. Nobody disputes this.




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

Search: