[Bf-committers] line length / code style.

Joshua Leung aligorith at gmail.com
Mon Dec 19 11:24:18 CET 2011


Hi,

Over the weekend, I've posted my thoughts on a few of these issues [1].

Regarding your proposal, I agree with most of the issues brought up. HOWEVER,
1) I prefer the version of comments with a starting indicator on each
line + closing on a separate line. Apart from having seen it used all
over the place in the past, main advantage that it is clear at a
glance whether some text is part of a comment (regardless of whether
syntax highlighting is on). Probably not such a biggie these days as
every self respecting text editor has syntax highlighting, though the
one without just feels like "guts leaking out into the void".

2) Spacing *should* be used between a builtin keyword and an opening
brace. Keywords != function calls.

3) Assignment operators: my opinion of this has varied in the past,
though I'm now tending towards the "a = b" (NOT "a= b") camp. While
easier to type the second version, it doesn't hold up that well for
compound assignment (+=, -=, and friends). However, it should also be
noted that Python's PEP8 (which we use for our scripts) explicitly
states for this case that there should be spaces.

4) Trailing whitespace - make sure you get your definition of
"trailing" correct. If it's the defined by the lazy implementation of
most text editors, then I'd have to disagree with enforcing it ;)


[1] http://aligorith.blogspot.com/2011/12/avoiding-degenerative-coding-practices.html

On Mon, Dec 19, 2011 at 10:54 PM, Sergey Sharybin <sergey.vfx at gmail.com> wrote:
> Hi,
>
> I've prepared first draft of code style guideline [1]. Of course it needed
> to be finished and probably more adopted for existing code style in
> Blender, i'll continue working on this. Want to have feedback from active
> debelopers about things from rules needed to be discussed section.
>
> Also feel free to propse changes to existing tips or propose new tips.
>
> [1] http://wiki.blender.org/index.php/User:Nazg-gul/CodeStyle
>
> --
> With best regards, Sergey Sharybin
> _______________________________________________
> 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