On 10/06/15 00:29, Walter Bright wrote:
First off, D does not allow "shadowing" local variable declarations.
Secondly, if you've got a lot of global variables, you've got a program
design problem anyway. And lastly, naming everything "diskIdx" is a
problem of your own creation.
The first one is called so because it names the index of the disk within a RAID stripe. It's probably an iterator.

How would you call the second time I use such an iterator?

You might argue that the function that extracts the disk index should be named something more verbose (i.e. - extractTheDiskIndex), but then you are just repeating Ola's criticism[1] of D as if it is a desirable thing.

People on this list hold a certain paradigm in their head when they make design decisions. That's fine, except if you hold on to this paradigm and assume anything that violates it is bad code, you are going to end up with Go: a language only fit for those problems that happen to fall within that paradigm.

People have preconceptions on how code should look like. I would humbly like to ask people to stop ->assuming<- that anything that violates them is bad code.

Shachar

1 - http://forum.dlang.org/post/uvajlhfztejvwnubs...@forum.dlang.org

Reply via email to