Messages in this thread | | | Date | Fri, 6 Jan 2006 13:36:45 -0500 | From | Chuck Ebbert <> | Subject | Re: dual line backtraces for i386. |
| |
In-Reply-To: <20060105212802.GR20809@redhat.com>
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 majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |