In-Reply-To: <[email protected]>
On Thu, 5 Jan 2006 at 16:28:02 -0500, Dave Jones wrote:
> > Why not:
> >
> > printk(space == 0 ? " " : "\n");
> > space = !space;
>
> readability ?
Well, if I were going for _un_readability I'd have suggested:
printk(space = !space ? " " : "\n");
:)
> Personally, I despise the ternary operator, because it makes me
> stop to try to parse it every time I see it.
I think it's a psychological thing because it makes you spend as
much time parsing a single line as it would to parse a whole
if-then-else and it just feels wrong somehow.
> With the code I wrote
> it's blindlingly obvious what is going on.
For simple espressions I think it's about the same, but like you said
it's a personal thing. A soon as you start nesting cases the 'if'
becomes much clearer. (People who nest ternary expressions should
be taken out and shot.)
--
Chuck
Currently reading: _Thud!_ by Terry Pratchett
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]