a programmer at a laptop panicking over having a substantial amount of code abstract in the background

Else Is Evil

Take the following Go code as an example: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 package main type CodeType int const ( CodeA CodeType = iota + 10 CodeB ) func calculateCodes(codeType CodeType) int { var value int if codeType == CodeA { value = 10 } else { value = 20 } return value } func main() { fmt....

May 30, 2023 · 3 min · 577 words · Matthew Hartstonge