7 ms·
This guidance is specific and explicitly calls out some dos and don'ts. Your comment implies that there is one flavor of utilizing generics that applies across
by B-Con 4y ago
This guidance is specific and explicitly calls out some dos and don'ts. Your comment implies that there is one flavor of utilizing generics that applies across all languages and that is most certainly not true.
Other languages don't tend to be as prescriptive about best practice as Go is trying to be here. Just because it's syntactically valid doesn't mean you should type it often. (Most language standard libraries are several contrasting styles shoehorned together. Although, to be fair, even Go suffers from this a bit.)
This guidance isn't heralding in a new age of programming, it's explaining the right way to think about a new feature within the language.