[Tutor] Tutor Digest, Vol 86, Issue 12

Walter Prins wprins at gmail.com
Sun Apr 3 23:34:39 CEST 2011


Hello,

2011/4/3 Mateusz Koryciński <mat.korycinski at gmail.com>

>
> (2) You have a *mess* of unreadable variable names. You have:
>>
>>     w.steps w.x w.y w.world data.c data.n data.e data.s data.w data.cc
>>
>> (yes, you have data.c AND data.cc!!!) plus loop variables z i j and r,
>> and z is never used! How is anyone supposed to understand what this
>> does? Even if you solve this problem *today*, in a week you will have
>> forgotten what the code does and you won't understand it.
>>
>>
> It's an objects from another classes. Variable z is used because there is a
> need to provide number of steps to execute by user. Variable c mean central
> cell in array whe are considering right now, other one is neighbours but cc,
> cc means new state (couse basing on central cell and its neighbors we want
> to change value to cc).
>

I think the point that was being made was that all this (and the other
explanations you gave) should be in or circumscribed by your source code,
and that you should try to use longer/more meaningful variable names.  It
wasn't specifically a request for you to explain all of these things here on
the email list, although that might be helpful going forward.  Nevertheless
you still need to make these things part of and as obvious as possible from
reading your source code.  It should always be the definitive reference.
IMHO source which has to be substantially explained outside of itself should
be improved/clarified/documented/commented inside the source until external
explanations are largely unneccesary and the code is as far as practicable
self-documenting.

Walter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110403/bfb73baf/attachment-0001.html>


More information about the Tutor mailing list