Dan Sommers wrote:

>>>         while "asking for reponse":
>> 
>>>         while "adventuring":
>> 
>> that's a funny way to say `while True:`...
> 
> Funny, perhaps, the first time you see it, but way more informative than
> the other way to the next one who comes along and reads it.

While I understand that it's syntactically and semantically correct, my nose 
still doesn't like it.

It's not that's just not common... I just think it's a mishmash... it's not 
a "rule" thing, more a "feeling wrong" one.

Maybe it's better if I try to explain in another way...

My first instinct about it it's to think why the author choose this way to 
talk to the reader.

This message it's clearly meant to be read by another programmer, not by the 
user. But in my mind it should be a comment. In my mind code explain "what" 
is happening, comment say "why". (Sometimes talking to my colleagues we say 
comment is a way to ask to forgiveness for a particular obscure code, as in 
"sorry, I needed to flip-this and flop-that for such-and-such reason") 

Following this reasoning, I will found more readable something like

    # asking for response
    while True:
        ...

that

    while 'asking for response':
        ...

because in the latter case the "why" and the "how" are mixed. It's like 
you're talking with the interpreter, but the message is for the programmer..

I hope I explained myself...




-- 
By ZeD

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to