this post was submitted on 27 Feb 2024
15 points (85.7% liked)

Golang

2194 readers
1 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 8 months ago* (last edited 8 months ago) (2 children)

@bugsmith Go enums suck because there are no enums in go, thanks for the clickbait. There are packages implementing them and an ongoing proposal discussion: https://github.com/golang/go/issues/28987

[–] bugsmith 3 points 8 months ago (1 children)

I disagree that it's clickbait. Go does not have enums, that is undeniable. But we often encounter problems in software development where enums are an effective solution - arguably the right solution a lot of the time. Even if enums are not a language feature of Go, many of us are (rightly or wrongly) doing programming cartwheels to implement them ourselves. So I think an article discussing how one can roll enums or at least enum like behaviour in the language is relevant, and the awkwardness of that experience is captured in the blog's title.

[–] [email protected] 1 points 8 months ago

@bugsmith Title is making a strong qualitative statement about a feature completely absent from the language. Worse than that, it is not covered by the content, which is about “Look how I hand-roll a poor man’s enum in go”.

This kind of strong title not covered by content I call “clickbait” and will always do.