An Introduction to Generics
<p><pre><code>    type Ordered interface {
        Integer|Float|~string
    }
</code></pre>
I kind of despise the keyword / syntax design choice of the tilde (~) signifying "anything where the underlying type is e.g. a string".<p>Usually a ~ signifies a bitwise-NOT operation*.<p>It reminds me of something more like a Ruby design mentality, where optimizing for code terseness is chosen.  The nice thing about the crazy syntax in Ryby is that at least the chosen symbol is unique and doesn't conflict with meaning in other similar languages.<p>I realize the context where it's used is not part of the logic-execution pipeline, but it still forces me to contort my mind and special case this concept, and map it against what is effectively a namespace collision between Go and other C-style languages.<p>Naturally it's too late for Go (Generics are fully baked and released), but would have been nice to land with something more intuitive or at least less collision-prone, even if only to avoid the ambiguity.<p>Inevitably, the introduction of generics means increased opportunities for new kinds of complexity, and this choice needlessly increases the cognitive load when trying to read and reason about a go program.<p>I know it's the the end of the world, but I find it somewhat of a bummer for a technology I was previously so enthusiastic about.<p><i>* edit: Thank you Jtsummers for the correction- it is bitwise-NOT, I had mistakenly written bitwise-OR.</i>