Consensus on the kdelibs coding style

pfremy at kde.org pfremy at kde.org
Sat Jul 5 21:06:01 BST 2008


Michael Pyne wrote:
> On Saturday 05 July 2008, David Johnson wrote:
>> On Saturday 05 July 2008 07:13:33 am Thiago Macieira wrote:
>> > The major point is actually deciding on the "4 spaces, NO TABS"
>> > (capitalisation mine, but should be there). Tabs are inherently evil and
>> > should be banned altogether, to the point of warranting a wide-reaching
>> > tab-replacement commit (svn can now ignore whitespace changes in
>> > annotation, git has been able to do it for years).
>>
>> Of all the style war battles, this is the only one I really care about.
>> Tabs are 8 spaces wide by default, yet certain editors insist on one tab
>> per level of indent. Almost as evil as tabs is the mixed mode indentation
>> that some other editors use.
> 
> This (mixed-mode) is really almost super-evil. vim seems to do this by
> default and it's so annoying. So even if you fix it on your editor the
> next guy to go "vi foo.cpp" has a very good chance of screwing up the
> spacing if they haven't fixed their vim either.

That's true unless you use IndentFinder:

http://www.freehackers.org/Indent_Finder

The small script will scan the file, understand the indentation and
configures vim properly. The script itself is in python and could be
used by any editor. I think all editors should actually contain
something like adapting the indentation to the file they are editing and
not the other way round.

I'll be happy to rewrite IdentFinder in C++ if anybody asks.

	cheers,

	Philippe





More information about the kde-core-devel mailing list