Consensus on the kdelibs coding style

Marc Espie espie at nerim.net
Wed Jul 9 14:58:41 BST 2008


On Sun, Jul 06, 2008 at 11:01:39PM +0800, Lucas Murray wrote:
> On Sun, Jul 6, 2008 at 9:38 PM, Kelly Miller <lightsolphoenix at gmail.com> wrote:
> >
> > On July 5, 2008 9:41:23 am Lubos Lunak wrote:
> >> - "4 spaces, no tabs" - this appears to be the most used style in kdelibs,
> >> and other options don't seem to have big advantages
> >
> > Can someone explain to me what's so evil about tabs?  Personally, I hate
> > stumbling across spaced code indents, because they're horribly inflexible,
> > can't be resized at all, and require the programmer in question to remember to
> > hit the space key X times for an indent.
> >
> 
> Tabs are okay in most cases, however when they are used to align
> multiple lines by mixing in spaces with them things get a little messy
> as not everyone has their tab size set to the same amount. Some people
> use the default 8, a large amount use 4 and a few even use 2 character
> indents. Using spaces completely removes this problem. Take for
> example the following for-loop, I have repeated twice to so what it
> would look like if the person that wrote it used 4 character indents
> while the other uses 8:

Using anything but the default 8 for tabs is asking for trouble.

It's a bit like writing code in your own idiosyncratic style: just
don't do it.

4 chars tabs is just misplaced hubris. It just says `oh, look, I'm
so important, other people should bow to me and set their tabs to the
same size just to look at my code.'

Just the opposite of team work.

(stepping down off the soapbox now...)




More information about the kde-core-devel mailing list