[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: Consensus on the kdelibs coding style
From: Cristian Tibirna <tibirna () kde ! org>
Date: 2008-07-07 15:19:26
Message-ID: 200807071119.41111.tibirna () kde ! org
[Download RAW message or body]
On Saturday, 5 July 2008, Lubos Lunak wrote:
> On Saturday 05 of July 2008, Thiago Macieira wrote:
> > Lubos Lunak wrote:
> > >which defines even completely useless things like
> > >requiring {}'s around a single-line if() body statement (where's the
> > > point in that?), I'd prefer something simple.
> >
> > Just for information, that requirement is not in the Qt style. That's
> > actually one of modifications that was added to the KDE Libs style on top
> > of the Qt style. If you look at Qt code, you'll see that is not used.
>
> I wonder how it got there then, especially when the proponents seemed
> quite strict on "no modifications".
It was there since very early in KDE life. And from 15 years of student
support work, I can see the usefulness:
Code like
if (condition)
original_procedure_line;
Becomes very easily, in hands of novices, something like:
if (condition)
new_fake_block_procedure_line_that_would_have_required_brackets;
original_procedure_line;
with subtle but possibly very ugly effects.
(... and people are bikeshedding on Python indenting...)
Mandatory ubiquitous use of '{' and '}' guards efficiently annul the
probability of such errors.
That being said, in the later years, having lost patience with unwaranted
illiteracy, I learned to like the non-bracket one-liners, along with learning
to automatically reindent (in some competent editor) any file that I didn't
produce or that got touched by strangers since my last visit.
Now, I don't intend to participate in this debate (I'm an uofficial member
of "minimal law better law" party). But I just wanted to answer the
rethorical question (and gloat over my detailed -- and perhaps majorly
deluded -- memories of the KDE history)
Thanks.
--
Cristian Tibirna
KDE developer .. tibirna@kde.org .. http://www.kde.org
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic