Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I'm not saying that the approach of directly setting/changing data is good design, but it's neither oldfashioned nor uncommon. The Moo* "object" builders encourage data hiding, and PBP and Damian's OO book go to even more extremes. Data hiding / data encapsulation certainly are good approaches especially if you are working with a large codebase where different people make changes. But none of this warrants "oldfashioned" or "uncommon" as adjective. Maybe "unwise" or simply "direct" instead of "indirect" or "encapsulated" are the better adjectives. But all approaches that add another layer of indirection between the intention to set a value and the hash access make things slower. In reply to Re^3: Language design: direct attribute access and postponed mutators (Perl Vs Python)
by Corion
|
|