News for hackers. Stuff that matters.
Re:The Smallest Thing in Go by iterance on Sunday December 08, 2024 @11:59PM (#42363186)
The answer is supposed to be "iota," but imo iota is not really remarkable by itself. I mean it's nice, it's not pointless (though arguably it isn't parsimonious), but you could just type in the numbers. It's not saving you that much.

What I'd really want is something that clearly differentiates enums where the values do matter and the values don't matter, which iota comes so close to being, but then you can do math with it. To use their example, it doesn't really matter if "electron" is 4 or 8 or whatever, but I'm sure as hell not going to assign 5 to January.

There are no comments on this comment yet.