[Bf-taskforce25] Proposal to follow PEP8 for all python scripting for Blender 2.5

Diego B bdiego at gmail.com
Mon Jun 8 16:06:37 CEST 2009


Hello all, I really don't work too much with script, just rare
occasion but here are my 2 cents.

On Mon, Jun 8, 2009 at 9:08 AM, Nathan Letwory<jesterking at letwory.net> wrote:
> -1 from me, when it comes to code in our SVN repository (bf-blender).
> Our main code (C) has tabs as convention, and it'd be good to keep
> that for every other source file as well.
>
> Yes, we should stick to conventions, so let it be our own. I don't see
> why spaces are preferred over tabs, since most editors can configure
> the visual width of tabs, whereas with spaces you're stuck (on IRC I
> used the word fucked, but I guess that's a bit strong :° ).

Agree 100% here (even with the fucked ;)

>
> For Blender 2.5 branch I have already converted some scons files to
> use tabs instead of spaces. It at least would mean no more
> reconfiguring of the editor whenever I switch between different
> languages.
>
> People can do whatever they please outside the svn repo for
> bf-blender, but in there I'd say we stick to tabs, as tabs is used in
> the largest part of the code (unverified fact).
>
> There's been a lot of animo pro-spaces, but I think the reasons are
> just wrong. I have yet to find an editor that allows for configuring
> space-length, whereas all the ones that I've used do allow that for
> tabs. And why Python converts tabs internally to 8 spaces is totally
> beyond me. But we should not have to think about that.
>
> So, for us coders it should be: open any source code in our
> repository, edit, save - without having to think about indentation. I
> admit, our scons files are a mess regarding that, but over the years
> it has become apparent to me that we should stick to tabs for our
> source base.
>
> We can have our blender text editor provide choice between
> spaces/tabs, but in our very own svn repo, we should stick to tabs.
>
> Ok, enough rambling. Main point is -1 from me.
>
> /Nathan
>
>
>
> 2009/5/28 Stani <spe.stani.be at gmail.com>:
>> I think Blender 2.5 is a good occasion to adopt the PEP8 Style Guide
>> for Python Code, which is widely spread in the Python community. This
>> will enhance the chance to make code more readable, make it more easy
>> to share code and to collaborate. The PEP8 is the result of many years
>> of very experienced Python coders (Guido et alii.) and I can garantuee
>> it is hard to compete with them ;-)

Don't be lie here, you can write more "readeble, make it more easy to share
code and to collaborate" with tab too, it's not about what is better, is about
what is the user preference and year of experienced don't say anything in this
case, at the end is just user preference.

So don't get me wrong, I am not say that using space is wrong, bad,
stupid or whatever,
I am say that this is a user preference and I don't see any good
reason here to change
our script.

>>
>> This intention was already formulated in "Style and PEP-8" on
>> http://wiki.blender.org/index.php/BlenderDev/Blender2.5/PythonAPI
>>
>> What I like to do is, make it official and even to encourage it for
>> anyone writing scripts in Blender. One of the important details of the
>> PEP8 is: "For new projects, spaces-only are strongly recommended over
>> tabs." (I think now both spaces and tabs are used, which will create
>> confusion in the end.) It might seem some trouble now to adopt to
>> this, but it will save much more trouble later.
>>
>> Can we vote on this issue and depending on the outcome make the switch?
>>
>> Stani
>>
>> --
>> Phatch Photo Batch Processor - http://photobatch.stani.be
>> SPE Python IDE - http://pythonide.stani.be
>> _______________________________________________
>> Bf-taskforce25 mailing list
>> Bf-taskforce25 at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>>
>>
> _______________________________________________
> Bf-taskforce25 mailing list
> Bf-taskforce25 at blender.org
> http://lists.blender.org/mailman/listinfo/bf-taskforce25
>

So until some one come and say "the next version of python don't go to
support tab's character" my opinion is -100 for space.
(and even then.. I really have to thing about say ok with change tab to space ;)


More information about the Bf-taskforce25 mailing list