Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Tim Delaney Newsgroups: comp.lang.python Subject: [OT] Java generics (was: Guido sees the light: PEP 8 updated) Date: Mon, 18 Apr 2016 08:02:45 +1000 Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de IEpfKaqk+XAoGSukqIqN5wTLbnv4nFZaR2fjynlAY+/A== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'operator': 0.03; 'heavily': 0.04; 'extent': 0.07; 'subject:PEP': 0.07; 'cc:addr :python-list': 0.09; 'worse': 0.09; 'received:209.85.218': 0.10; 'python': 0.10; 'explicitly': 0.15; '2016': 0.16; 'cc:name:python': 0.16; 'language)': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:Java': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; '>': 0.18; 'email addr:gmail.com>': 0.18; 'language': 0.19; 'subject:] ': 0.19; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'fairly': 0.22; 'java': 0.22; 'anonymous': 0.22; 'implemented': 0.24; 'tim': 0.24; 'message- id:@mail.gmail.com': 0.27; 'specify': 0.27; 'idea': 0.28; 'closer': 0.29; 'methods.': 0.29; 'creating': 0.30; "can't": 0.32; 'language.': 0.32; '(for': 0.34; 'received:google.com': 0.35; 'generic': 0.35; 'happened': 0.35; 'primarily': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'subject:: ': 0.37; 'skip:& 10': 0.37; 'say': 0.37; 'received:209': 0.38; 'subject:[': 0.39; 'subject:the': 0.39; 'some': 0.40; 'engine': 0.62; 'more': 0.63; "they're": 0.66; 'limited.': 0.67; 'delaney': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc; bh=ctLy4ZR4i6GNFUQSqhceZ/R9AaZ3fxzZauoPnC28AYY=; b=rEdDAPALV23UqEOBiGFXqt7ab3TRQgA8/cPqCSXb8HV3XY2wFyBjzKMf+g7lFi2WmR xQSqIYqLaRJby4XVH6CWl0/c6vA+FI9XJf7QLED6KbwutaAnQ6+LPEeV454/YHXqBoCJ +Epl67PDRBN3UbVuiAUwVUvY7Ztk2ol1IjUMA7OF8GmxNHPIALt6lIYU4WeXzF8fde/t buiRAI2efBWpQLaUd9mvAZV/LSH4myqOmlYqmoVgpqW2PNGr+nXqARTEGvfqcwOQlyMN tU57pxld5GVx3Dzy4/YwyAbs1oDrRqqRGo+U5abSSIhtdew8BveVl4dlnmLnssPBaskA bHCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc; bh=ctLy4ZR4i6GNFUQSqhceZ/R9AaZ3fxzZauoPnC28AYY=; b=EHWqIxxnrTyoj2VqR6e+IDnWMRk6fxiRvKAEvmy7IKXDpSWEQ06mqPPArG7vJ1KW+R 5rfWUpmyu7x8a5VyLHi2cj84yRv60v/STMdZD8CPXpldQUUe47fQ8YjtMylYh1z0wsKx mSPh+6kCPxe5hLVm8NQ8x5Bwsk5XlcFJCOijIhbylbI3f1J29ScedFhwqlmaKPpzibFM 0oj7RBeqj5nAEb+DgYNlxEN/aqQcJ/IcnzLGxylRy5cInQXdyRfxZCnx1DipjkjQJW2Q GILuptyDKza4zebOx2vYjWn83Hrhz2IROKo4mMiKHqi5PUyYzIw9R/Bh135Ud33at57G EdDA== X-Gm-Message-State: AOPr4FW27hZi9UsWNUcV2weC9qm+OTWVTTu4p2F9fWvSx1rq8HlZEcwnIPJ4A201Jexa1i6dgjzIafl8GteWiw== X-Received: by 10.157.46.70 with SMTP id c6mr3508031otd.106.1460930565476; Sun, 17 Apr 2016 15:02:45 -0700 (PDT) X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com comp.lang.python:107200 On 17 April 2016 at 23:38, Ian Kelly wrote: > > Java generics ruined a perfectly good language. I mean: > > The diamond operator in JDK 7 makes this a lot more tolerable, IMO: > > Map> 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