in reply to How to best pass on the context / wantarray?
This, on the face of it, seems to be a Bad Idea™. Cute, but bad. There may be situations where it makes sense to suborn a verb to report a status depending on calling context, but this is not a good example. If I see a sub called move_xxx I expect movement to happen. The implication here is that the calling object is updated or not depending on calling context, and as we know calling context can be rather subtle at times! What is the context in the following case for example?
get_wibble_cursor ()->move_xxx ()Although it has nothing like the cuteness factor, simply using a differently named method makes the code both easier to write and to understand, and probably shorter too. In this case move_xxx and moved_xxx would be good pairs.
DWIM is Perl's answer to Gödel
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to best pass on the context / wantarray?
by Corion (Patriarch) on Mar 26, 2006 at 18:31 UTC | |
by GrandFather (Saint) on Mar 26, 2006 at 19:06 UTC |