5 ms·
Unfortunately not everyone shares that opinion of their restricted use-cases. I've seen ~100 line HTTP handler methods that are implemented using generics and
by slimsag 2y ago
Unfortunately not everyone shares that opinion of their restricted use-cases.
I've seen ~100 line HTTP handler methods that are implemented using generics and then a bunch of type-specific parameters inevitably get added when the codepaths start to diverge and now you've got a giant spaghetti ball of generics to untangle, for what was originally just trying to deduplicate a few hundred lines of code.
- Groxx 2y agotbh I'll still take it over a similar Gordian knot with interfaces. At least you can tell the restrictions are met at compile time, rather than silently failing at runtime because you (and/or someone else in the past) didn't notice one edge case lodged somewhere surprising.