in reply to Re^15: Assignable Subroutines
in thread Assignable Subroutines
Both examples require more functionality in the code higher up. It's not OO due to insufficient encapsulation.I don't understand what you mean by "higher up". The code is almost identical to yours, just written directly in Perl, rather than some new and cumbersome operator application language.
I also don't understand what you mean about "insufficient encapsulation". Why is that? If you mean that I shouldn't be calling $_->salary directly than you are arguing circularly as this whole discussion is about whether that's OK or not. If you don't mean that, please tell me what I should have encapsulated but didn't.
As for the "deny by default" strategy, I get it free with Perl already, why do I need to write all that code to get it back again? Plus, allow by default is really easy to implement in "normal" Perl too so it's not like it was urgently in need of simplification. Also, it's a pain now to ignore some but not others and it's still under the control of the called object, not the caller. This may suit a framework (where things kind of become inside-out) but it's not the general case.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^17: Assignable Subroutines
by hardburn (Abbot) on Jan 27, 2005 at 21:19 UTC | |
by fergal (Chaplain) on Jan 27, 2005 at 22:10 UTC | |
by hardburn (Abbot) on Jan 27, 2005 at 22:30 UTC | |
by fergal (Chaplain) on Jan 27, 2005 at 23:32 UTC |