3 ms·
Those 5 minutes add up, and in my experience Go newcomers get confused about iota (and the frankly hideous way enums have to be written in general) quite a lot.
by HL33tibCe7 4y ago
Those 5 minutes add up, and in my experience Go newcomers get confused about iota (and the frankly hideous way enums have to be written in general) quite a lot. One of Go’s best aspects is its readability, so it’s unfortunate that it misses the mark here IMO.
- politician 4y agoI think the most distinct enum types I've had in a project was maybe 20? At some point we need to realize that this is bikeshedding.
- Tozen 4y agoI'm really not sure why Go decided against a distinct enum type, instead of repurposing const and getting odd with iota. It comes off as a kind of unnecessary stubbornness, for what should have been easy to add to the language early on. If you look at one of the Go inspired languages, such as Vlang (that has the enum type), it really should not have become an issue. Now, with Go being advanced in age, it comes off as just odd. It becomes reminiscent of the generics debate, where there was such long denial of it being necessary, then suddenly it is understood it should have been done earlier.