TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Go Enums Suck

2 pointsby mikecarltonabout 1 year ago

2 comments

quantifiedabout 1 year ago
I&#x27;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.<p>When Oracle&#x27;s patent on enums as objects expires, sufficiently motivated language designers can start to incorporate them. I doubt golang will get them.
0xjnmlabout 1 year ago
Go enums cannot suck because Go has no enum types, full stop.