From: Rick DeNatale Date: 2009-09-11T01:13:46+09:00 Subject: Re: How Are Variables Kept Independent of Each Other Yet Pass Values? On Thu, Sep 10, 2009 at 10:58 AM, Mason Kelsey wrote: > Still, for the old timers coming from a COBOL environment, this is a bit of > an annoyance. Yes, from my experience with COBOL flavored programers, admittedly years ago, COBOL really does almost everything in terms of moving data from place to place, or variable to variable, a feature it shares with it's generational friend FORTRAN. Pointers are foreign in these languages. Not that object references don't trip up C programmers as well, since thinking of variables as pointers isn't completely correct either. > And any instructor needs to be sure that the students > understand the significance of variables being objects.  They cannot just > say, "X is an object" and expect the student to extrapolate. Actually variables AREN'T objects, they are references to objects. You (actually other objects) interact with objects through variables. > They need to > explicitly tell the student how to transfer a value from one object to > another. I think in the long run, when you really start to *get* object-oriented thinking in a uniformely OO language like Ruby, you stop thinking of transfering values, and start thinking about interacting with objects by sending messages which return object references, and about how those messages affect the state of those objects. Keep at it, ask questions as surprises come up, and things will start clicking into place more and more. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale