qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 0/3] Fix broken if statements


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH 0/3] Fix broken if statements
Date: Sun, 01 Aug 2010 22:20:38 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100620 Iceowl/1.0b1 Icedove/3.0.5

Am 01.08.2010 19:25, schrieb Andreas Färber:
Am 22.07.2010 um 18:18 schrieb Stefan Weil:

Am 21.07.2010 22:05, schrieb Joel Schopp:
I have decided to apply the broken window theory of crime
http://en.wikipedia.org/wiki/Broken_windows_theory to code, and
more specifically to qemu[:]

I'm hoping that fixing seemingly trivial
bugs will actually fix some more serious bugs, make the code run
just a bit smoother, or at the very least leave us with easier to
maintain code.

Joel Schopp (3):
remove dead code from hw/loader.c
fix variable type in qemu-io.c
remove pointless if from vl.c
[...]
How did you apply the broken window theory of crime to software code?
Is this still a secret, or can you tell us more?

If you consider Coding Style and Best Practice violations a crime (vandalism / broken window), then e.g. removing dead code is to prevent future code dead-on-arrival and - as criminal escalation - bugs.

Applying it further might mean that someone could provide a patch either adding or removing braces for all single line statements in the code base so that the broken window argument (someone broke the rule so I can, too) no longer holds for new patches arriving. :)

Regards,
Andreas


Agreed.

I should have been more precise in formulating my question:

Is there some magic (= tool) which detected these "broken windows"
in hw/loader.c, qemu-io.c and vl.c, or was it just a manual code
review or luck?

It's not too difficult to write a tool which detects most typical violations
of coding style (Aurelien suggested such a filter for git), but Joel's "broken
windows" are less obvious.

Regards
Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]