...
I guess when you first look at this code it can be quite puzzling and you might prefer to use the more common approach for readability. Please let me know what you think.
No Format |
---|
double [] mySequence = new double[5]; |
...
double offset = 4; |
...
double step =0.2 |
...
for (int i=0;i<5;i++) |
...
{
mySequence[i]= offset + i * step;
}
|
see also http://visualstudiomagazine.com/articles/2009/04/01/make-your-code-clear.aspxhttp://stevenharman.net/blog/archive/2008/02/12/ruby-has-ranges-and-so-does-c.aspx