Re:Clear is better than clever [pdf]
by 5trokerac3 on Monday May 06, 2019 @09:37AM
(#19839254)
If you're running through that many conditionals, it may be clearer to work them into a state enum that you can use with a switch.
[ Parent
| on HN ]
Golang doesn't have enums
Re:Clear is better than clever [pdf]
by 5trokerac3 on Monday May 06, 2019 @10:39AM
(#19839795)
Neither does JS, but there are ways to accomplish the same thing[0].
[0] https://stackoverflow.com/questions/14426366/what-is-an-idio...
TypeScript does and it’s one of my favorite features.