|
|
|
|
|
by xargon7
3260 days ago
|
|
The complexity from generics isn't from the conceptual standpoint, it's from the resulting code standpoint... for the same reason that the ternary ?: operator is "too complex": it's really easy to say that `foo := cond ? 1 : 0` is better than the if/else alternative, but `foo := (a > (b.Active() ? Compare(b, a) : useDefault() ? DEFAULT : panic()) ? "worked" : "failed"` is a mess waiting to happen. Same with generics. It's easy to point to simple examples. It hard to ensure that terrible metaprogramming monstrosities don't arise. It's possible to write bad code with go as it is, but it's actually difficult to make such bad code inscrutable. |
|