[HN Gopher] Goenums: Type Safe Enum Generator for Go
___________________________________________________________________
Goenums: Type Safe Enum Generator for Go
Author : PaulHoule
Score : 11 points
Date : 2025-04-26 15:26 UTC (7 hours ago)
(HTM) web link (github.com)
(TXT) w3m dump (github.com)
| lionkor wrote:
| Wait, Go doesn't have enums? Why not?
| HideousKojima wrote:
| >The key point here is our programmers are Googlers, they're
| not researchers. They're typically, fairly young, fresh out of
| school, probably learned Java, maybe learned C or C++, probably
| learned Python. They're not capable of understanding a
| brilliant language but we want to use them to build good
| software. So, the language that we give them has to be easy for
| them to understand and easy to adopt.
|
| - Rob Pike
| nsingh2 wrote:
| Go seems like such a strange language to me. I like its
| simplicity, but it's strange that they compromised and added
| generics to the language but balk at basic things like sum
| types and pattern matching. Their simplicity design philosophy
| seems a bit incoherent.
| o11c wrote:
| To be fair, enums represent a different and incompatible
| concept in _every_ language I know.
|
| It's possible to support everybody's needs in a single
| language, but I'm not aware of any language that has done it
| yet.
| bsaul wrote:
| "enums represent a different and incompatible concept in
| every language I know."
|
| Enums has always felt very natural in every modern languages
| i've tried (swift and rust, for example), even with
| associated values. The underlying "sum type" concept also is
| very intuitive, and seems very complementary to structs for
| example.
|
| Can you expand a bit on what you mean ?
___________________________________________________________________
(page generated 2025-04-26 23:00 UTC)