4 ms·
Generics for a language with a common base class object are a category error. Java's current popularity is due to Android, not the bloated corpse of enterprise
by yarrel 10y ago
Generics for a language with a common base class object are a category error.
Java's current popularity is due to Android, not the bloated corpse of enterprise Java.
- hota_mazi 10y agoJava has been in the top three most popular languages since the early 2000s. Android certainly made it more popular than it already was, but Java was extremely popular way before Android appeared.
- prodigal_erik 10y agoTypes like Object and Comparable<T> allow heterogeneous collections and algorithms, which are occasionally useful even in an otherwise statically-typed language. Think of it as a set of types where otherwise you would have required boxing everything within a single type and eventually reimplementing the type system. If Java had generics from day one, they could have put methods like equals and hashCode in interfaces that some classes don't implement, instead of passing static type checks and then blowing up at runtime because you did something that never made sense.