[Bf-committers] line length / code style.

Campbell Barton ideasman42 at gmail.com
Sat Dec 17 02:15:34 CET 2011


Suggest 2 options for line splitting and accept use of either.
http://wiki.blender.org/index.php/User:Ideasman42/CodeStyle

On Sat, Dec 17, 2011 at 11:38 AM, Campbell Barton <ideasman42 at gmail.com> wrote:
> On Sat, Dec 17, 2011 at 1:17 AM, Sergey Sharybin <sergey.vfx at gmail.com> wrote:
>> Hi,
>>
>> I'll agree that having code guidelines will help on keeping code more
>> consistent. Don't think existing code should be changed to some general
>> rule, but prefer to have newly adding code following the same style.
>> Long lines are also better be prevented, imo. They might have sense for
>> long URL or code from stubs.c, but in general prefer to avoid long lines
>> too. It's easy to do.
>
> For specific style guide, agree going over all files and making them
> conform to some style guide is overkill ATM,
> However doing this for very long lines would still be good IMHO,
> mainly because we don't have all that many and they make side by side
> diff's unwieldy.
>
>> About code guidelines itself.. Not sure which style should be takes as
>> base, perhaps any style might be takes as basis, after this we'll write
>> guideline in the wiki and can discuss it a bit before declaring it as
>> "standard"
>
> Expect this would just be the style we already use in BLI/BKE/editor code.
>
>> IMO, most important to define would be:
>> - Indentation rules (when line is getting split)
>> - Comment style
>> - Variables naming
>> - Variables declaration style
>>
>> I've got some guidelines we've been using in some projects (not Blender
>> related, it was done before i've joined Blender community). Think i might
>> use them as basis, check which style is using by active developers and
>> prepare first version of blender code guideline in wiki. Think on monday
>> we'll might start discussion of that guidelines draft.
>
> Sounds fine, though I was only suggesting to set line length at first.
> I guess once we have a style guide we agree on, we can apply parts of
> it where it makes sense to existing code.
>
>> On Fri, Dec 16, 2011 at 8:34 AM, Campbell Barton <ideasman42 at gmail.com>wrote:
>>
>>> This is not high priority of course but once in a while I notice
>>> blender has some annoyingly long lines in our own source dir, eg.
>>>
>>> http://www.graphicall.org/ftp/ideasman42/long_lines.png
>>>
>>> Eventually it could be good to have a document like this for blender:
>>> https://sites.google.com/site/openimageio/coding-style-guide
>>>
>>> ... until then, I'd like to set some reasonable line limit - Suggest
>>> 120 (80 would be is impracticable for us).
>>>
>>> longer lines can stay where it makes sense - URL's for example.
>>>
>>> --
>>> - Campbell
>>> _______________________________________________
>>> Bf-committers mailing list
>>> Bf-committers at blender.org
>>> http://lists.blender.org/mailman/listinfo/bf-committers
>>>
>>
>>
>>
>> --
>> With best regards, Sergey Sharybin
>> _______________________________________________
>> Bf-committers mailing list
>> Bf-committers at blender.org
>> http://lists.blender.org/mailman/listinfo/bf-committers
>
>
>
> --
> - Campbell



-- 
- Campbell


More information about the Bf-committers mailing list