News for hackers. Stuff that matters.
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.
Re:Clear is better than clever [pdf] by apta on Monday May 06, 2019 @10:27AM (#19839697)
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...

Re:Clear is better than clever [pdf] by acdanger on Monday May 06, 2019 @10:56AM (#19839997)
TypeScript does and it’s one of my favorite features.
Re:Clear is better than clever [pdf] by apta on Monday May 06, 2019 @02:49PM (#19842521)
That's not really the same. That's badly designed and error prone.