Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #107200 > unrolled thread

[OT] Java generics (was: Guido sees the light: PEP 8 updated)

Started byTim Delaney <timothy.c.delaney@gmail.com>
First post2016-04-18 08:02 +1000
Last post2016-04-18 12:11 +0300
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [OT] Java generics (was: Guido sees the light: PEP 8 updated) Tim Delaney <timothy.c.delaney@gmail.com> - 2016-04-18 08:02 +1000
    Re: [OT] Java generics Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-04-18 20:32 +1200
      Re: [OT] Java generics Marko Rauhamaa <marko@pacujo.net> - 2016-04-18 12:11 +0300

#107200 — [OT] Java generics (was: Guido sees the light: PEP 8 updated)

FromTim Delaney <timothy.c.delaney@gmail.com>
Date2016-04-18 08:02 +1000
Subject[OT] Java generics (was: Guido sees the light: PEP 8 updated)
Message-ID<mailman.118.1460931049.6324.python-list@python.org>
On 17 April 2016 at 23:38, Ian Kelly <ian.g.kelly@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

[toc] | [next] | [standalone]


#107254 — Re: [OT] Java generics

FromGregory Ewing <greg.ewing@canterbury.ac.nz>
Date2016-04-18 20:32 +1200
SubjectRe: [OT] Java generics
Message-ID<dnjkd8FtsjnU1@mid.individual.net>
In reply to#107200
> On 17 April 2016 at 23:38, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>
>>The diamond operator in JDK 7 makes this a lot more tolerable, IMO:

The diamond notation helps slightly, but not very much.
What would help a lot more would be something like C's
typedef for giving aliases to type expressions.

It's understandable that Java didn't originally have
a typedef, because all types had short enough names
anyway. But generics changed that in a big way, and
it baffles me that some form of typedef wasn't added
soon afterwards.

-- 
Greg

[toc] | [prev] | [next] | [standalone]


#107258 — Re: [OT] Java generics

FromMarko Rauhamaa <marko@pacujo.net>
Date2016-04-18 12:11 +0300
SubjectRe: [OT] Java generics
Message-ID<878u0bs2lz.fsf@elektro.pacujo.net>
In reply to#107254
Gregory Ewing <greg.ewing@canterbury.ac.nz>:

> It's understandable that Java didn't originally have a typedef,
> because all types had short enough names anyway. But generics changed
> that in a big way, and it baffles me that some form of typedef wasn't
> added soon afterwards.

Java's opposition to typedef seems to be something fundamental and
philosophical, although I don't exactly understand what.

What people do then is they define classes and interfaces as typedefs,
which is even worse.


Marko

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web