2 ms·
Java's crippled generics, lack of tuple support, and lack of default parameters encourage interface bloat in utility libraries. Given how bloody good Java IDEs
by vkou 10y ago
Java's crippled generics, lack of tuple support, and lack of default parameters encourage interface bloat in utility libraries.
Given how bloody good Java IDEs are (By which I mean to say - how good IntelliJ is), the cognitive cost of this interface bloat is very low... Until you start developing for Android.
- monocasa 10y agoWouldn't Java's crippled generics actually help reduce the method count since due to type erasure they're all the same method at the VM level anyway?
- Matthias247 10y agoFor reference types probably yes, but Java also often needs extra methods or overloads for handling primitive types, which would get unnecessarily boxed when used in generic methods.
- josefx 10y agoOn the one hand yes, on the other hand Java also generates Bridge methods when you implement a generic interface. A MyType implementing Comparable<MyType> will contain a compareTo( MyType ) method and a generated compareTo( Comparable ) bridge method. It is more likely that generated classes, countless getters and setters and a tendency to small methods has a higher impact.