kdelibs coding style

Zack Rusin zack at kde.org
Thu Jul 20 16:32:43 BST 2006


With much love from Russia comes temperature checker (prediction: it's 
hot! flaming hot!) in the form of a proposal for a common coding style 
in kdelibs.

It's something we talked about during the KDE Four meeting. The reason 
for it is that it's a pain in a butt to read through kdelibs code. 
Indention differs within files which makes a lot of them unreadable 
(oh, and btw shoutouts to George and Lubos for having indention styles 
that make grown may cry and baby jesus swear). Since KDE uses this 
thing called Qt, which also happens to be a library, it was agreed that 
it makes natural sense to adopt the style used in Qt. Attached is a 
file which describes Qt coding style. The idea is that it would be 
adopted for kdelibs. 

To make it clear, no mass reindenting would take place.. For already 
existing code the indention would be changed when a person would be 
editting it. So if you fix a bug in already existing code, you simply 
indent your code with the standard indention. This way history won't be 
messed up and we'll end up with consistant style in all files by the 
time KDE4 is out. The style is obviously mandatory for all new files.

No exceptions. Either everything or nothing. 

Well, the only exception are libraries that are not maintained in the 
KDE SVN (for example, if it ever happens, integrated KHTML/WebKit would 
be maintained outside KDE SVN and the coding style that applies to it 
is one chosen for this project - interestingly enough WebKit coding 
style is basically exactly like Qt coding style so that's not going to 
be an issue).

Oh, and this is of course only for kdelibs, in your apps/modules you can 
still use the 2.3 tabs indention or whatever your sick mind desires.

with not a whole lot love but a lot of perseverance 
your boy toy

-- 
If it's stupid but works, it isn't stupid.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060720/059bb456/attachment.html>


More information about the kde-core-devel mailing list