[Digikam-devel] Re: Code not understandable

Martin Klapetek martin.klapetek at gmail.com
Fri Nov 19 15:31:29 GMT 2010


This code is actually from Marcel, but I was the one who put it in there
with copy-paste method :) Ok, I'll fix it (and also I'll be more careful
next time to review it with the coding style guidelines).

Marty

On Fri, Nov 19, 2010 at 16:13, Andi Clemens <andi.clemens at gmx.net> wrote:

> Hi,
>
> the following code is not understandable, it is not clear wether the
> following
> lines are ment to be IN the foreach statement or outside of it:
>
> GSOC2010 branch:
> libs/database/imageinfo.cpp (lines 672-679).
>
> It is not clear if the second if-statement belongs to the foreach loop. If
> it
> does, the code is wrong.
>
> This is why I beg you (:-)):
> Please use curly brackets, ALWAYS!
> At work we had so much trouble because of someone avoiding them for single
> line code blocks, our customer finally found a bug because of this (which
> is
> BAD for a software company, the customer shouldn't find this :-)).
>
> The problem is that whenever you add code, chances are that you get
> misleading
> / wrong code like the example above.
>
> So please, add curly brackets, everytime. It is not Python were indention
> is
> clear enough, in the above example it is not and the code might be wrong.
>
> Martin,
>
> since you made the change, could you please fix it and set the curly
> brackets
> accordingly?
>
> Andi
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20101119/91939749/attachment.html>


More information about the Digikam-devel mailing list