Go is an 80/20 language

70 points by carlana


typesanitizer

As someone who is responsible for 100K+ SLOC out of a 1M+ Go codebase which is full of:

  1. Overuse of primitive types instead of domain specific types, making it unclear what invariants hold at a given point
  2. Unclear type states/transitions between these states (which are captured in some languages using sum types)
  3. A mix of ad-hoc iterator and pagination patterns
  4. Overuse of maps and slices instead of sets, ordered sets/maps and other composite collections.
  5. General lack of docs around invariants (which are often captured in other languages using assertions, which Go refuses to add), such as how specific parts of the code use pointers (mutation? structural sharing? optionality?)

I feel like the author must surely be having a very different situation at work to have written statements such as “[the absence of generics] served Go well for over a decade.”

I’m literally in the process of migrating our testing assertions to a small custom library which diagnoses more type errors statically, using generics.

Go may be an 80/20 language, but one needs to ask how many areas of a sufficiently large codebase are going to fall in the “20” bucket.