Z
zuzu
from a "functional in the small and OO in the large" and "don't cause
any state change in an object from outside that object itself"
perspective, i fail to understand the use of accessors (aka get/set
methods).
hence, http://c2.com/cgi/wiki?AccessorsAreEvil
ruby accessors are merely shortcuts for reading/writing @-scope values
in an object.
http://www.ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/accessors.html
however, to me this seems like breaking the object-functional elegance
of The Ruby Way.
again, it allows changing the state inside an object, from outside the object.
why not simply use methods as methods, as to pass in information to
retreive other information?
why create special syntax for initialization / object creation (.new)
that also isn't specified with the .initialize / .new method?
atm, accessors feel like an artifact from procedural/imperative OO.
what do you think?
(before anyone jumps on a .new vs. .initialize tangent, remember
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/4707 )
peace,
-z
any state change in an object from outside that object itself"
perspective, i fail to understand the use of accessors (aka get/set
methods).
hence, http://c2.com/cgi/wiki?AccessorsAreEvil
ruby accessors are merely shortcuts for reading/writing @-scope values
in an object.
http://www.ruby-doc.org/docs/ruby-doc-bundle/UsersGuide/rg/accessors.html
however, to me this seems like breaking the object-functional elegance
of The Ruby Way.
again, it allows changing the state inside an object, from outside the object.
why not simply use methods as methods, as to pass in information to
retreive other information?
why create special syntax for initialization / object creation (.new)
that also isn't specified with the .initialize / .new method?
atm, accessors feel like an artifact from procedural/imperative OO.
what do you think?
(before anyone jumps on a .new vs. .initialize tangent, remember
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/4707 )
peace,
-z