Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Why get() and set() accessor methods are evil

by Abigail-II (Bishop)
on Nov 25, 2003 at 12:12 UTC ( [id://309961]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to •Re: Why get() and set() accessor methods are evil
in thread Why get() and set() accessor methods are evil

I don't see how making attributes private to the class instead tucking them away into a reference makes people not treat objects as glorified structs using accessors to get to the internals.

For me, objects are state-keepers. Methods may cause the object to change state, or they may be used to interrogate the object about its state (or both). How to object keeps its state however, is something only known the the class(es) of which the object is an instance.

Abigail

  • Comment on Re: Why get() and set() accessor methods are evil

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://309961]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.