in reply to Re^2: Refactoring challenge.
in thread Refactoring challenge.
Why? Your assignment is to refactor the given code. That's a local operation, and doesn't have to depend on more context (then the assignment would be to refactor the code given, in addition to the context).Well...for starters, I didn't see if/where $depth was used outside of the subroutine. If it isn't used, I'd refactor the code so that $depth was scoped to the sub. Given the code, who knows? It's somewhat difficult to refactor code that you don't know the usage of. Truth be told, I did have a refactoring of it that I was ready to post, but then saw that I didn't have enough context upon which to base my refactorings. However, I felt that I might make better choices with more context.
thor
Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Refactoring challenge.
by dragonchild (Archbishop) on Mar 07, 2005 at 14:37 UTC |