Re: [PATCH 006 of 6] md: Add support for reshape of a raid6

3 messages, 3 authors, 2007-02-23 · open the first message on its own page

Re: [PATCH 006 of 6] md: Add support for reshape of a raid6

From: Neil Brown <hidden>
Date: 2007-02-22 02:40:45

On Wednesday February 21, akpm@linux-foundation.org wrote:
On Tue, 20 Feb 2007 17:35:16 +1100
NeilBrown [off-list ref] wrote:
quoted
+		for (i = conf->raid_disks ; i-- ;  ) {
That statement should be dragged out, shot, stomped on then ceremonially
incinerated.
An experiment in lateral thinking?  I liked it, but there is no
accounting for taste.
What's wrong with doing

	for (i = 0; i < conf->raid_disks; i++) {

in a manner which can be understood without alcoholic fortification?
I guess...  "Egoless programmer" and all that, "write for others to
read, not for the compiler", and as you say it comes to the same
number of bytes of code on common architectures.
ho hum.

I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.
I must right code that Andrew can read.


NeilBrown

Re: [PATCH 006 of 6] md: Add support for reshape of a raid6

From: Andrew Morton <akpm@linux-foundation.org>
Date: 2007-02-22 02:57:44

On Thu, 22 Feb 2007 13:39:56 +1100 Neil Brown [off-list ref] wrote:
I must right code that Andrew can read.
That's write.

But more importantly, things that people can immediately see and understand
help reduce the possibility of mistakes.  Now and in the future.

If we did all loops like that, then it'd be the the best way to do it in new code,
because people's eyes and brains are locked into that idiom and we just
don't have to think about it when we see it.

Re: [PATCH 006 of 6] md: Add support for reshape of a raid6

From: Helge Hafting <hidden>
Date: 2007-02-23 12:18:15

Andrew Morton wrote:
On Thu, 22 Feb 2007 13:39:56 +1100 Neil Brown [off-list ref] wrote:

  
quoted
I must right code that Andrew can read.
    
That's write.

But more importantly, things that people can immediately see and understand
help reduce the possibility of mistakes.  Now and in the future.

If we did all loops like that, then it'd be the the best way to do it in new code,
because people's eyes and brains are locked into that idiom and we just
don't have to think about it when we see it.
I have done lots of loops like that and understood it immediately.
Nice, short, _clear_ and no - a loop that counts down instead of
up is not difficult at all. 
Testing "i--" instead of "i >= 0" is also something I consider trivial,
even though I don't code that much.  If this is among the worst you
see, then the kernel source must be in great shape ;-)

Helge Hafting
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help