Consensus on the kdelibs coding style

Roland Harnau truthandprogress at
Sat Jul 5 19:28:10 BST 2008

2008/7/5, Lubos Lunak <l.lunak at>:
> On Saturday 05 of July 2008, Thiago Macieira wrote:

>> A distant second is the placement of the braces. Your style is closer to
>> my own preferred style, actually, but I'd still advocate for matching
>> Qt's simply because of pragmatism.
>  Which pragmatism? A small number of people working on Qt and KDE at the
> same  time, or some other codebase which uses it? According to my search on
> kdecore and kdeui there is a slight preference for trailing { (i.e. Qt), but it's
> not  vast majority and I think that strictly technically speaking aligned {} are 
> better for readability (e.g. in the switch/case unindented case, a trailing
> { seems quite hard to see).

I don't see how it is possible to speak about readability  "strictly technically", at least not without a scientific definition of the term in one hand and a bunch of empirical studies proving your point in the other. I generally prefer trailing braces, but  I can live with the current style  (trailing braces only for control statements). What I don't like  are braces for a single-line body of  a conditional statement  and the C-style variable declarations T *v and T &v instead of T* v and T& v. (and I like to indent the body of namespaces.)


More information about the kde-core-devel mailing list