From kde-core-devel Sat Jul 05 18:28:10 2008 From: "Roland Harnau" Date: Sat, 05 Jul 2008 18:28:10 +0000 To: kde-core-devel Subject: Re: Consensus on the kdelibs coding style Message-Id: <476f836a0807051128i5ae7095ao3723e58b92b6f9c0 () mail ! gmail ! com> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=121528253412775 2008/7/5, Lubos Lunak : > 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.) Roland