Grokking Advanced Go
Vote

0% completed

​

When Not to Use Generics

In his Go blog article When To Use Generics, Ian Lance Taylor gives a general guideline for programming Go: "write Go programs by writing code, not by defining types." The article applies this directly to generics. A program that starts by defining type parameter constraints is, in its words, "probably on the wrong path."

Generics are easy to add, but they make code harder to read. Each type parameter is one more thing that a reader must keep in mind, and it brings no benefit unless it removes a real copy of some code

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content