3 ms·
It's only been available for 6 months, the language has been around for nearly 13 years (November 2009). Pretty much all learning materials that aren't intended
by Jtsummers 4y ago
It's only been available for 6 months, the language has been around for nearly 13 years (November 2009). Pretty much all learning materials that aren't intended to teach generics (which have been written only in the past few months, or the past couple years about prospective generic mechanisms) will not teach generics. Anyone picking up The Go Programming Language or any other text or watching any video course will not be taught to use generics. And since there has been about 12.5 years worth of code written without generics and that code works, there's little need to massively change anything.
So until the learning material catches up and until new libraries are written, or old ones have a reason to be updated, you won't see generics widely used.
- indrora 4y agoSimilarly, the same thing happened in C#. Where Go and C# have differed is where generics are common. In the introduction of generics into C#/.NET, their use was added everywhere. Microsoft made a huge point of including built-in List<T> and ArrayList<T> and other common things that would benefit from generics. Go however has drawn the line in the sand that generics are not allowed into the standard library for now. Rob Pike has been vocal about this [1] and I can almost agree with him. Part of the issue is that the way Go handles the standard library. Part of the issue is how libraries in general are managed. * Go’s standard library is simultaneously “just a git repo in the ether” and “A thing shipped with the Go compiler runtime”. Like any other library. * Libraries in general being “Just another git repo”, many haven’t been updated to use Go modules. Because Go doesn’t have a good central repository for go libraries, I don’t have good numbers on this. [1] https://github.com/golang/go/issues/48918 https://github.com/golang/go/issues/48918
- Jtsummers 4y agoC# also adopted generics earlier in its life. 2.0 was released in 2005 and added generics, the language was first released, announced?, in 2000. It was also around the same time as Java added generics.