Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!novso.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail 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; 'read.': 0.03; 'languages,': 0.04; 'syntax': 0.04; '(even': 0.05; 'argument': 0.05; 'subject:Python': 0.06; '(python': 0.07; 'definitions': 0.07; 'float': 0.07; 'string': 0.09; 'arguments': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'useful,': 0.14; "wouldn't": 0.14; 'bigger.': 0.16; 'boolean': 0.16; 'magic': 0.16; 'personally,': 0.16; 'slight': 0.16; 'think.': 0.16; 'to:addr:pearwood.info': 0.16; 'to:addr:steve+comp.lang.python': 0.16; "to:name:steven d'aprano": 0.16; 'language': 0.16; 'trying': 0.19; 'solution.': 0.20; 'preferred': 0.22; 'cc:addr:python.org': 0.22; 'effort.': 0.24; 'fraction': 0.24; 'logical': 0.24; 'space.': 0.24; 'tend': 0.24; 'looks': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'define': 0.26; 'this:': 0.26; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'words': 0.29; 'converting': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'code': 0.31; 'getting': 0.31; 'comments': 0.31; 'usually': 0.31; 'developers.': 0.31; 'doc': 0.31; 'go.': 0.31; 'larry': 0.31; 'yes.': 0.31; 'something': 0.35; 'definition': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'there': 0.35; 'ones,': 0.36; 'shorter': 0.36; 'similar': 0.36; 'effort': 0.37; 'level': 0.37; 'being': 0.38; 'that,': 0.38; 'little': 0.38; 'does': 0.39; 'though,': 0.39; 'sure': 0.39; 'either': 0.39; 'even': 0.60; 'no.': 0.61; 'simply': 0.61; 'information': 0.63; 'name': 0.63; 'real': 0.63; 'more': 0.64; 'taking': 0.65; 'between': 0.67; 'equals': 0.68; 'subject:! ': 0.74; 'clearer': 0.84; 'gap': 0.84; 'speech': 0.84; 'favour': 0.91; 'stretch': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sszNbfqeuvln2fkhv9Ktr1XEqFee+UcAKHToHQKCYIs=; b=M239a5avzcHgY7Pb/S/nBDzmldtHABWT2qKHiBUx/56VZZPHFFnbTNUESygJ8clmoT WLHucIIHfNxpWqSF0hS4ZYmkSrQj+m9yoH9+5rU5IoxUtXIkMpMqh1eRbUvcXBuynqFn oK/d6KG/yqWp/8ViUlssdAPYM8d+SfDrI31GiksHupyMbWfaEyTongwIELAQEZyR4euc n3iuzKdPvHkA4+mG6Tz0LT+CGtNGX3MBO1hd3IZyqM7f1IiqT69//RrDsoCQfXJzO+aT iWWVytwYiNFl8tsRg1Zn7j3/e0zjWCbyONLkKywqNWJPaQlpjQbp+7ikYTXFsT8PM16c d//g== MIME-Version: 1.0 X-Received: by 10.112.44.171 with SMTP id f11mr47832671lbm.65.1421905852149; Wed, 21 Jan 2015 21:50:52 -0800 (PST) In-Reply-To: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> References: <54c07d04$0$13012$c3e8da3$5496439d@news.astraweb.com> Date: Thu, 22 Jan 2015 05:50:52 +0000 Subject: Re: Python is DOOMED! Again! From: Nicholas Cole To: "Steven D'Aprano" Content-Type: multipart/alternative; boundary=001a11346fd838b699050d37411d Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 104 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1421905859 news.xs4all.nl 2829 [2001:888:2000:d::a6]:38092 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:84192 --001a11346fd838b699050d37411d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I don't think that Python is doomed. I *do* think that type-hinting is useful, and Python has borrowed a syntax that is similar to that used in other languages, so that it is a familiar one to many developers. It is a stretch to call it intuitive though, either to write or to read. Personally, I would have favoured a doc string solution. The magic comments that are part of the current proposal are genuinely intuitive, I think. The function definition syntax is something to be learned and which it takes me a little time to process even though I'm getting used to it. I find that it's still a slight effort to remember which way around the name of the argument and the type go. I'm sure I've seen one language that does the oppoosite, and the fraction of a second it takes me to remember is a tiny friction. There's no doubt, too, that long function definitions (Python functions tend to have lots of arguments in the real world) are going to look cluttered, and cluttered by lots of magic punctuation. So useful, yes. Familiar already to those who use other languages, yes. Intuitive, no. And there is a linguistic reason for that: Consider this: Define function add taking price1, price2, print_error equals true. Yes, Python wouldn't understand that, but turning it in to a valid definition requires only a tiny amount of effort. Type definitions add a whole level of complexity: Define function add taking the float price1, the float price2, print_error equals the Boolean true. Make the function return a float. Converting that into python simply requires more effort: in other words the gap between what one might say in speech and what the code looks like is bigger. The reason for this is that a lot of information is being compressed in to a small space. In English writing it is usually clearer to avoid long and complicated sentences with lots of subclauses (even if they make perfect, logical sense) in favour of shorter ones, and I think there is a parallel here. I would have preferred Python to mimic: Define function add taking price1, the price2, print_error equals true. Price1 is a float. Price2 is a float. The function returns a float. But now this is sounding a little like something from Larry Wall, and so I had better stop! I wasn't trying to re-litigate the decisions that have been taken, just to understand the friction. Just my =C2=A30.2 Nicholas. --001a11346fd838b699050d37411d Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I don't think that Python is doomed. I *do* think that type-hinting is = useful, and Python has borrowed a syntax that is similar to that used in ot= her languages, so that it is a familiar one to many developers.=C2=A0
<= br>
It is a stretch to call it intuitive though, either to write = or to read.=C2=A0Personally, I would have favoured a doc string solution. T= he magic comments that are part of the current proposal are genuinely intui= tive, I think. The function definition syntax is something to be learned an= d which it takes me a little time to process even though I'm getting us= ed to it. I find that it's still a slight effort to remember which way = around the name of the argument and the type go.=C2=A0I'm sure I've= seen one language that does the oppoosite, and the fraction of a second it= takes me to remember is a tiny friction. There's no doubt, too, that l= ong function definitions (Python functions tend to have lots of arguments i= n the real world) are going to look cluttered, and cluttered=C2=A0by lots o= f magic punctuation. =C2=A0

