4 ms·
Here's the kicker: you don't actually end up copy/pasting much code.
by skj 12y ago
Here's the kicker: you don't actually end up copy/pasting much code.
- sdegutis 12y agoIt's a slippery slope ("oh it's fine, I'm only copy/pasting N file(s)" where N slowly increases) which I don't want to go down.
- stcredzero 12y agoCan you think of 3 specific examples and quantify the fan-out?
- sdegutis 12y ago1. Float64Slice 2. IntSlice 3. StringSlice http://golang.org/pkg/sort/ http://golang.org/pkg/sort/
- stcredzero 12y agoAh yes, I've run into this. It's certainly not some kind of "rabbit hole." So basically, there's a few lines of boilerplate for each time you want to sort something. So this is O(1) additional typing per sorted type, which is what it would be for generics. You're trying to kill your argument with faint support? EDIT: Granted, it is an unusual formulation, and far less convenient.
- sdegutis 12y ago1-A. SearchFloat64s 2-A. SearchInts 3-A. SearchStrings http://golang.org/pkg/sort/ http://golang.org/pkg/sort/
- stcredzero 12y agoHo hum. Same arguments apply. Also O(1) per type, just like generics.
- deleted 12y ago[deleted]
- coldtea 12y agoYou shouldn't be copy/pasting ANY code in a language created after 2000.