[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    [Kde-pim] Re: Kdepim coding style: indentation
From:       David Jarvie <djarvie () kde ! org>
Date:       2011-03-04 0:40:59
Message-ID: 201103040041.09413.djarvie () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Tuesday 01 March 2011 18:35:40 Cornelius Schumacher wrote:
> On Tuesday 01 March 2011 David Jarvie wrote:
> > I'd like to propose that the kdepim coding standard
> > http://community.kde.org/KDE_PIM/Development/CodingStyle/Korganizer should
> > be amended to allow indentation with either 2 or 4 spaces. To avoid
> > confusion when reading code, the two indentations should not, of course,
> > be mixed together. The standard should stipulate that the same indentation
> > should be used throughout each source file. Alternatives might be that
> > each subdirectory, or each function, can have its own indentation.
> 
> Changing indentation rules seems to me like one of the most unproductive 
> things you could do, and a rule allowing two different indentations doesn't 
> deserve the name rule.
> 
> The only change, I would (hesitantly) understand, would be to replace the KDE 
> PIM coding style by the kdelibs one to get overall more consistency. This 
> still would open the nightmare of migrating from one style to another.
> 
> Frankly, I think there are way more important things to spend time on than the 
> indentation rule, so I'd avoid changing it at all. Let's focus on the 4.6 
> release for example.

Personally, I find 2-space indentation makes code more difficult to read, because \
it's more difficult to judge whether source lines which are separated by multiple \
indented blocks actually do line up or not. It's much easier to see whether source \
lines align when 4-space indentation is used. So I would argue that it actually _is_ \
productive to allow indentation of 4 spaces. I'm not suggesting that existing code \
should be reformatted, just that the alternative should be explicitly allowed as an \
alternative, with suitable provisos to ensure that the two formats aren't mixed.

Because the coding standard has in practice been adopted by more than just the \
modules listed in the wiki page, I think it's a good idea given the apparent general \
support for 4 spaces, to amend the standard. This way, people writing new modules or \
sub-modules who might be inclined to follow the standard can feel free to adopt \
4-space indentation if they wish.

-- 
David Jarvie.
KDE developer.
KAlarm author -- http://www.astrojar.org.uk/kalarm


["signature.asc" (application/pgp-signature)]

_______________________________________________
KDE PIM mailing list kde-pim@kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic