"Usability, the Soul of Python"

Ricardo Aráoz ricaraoz at gmail.com
Wed Mar 31 15:21:48 EDT 2010


Lawrence D'Oliveiro wrote:
> In message <20100331003241.47fa91f6 at vulcan.local>, Robert Fendt wrote:
>
>   
>> The braces are gone, and with them the holy wars.
>>     
>
> Let me start a new one. I would still put in some kind of explicit indicator 
> of the end of the grouping construct:
>
>     count = 99
>     while count > 0:
>         print u'%d slabs of spam in my mail!' % count
>         print u'%d slabs of spam,' % count
>         print u'Send one to abuse and Just Hit Delete,'
>         count += 1
>         print u'%d slabs of spam in my mail!' % count
>         print u''
>     #end while
>   
<irony>
    I'd much prefer the following :

        ## Beginning of a program block
        count = 99      # Set the variable count as a name for the
integer object 99
        while count > 0:      # if count is the name of 0 or less then
exit the loop (this will NEVER happen)
            ## Beginning of a while loop
            print u'%d slabs of spam in my mail!' % count
            print u'%d slabs of spam,' % count
            print u'Send one to abuse and Just Hit Delete,'
            count += 1
            print u'%d slabs of spam in my mail!' % count
            print u''
            ## End of a while loop
        ## End of a program block

    Which is reeeaaally easier to understand than :

        count = 99
        while True
            print u'%d slabs of spam in my mail!' % count
            print u'%d slabs of spam,' % count
            print u'Send one to abuse and Just Hit Delete,'
            count += 1
            print u'%d slabs of spam in my mail!' % count
            print u''

</irony>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100331/353cbc2d/attachment-0001.html>


More information about the Python-list mailing list