I'm not sure the $_consume() method should encapsulate the printing as well. That makes it difficult to replace the print method without breaking stuff. To tell you the truth, I think the biggest issue is f1() and f2(). The entire pp() experience isn't being refactored correctly. For one thing, the fact that f1() and f2() are separated is a smell to me. The bigger smell of the flag (that BrowserUk noticed) is gone, but that leaves the smaller smell of the two functions that (seemingly) do similar things.
Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
In reply to Re^2: Refactoring challenge.
by dragonchild
in thread Refactoring challenge.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |