[Bf-committers] (re) proposal for pep8 for blender scripts

Stani spe.stani.be at gmail.com
Fri Oct 30 05:01:40 CET 2009


The preference between spaces and tabs is subjective and for some
religious. The choice between spaces and tabs is a subjective one. I
prefer spaces, so I could add a +1000000 for spaces to this thread.
Someone else can put  -1000000000, and so on ... but I'm afraid all
these + and - don't bring us closer to an agreement.

The real issue for me as a python developer is that it's not just
about some visual representation of white space. After a long
discussion the python community chose for PEP8, including spaces.
Every contributions to the standard python libraries are required to
follow this convention. As many of us don't contribute to these
libraries, why should we care? As the PEP8 was widely accepted and was
adopted by the important projects, several useful python code checkers
(such as pylint, pep8.py,  pyflakes, ...) start to follow PEP8 as
well. These tools are so valuable that I can't live without them as
they often improve the quality of your own code and that of
contributors. They are really a gift from heaven for code review.
Running them quickly on the current blender code python reveals that
many modules are imported without being used, even invalid syntax,
mixed spaces and tabs in many places, a lot of duplicate code, ... We
could move forward and fix all these issues to make blender python
more fast and stable.

I don't want to monkey patch these tools to add all kinds of
exceptions to the PEP8. (That would be a maintenance nightmare.) Right
now both tabs and spaces are used in blender python. So there is no
consistency which will be always the case if there are no tools for
guidance. PEP8 would making collaboration with the rest of the python
community more easy as well.

Nerdy discussions about subjective preferences for spaces versus tabs
might be fun for some. However the objective quality of the code
checking tools are for me the most important, so that is why I will
stick to PEP8.

Cheers

Stani
-- 
Phatch Photo Batch Processor - http://photobatch.stani.be
SPE Python IDE - http://pythonide.stani.be

On Fri, Oct 30, 2009 at 12:57 AM, Matt Ebb <matt at mke3.net> wrote:
> On Fri, Oct 30, 2009 at 10:16 AM, Joshua Leung <aligorith at gmail.com> wrote:
>> -1  on tabs -> spaces.
>
> -1 from me too, I really dislike spaces for indents, have to keep
> hammering the left and right arrow keys to line up the cursor. I'll
> live with it if the standard is decided though, but just registering
> my dissent ;)
>
>> -1 on a strict 80 char limit, but +1 for a "soft" 80 char limit. That is,
>> most lines should not exceed this length, but if the amount which it would
>> exceed this length is greater than about 2 words, then line breaking should
>> occur (or refactoring).
>
> Agreed on the 'ideally 80 char guideline' without getting too
> religious about it if a couple of lines are over every now and then.
>
> cheers,
>
>
> Matt
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers
>


More information about the Bf-committers mailing list