Consensus on the kdelibs coding style

Andreas Hartmetz ahartmetz at gmail.com
Tue Jul 8 21:31:50 BST 2008



On Sunday 06 July 2008 15:38:08 Kelly Miller 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.

The reason seems to be that editors suck at dealing with tabs.
Tabs only work correctly if you use them like

TAB if (reallyLongConditionAndStuff &&
TAB     thatOtherCondition) {
TAB TAB doSomething();
TAB TAB doSomethingElse();
TAB }

and some very well-known editors don't do that correctly out of the box. They 
also don't show a visual difference between tabs and spaces so you are 
screwed.
Kate does not have such problems and I like tabs. I do not use them in kdelibs 
however and I have untabified some code of mine, too.

Executive summary: Nice idea that doesn't work with existing tools.
[As opposed to "evil right from the start" :)]
-- 
Ooooh scary. How about "King o' the spoiled potato salad?"




More information about the kde-core-devel mailing list