12 ms·
this is never really brought up, but objects in ruby fully encapsulate their instance and class variables. the only way to get at them from the outside is by se
by jonhohle 18y ago
this is never really brought up, but objects in ruby fully encapsulate their instance and class variables. the only way to get at them from the outside is by sending an object a message asking for them (like Smalltalk or Objective-C). what appears to be setting a property on an object, is really calling a method: `foo.bar = 5` isn't directly setting the property, its calling a method named `#bar=`
in my opinion, this is powerful and elegant.
that being said, i have little experience with python, but what i've seen never wowed me. it seems like it has a well written collection of libraries, but that seems to come from the community more than the language. correct me if i'm wrong.