So useful, yes. Famili= ar already to those who use other languages, yes. Intuitive, no. And there = is a linguistic=C2=A0reason for that:=C2=A0

Consid= er this:

Define function add taking price1, price2= , print_error equals true.=C2=A0

Yes, Python would= n't understand that, but turning it in to a valid definition requires o= nly a tiny amount of effort.=C2=A0

Type definition= s=C2=A0add a whole level of complexity:

Define fun= ction add taking=C2=A0the float=C2=A0price1, the float=C2=A0price2, print_e= rror equals the Boolean true. Make the function return a float.=C2=A0
=

Converting that into python simply requires=C2=A0more effort= : in other words the gap between what one might=C2=A0say in speech and what= the code looks like is bigger.=C2=A0

The reason for thi= s is that a lot of information is being compressed in to a small space. In = English writing it is usually clearer to avoid long and complicated sentenc= es with lots of subclauses (even if they make perfect, logical sense)=C2=A0= in favour of shorter ones, and I think there is a parallel here.=C2=A0

I would have preferred Python to mimic:

=
Defin= e function add taking=C2=A0price1, the price2, print_error equ= als true. Price1 is a float. Price2 is a float. The function returns a floa= t. =C2=A0

But now this is soundi= ng a little=C2=A0like something from Larry Wall, and so I had better stop!= =C2=A0 I wasn't trying to re-litigate the decisions that have been take= n, just to understand the friction.=C2=A0

Just my = =C2=A30.2

Nicholas.=C2=A0
--001a11346fd838b699050d37411d--