Skip to content

Comment on Go Enums Suck

Comments

I'm still acquiring the finer points of golang development. Why would the enum need to be based on an integer? Why not just make it a string? The type-safety of using any old string as an Operation value remains an issue. The other conversion issues seem to more or less disappear.

When Oracle's patent on enums as objects expires, sufficiently motivated language designers can start to incorporate them. I doubt golang will get them.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.