1. 12
  1.  

  2. 4

    This is a great article, and very “fair.” A lot of interesting points and useful things to remember as a “gopher.” I especially liked the hacky Sum types in Go link.

    1. 1

      “Generics” are a large concept, which includes at least “generic data structures” and “generic algorithms”. Go lacks the former, but interfaces are the latter. So, “Go doesn’t have generics” is only half true.

      I don’t think the author understands what people mean when they say “Generics”. I assume he confuses “polymorphism” with “Generics” here.

      Both the good and the bad can be seen in the standard library sort module, which provides a generic sorting algorithm to types that implement an interface that provides the operations the sort algorithm needs.

      I don’t think this is a honest example. The sorting code is one of the very few lucky cases which allows enough spooky action at a distance to never look at the actual element. It doesn’t solve the lack of expressiveness in 99% of the cases.