4 ms·
Rolling your own containers really really sucks. Sucks enough to the point that it is essential, in my books.
by rerdavies 3y ago
Rolling your own containers really really sucks. Sucks enough to the point that it is essential, in my books.
- Kamq 3y agoMaybe I should be more clear. This thread was in the context of go generics, which generally means go 1.18, when user defined generics were added to the language. Go always had support for a minimal number of containers, I've never rolled my own when working in the language. Go had special compiler support for slices, maps, and channels before then, and they got used as the default containers for everything. Using those was annoying when you needed to do the same thing to, say, a slice of strings and a slice of ints, but if you aren't using a generic heavy style, it actually comes up surprisingly rarely. And, if I'm being honest, I'd consider most of the uses of generics I've seen the average enterprise dev use to be mistakes.