Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #78176

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

References <CAPTjJmrMq=rCXYFMzCDwFDt577UBdh6O=xNDHM6+n=M-vg6KLA@mail.gmail.com> <1142710437.7070860.1411401142913.JavaMail.root@sequans.com> <CALvWhxvoXfrENBKCWvPE8crRRwk7ErybKe+JsFEezckRzu43Nw@mail.gmail.com>
Date 2014-09-23 04:25 +1000
Subject Re: Love to get some feedback on my first python app!!!
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.14228.1411410342.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Sep 23, 2014 at 4:24 AM, Chris Kaynor <ckaynor@zindagigames.com> wrote:
> On Mon, Sep 22, 2014 at 8:52 AM, Jean-Michel Pichavant
> <jeanmichel@sequans.com> wrote:
>>
>> Anyway it's seems we agree anyway because your example perfectly
>> illustrate what I was trying to demonstrate:
>> print(cells[2]) is very easy to understand, most of people would say 'no
>> need of any comment'. I think it does require a comment.
>
>
> But the thing that requires the comment is the "2", not the "print" or the
> "cells". And that comes to a more common issue: any number other than 0 or 1
> in code most likely needs a comment (that comment could be merely a variable
> name). Values of 0 or 1 may need a comment, but there are plenty of cases
> where they are used quite clearly - its much less likely that other numbers
> have obvious meaning.

Or in this case, replacing the list with a namedtuple is probably more useful.

ChrisA

Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Re: Love to get some feedback on my first python app!!! Chris Angelico <rosuav@gmail.com> - 2014-09-23 04:25 +1000
  Re: Love to get some feedback on my first python app!!! alex23 <wuwei23@gmail.com> - 2014-09-23 13:59 +1000

csiph-web