[OT] Java generics (was: Guido sees the light: PEP 8 updated)
Tim Delaney
timothy.c.delaney at gmail.com
Sun Apr 17 18:02:45 EDT 2016
On 17 April 2016 at 23:38, Ian Kelly <ian.g.kelly at gmail.com> wrote:
> > Java generics ruined a perfectly good language. I mean:
>
> The diamond operator in JDK 7 makes this a lot more tolerable, IMO:
>
> Map<AccountManager, List<Customer>> customersOfAccountManager =
> new HashMap<>();
>
To some extent - you can't use the diamond operator when creating an
anonymous subclass, and you often need to explicitly specify the types for
generic methods. The inference engine is fairly limited.
I wouldn't say generics ruined Java - they made it better in some ways (for
a primarily statically-typed language) but worse in others (esp. that
they're implemented by erasure). I also wouldn't describe Java as a
"perfectly good language" - it is at best a compromise language that just
happened to be heavily promoted and accepted at the right time.
Python is *much* closer to my idea of a perfectly good language.
Tim Delaney
More information about the Python-list
mailing list