Good programming style

Ben Finney bignose+hates-spam at benfinney.id.au
Sun Sep 14 21:01:23 EDT 2008


Grant Edwards <grante at visi.com> writes:

> On 2008-09-14, Ben Finney <bignose+hates-spam at benfinney.id.au> wrote:
> > Second: please do yourself a favour and drop the camelCaseNames.
> > Follow PEP 8 <URL:http://www.python.org/dev/peps/pep-0008> for style
> > and naming in your Python code.
> 
> If he finds camelcase more readable and easier to type (as do
> I), how is switching to underscores "doing himself a favor"?
> 
> I'm generally in favor of using a consistent naming style
> throughout a project, but I don't see why the naming style used
> in my source code should be subject to somebody else's
> arbitrary standard.

Because the code we write rarely stays isolated from other code. There
is an existing convention, and it's better to pick a (sufficiently
sane) style convention and stick to it than argue about what the
convention should be.

> When it comes to writing code intended for the standard library
> in the main Python distribution, I would certainly defer to the
> existing standard as defined in PEP 8.  However, I don't see
> any reason that style should be imposed on all everybody else.

Who's imposing? I'm saying it's a good idea for everyone to do it, and
going so far as to say that one is doing oneself a favour by following
the convention. I have no more power than you to "impose" convention
on anyone.

-- 
 \          “‘Did you sleep well?’ ‘No, I made a couple of mistakes.’” |
  `\                                                    —Steven Wright |
_o__)                                                                  |
Ben Finney



More information about the Python-list mailing list