2 ms·
> Instead of using <> like every other language (okay, I meant Java and C++) with generics Using angle brackets for generics is really annoying when it comes t
by munificent 8y ago
> Instead of using <> like every other language (okay, I meant Java and C++) with generics
Using angle brackets for generics is really annoying when it comes to the grammar of the language. There are nasty edge cases around things like interpreting `>>` as a shift operator in some places but closing two type argument lists in others. There are occasional ambiguities like:
foo ( a < b , c > - d)
Is this "foo(a < b, c > -d)" or "foo(a<b,c> - d)"?
Angle brackets are (alas) more familiar, but they aren't simple. Go seems to place a premium on the latter over the former.