[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon
From: |
Ian Molton |
Subject: |
Re: [Qemu-devel] [RFC][PATCH v2 15/17] guest agent: qemu-ga daemon |
Date: |
Mon, 25 Apr 2011 13:27:57 +0100 |
On Fri, 2011-04-22 at 13:51 +0200, Jes Sorensen wrote:
> > What kind of coding error does splitting this out aim to prevent?
> > missing break; / return; statements? Because I dont see how it
> achieves
> > that...
>
> Hiding things you miss when reading the code, it's a classic for
> people
> to do if(foo) bleh(); on the same line, and whoever reads the code
> will
> expect the action on the next line, especially if foo is a long
> complex
> statement.
>
> It's one of these 'just don't do it, it bites you in the end' things.
Meh. I dont see it that way...
Sure, if it was one line out of 20 written that way, it would be weird,
but as is, its just part of a block of identical lines.
I dont really see a parallel with the if() statement either since the
condition in the switch() case isnt on the same line as such. I must
admit that I only write one-liner if statements if the condition is
short though.
-Ian
[Qemu-devel] [RFC][PATCH v2 13/17] guest agent: command state class, Michael Roth, 2011/04/18
[Qemu-devel] [RFC][PATCH v2 14/17] guest agent: core marshal/dispatch interfaces, Michael Roth, 2011/04/18
[Qemu-devel] [RFC][PATCH v2 17/17] guest agent: build qemu-ga, add QEMU-wide gio dep, Michael Roth, 2011/04/18
[Qemu-devel] [RFC][PATCH v2 11/17] qmp proxy: build QEMU with qmp proxy, Michael Roth, 2011/04/18
Re: [Qemu-devel] [RFC][PATCH v2 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent), Jes Sorensen, 2011/04/21
Re: [Qemu-devel] [RFC][PATCH v2 00/11] QEMU Guest Agent: QMP-based host/guest communication (virtagent), Jes Sorensen, 2011/04/21