Love to get some feedback on my first python app!!!

Chris Angelico rosuav at gmail.com
Mon Sep 22 12:04:43 EDT 2014


On Tue, Sep 23, 2014 at 1:52 AM, Jean-Michel Pichavant
<jeanmichel at sequans.com> wrote:
> The code I posted had many bugs but one could not be fixed without the comment. Or at least there's an obvious discrepancy between the comment and the code that should catch the reader's attention.
>

The obvious discrepancy, sadly, doesn't tell you which one is right.
It's like the old days of FAT file systems - DOS would maintain two
copies of the eponymous File Allocation Table, but in the event of
corruption, it had no way of knowing which was to be trusted. (And I'm
not sure anything would ever actually notice differences, other than
an explicit CHKDSK.) When you have an intention comment, rather than
simply replicating the functionality in human-readable form, you can
more easily check that the intention matches the rest of the design.

ChrisA



More information about the Python-list mailing list