in reply to Re^4: Moose and caller() for current method
in thread Moose and caller() for current method
it is useful to know the action being executed
Useful to whom? Cos code doesn't give a toss what it is called; or even if its caller has a name.
If you are writing subroutines that do different things dependant upon where they are called from, you've completely missed the point of OO, encapsulation and even structured programming.
You are violating the first principle of reusable encapsulation--Loose coupling--by building in tight dependency by design. In other words, you've re-invented spaghetti code.
This current fad for runtime introspection is the single biggest backward step in programming in the last 30 years.
"Modern Perl" be damned. It is nought more than another attempt to introduce programming by rote. But like painting by numbers, it is never going to produce works of art; nor even practical craft.
It's the new "New Math". And history shows what happened to that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Moose and caller() for current method
by chromatic (Archbishop) on Jul 13, 2010 at 19:22 UTC | |
by BrowserUk (Patriarch) on Jul 13, 2010 at 21:52 UTC | |
by chromatic (Archbishop) on Jul 14, 2010 at 02:13 UTC | |
by BrowserUk (Patriarch) on Jul 14, 2010 at 03:00 UTC | |
by chromatic (Archbishop) on Jul 14, 2010 at 03:35 UTC | |
| |
|
Re^6: Moose and caller() for current method
by moritz (Cardinal) on Jul 14, 2010 at 09:37 UTC | |
|
Re^6: Moose and caller() for current method
by ait (Hermit) on Jul 18, 2010 at 14:45 UTC | |
by BrowserUk (Patriarch) on Jul 18, 2010 at 17:50 UTC |