3 ms·
Man this post is a rollercoaster. First half of the post I was absolutely starstruck by how amazing go is(I haven't had time to play with it myself yet), and wa
by amarant 9mo ago
Man this post is a rollercoaster. First half of the post I was absolutely starstruck by how amazing go is(I haven't had time to play with it myself yet), and was making mental note after mental note to try it out asap!
Then I got to the second half of the post, with the things he didn't like about go.
No enums? Wtf? Not having sum types is a lesser evil imo, it places you in the mediocre, but mediocre is mostly ok so that's kinda fine. But no enums? We're stuck with magic numbers? Hell naw, we banished that demon in the nineties, I ain't signing up to bring it back!
- benrazdev 9mo ago>No enums? [...] We're stuck with magic numbers? In go you don't strictly need magic numbers because you can define constants: type Status int const ( IoProblem Status = iota // we start at zero and go down from there JsonParse ... ) The problem is that there is no exhaustiveness with these constant groups. The type Number is not a closed set of just IoProblem and JsonParse like an enum in C. It is just an int.