3 ms·
> there is definitely a cost to pervasive generics I've had a similar experience with TypeScript, whose type system is so breezy and flexible that it encourage
by brundolf 6y ago
> there is definitely a cost to pervasive generics
I've had a similar experience with TypeScript, whose type system is so breezy and flexible that it encourages levels of genericism I've not seen anywhere else, for better or worse. I think as type systems stop being a limiting factor, it's important we learn to moderate our own tendency to abstract. Go's ethos so far has been to enforce moderation of complexity at a language level, so it will be interesting to see what happens when generics open part of that up.
- throwaway894345 6y ago> I think as type systems stop being a limiting factor, it's important we learn to moderate our own tendency to abstract. Go's ethos so far has been to enforce moderation of complexity at a language level, so it will be interesting to see what happens when generics open part of that up. I agree with this a lot. Relatedly, Go has this nice property that code tends to be pretty 'standard' regardless of who wrote it (facilitates reading and writing). I hope the additional expressiveness that comes with generics doesn't harm this 'standardization' property of the ecosystem. > I've had a similar experience with TypeScript, whose type system is so breezy and flexible that it encourages levels of genericism I've not seen anywhere else, for better or worse I wonder if this is a consequence of TypeScript's breezy generics or if it's because people are now adding types to the egregiously abstract things they were already doing in JS.
- brundolf 6y agoI would guess the driving factor is TypeScript's powerful inference capabilities. You can write generic functions all over the place, with multiple (sometimes interrelated!) type parameters, and you rarely have to pass explicit type arguments when calling anything. TypeScript will just figure it out. This removal of overhead when using complex types probably makes people less averse to creating them in the first place. Rust has a similar story.