[Python-ideas] A suggestion for Python 3 vs Python 2

Guido van Rossum guido at python.org
Tue Nov 12 06:27:55 CET 2013


You probably ought to weigh the ease of typing against readability. Which
is more important? By how much? If 10% more effort typing makes for 5%
better readability, but the code is read 5 times as often as it is edited,
is that then worth it?

Separately, have you measured typing speed rigorously?

On Monday, November 11, 2013, Xuancong Wang wrote:

> >An interesting methodology; however, I think PERL already has
> >conquered this corner of the language world.
>
> I think Perl has much lower efficiency than python, especially you need to
> type a $ before every variable. The input effort of $ is very high because
> you need to press shift.
>
> Also, you need to type {} for every function/for/while structure.
>
> In terms of language efficiency, I think Perl is no comparison to Python.
>
> We can roughly estimate the input effort of every key in the following way:
> Normal alphabet keys: effort=1
> Numbers 0~9: effort=1.2
> Shift/Tab: effort=0.6
> Ctrl/Alt: effort=0.8
> {}[];'\,./-=: effort=1.2
> (effort measures how difficult it is to press the key)
> Therefore, any composed keys like shift+9='(',  the input effort is
> 0.6+1.2=1.8
> that's why we should try to avoid composed keys if it's not necessary.
>
> >>"Advantages of print being a function:
> * You can override it. Can't do that with a special language element.
> * It can be used in map, lambda, and other expression contexts.
> * Precedence etc follows the normal rules of functions - the arguments
> are all tidily enclosed.
> * Keyword arguments, rather than magical syntax, handle the oddities
> like end=" ".
> * You can easily alias it: "p = print; p('Hello, world!')"
>
> I do agree that print should remain as a function logically. But is there
> a way to make it as simple as in python 2, or even simpler, for example:
> pr >>sys.stderr, 'hello world'
>
> xuancong
>
>
> On Tue, Nov 12, 2013 at 11:56 AM, Mark Janssen <dreamingforward at gmail.com<javascript:_e({}, 'cvml', 'dreamingforward at gmail.com');>
> > wrote:
>
>> On Mon, Nov 11, 2013 at 7:45 PM, Xuancong Wang <xuancong84 at gmail.com<javascript:_e({}, 'cvml', 'xuancong84 at gmail.com');>>
>> wrote:
>> > As you know, reading from and writing to IO is a high frequency
>> operation.
>> > By entropy coding theorem (e.g. Huffman coding), an efficient language
>> > should assign shorter language code to more frequent tasks. Typing a '('
>> > requires holding SHIFT and pressing 9, the input effort is much higher
>> than
>> > that in Python 2. Also, specifying IO has changed from >>* to file=*,
>> which
>> > also becomes more inconvenient.
>>
>> An interesting methodology; however, I think PERL already has
>> conquered this corner of the language world.
>> --
>> MarkJ
>> Tacoma, Washington
>>
>
>

-- 
--Guido van Rossum (on iPad)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131111/0462cc1b/attachment.html>


More information about the Python-ideas mailing list