in reply to Re^2: a simple exercise in readability
in thread a simple exercise in readability
I like things broken up and named. For a relatively simple operation like this, it doesn't make as much of a difference. Yours is shorter and still fairly easy to understand (easier with a comment). I'd say it's a matter of taste.
One thing that might recommend my version over yours is a bug that we both had (I've edited mine since), namely the range length should be ($end - $start + 1). I might say that mine (with the name) makes this bug more obvious. Then again, maybe not. Someone might read the variable name and not the formula, and just assume it's right when it's not.
|
|---|