Re:Ten Years of “Go: The Good, the Bad, and the Meh
by Veraticus on Tuesday July 18, 2023 @01:57PM
(#36776674)
I have written a library actually. I found interfaces perfectly sufficient for allowing applications to consume the contracts of the library without needing generics. Of course I understand that they have a use and are useful, but it's not like there weren't excellent solutions for this in Go before generics existed.
I guess you have never written a library. It's extremely useful there, stuff like "generic function that runs a channel thru X workers doing f() on it" is now easily possible with full type safety.
> Nevertheless I think people implementing them in their own projects is basically code smell and they are a symptom of poorly thought-out code rather than excellent code.
You can say that about literally any feature used by the incompetent.
But overall yes, they are far more useful for writing libraries than actual applications