Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Read errors
From: Linus Nielsen Feltzing (linus_at_haxx.se)
Date: 2003-03-14


Henrik Backe wrote:
>>I don't see the difference. The if(func()) and the if(0 != func()) are
>>the same thing, and I prefer the first one, because there is less fluff.
>>The only issue is the "polarity" of the return code.
>>
> The only difference between them is that one contains hidden magic.

Magic? Not at all. C is not magic. The if(func()) construct is a de
facto standard in the C language. Look around you, this is how C is
written, like it or not. I prefer C code that is written like that,
because then it looks like any other C code.

If you write it differently, the C programmer has to look twice to see
what the programmer has intended to do, since the construct is not the
usual one. Constructs like if(0 != func()) catches my eye and leads me
to thing "uh uh, this looks fishy, what is he trying to do?".

/Linus



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa