"Usability, the Soul of Python"
sccolbert at gmail.com
Tue Mar 30 16:25:54 CEST 2010
not really, the int will eventually overflow and cycle around ;)
On Tue, Mar 30, 2010 at 8:11 AM, Xavier Ho <contact at xavierho.com> wrote:
> Did no one notice that
> for(i = 99; i > 0; ++i)
> Gives you an infinite loop (sort of) because i starts a 99, and increases
> every loop?
> Ching-Yun Xavier Ho, Technical Artist
> Contact Information
> Mobile: (+61) 04 3335 4748
> Skype ID: SpaXe85
> Email: contact at xavierho.com
> Website: http://xavierho.com/
> On Tue, Mar 30, 2010 at 9:40 PM, Alf P. Steinbach <alfps at start.no> wrote:
>> * Jean-Michel Pichavant:
>>> John Nagle wrote:
>>>> Jonathan Hayward wrote:
>>>>> I've posted "Usability, the Soul of Python: An Introduction to the
>>>>> Python Programming Language Through the Eyes of Usability", at:
>>>> No, it's just a rather verbose introduction to Python, in dark brown
>>>> type on a light brown background. One could write a good paper on this
>>>> topic, but this isn't it.
>>>> John Nagle
>>> Why is it bad ?
>> >From a usability standpoint, the braces go with the lines to print out
>> the stanza rather than the for statement or the code after, so the following
>> is best:
>> for(i = 99; i > 0; ++i)
>> printf("%d slabs of spam in my mail!\n", i);
>> printf("%d slabs of spam,\n", i);
>> printf("Send one to abuse and Just Hit Delete,\n");
>> printf("%d slabs of spam in my mail!\n\n", i + 1);
>> This is just unsubstantiated opinion, but worse, it makes a tacit
>> assumption that there is "best" way to do indentation. However, most
>> programmers fall into that trap, and I've done it myself. In fact, when I
>> worked as a consultant (then in Andersen Consulting, now Accenture) I used
>> the style above. Petter Hesselberg, author of "Industrial Strength Windows
>> Programming" (heh, I'm mentioned) asked my why on Earth I did that, like,
>> nobody does that? It was a habit I'd picked up in Pascal, from very naïve
>> considerations of parse nesting levels, a kind of misguided idealism instead
>> of more practical pragmatism, but since I realized that that was an
>> incredibly weak argument I instead answered by pointing towards Charles
>> Petzold's code in his "Programming Windows" books. And amazingly I was
>> allowed to continue using this awkward and impractical style.
>> I may or may not have been responsible for the similarly impractical
>> compromise convention of using three spaces per indentation level. At least,
>> in one big meeting the question about number of spaces was raised by the
>> speaker, and I replied from the benches, just in jest, "three!". And that
>> was it (perhaps).
>> - Alf (admitting to earlier mistakes)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list