From: "David A. Black" Date: 2002-12-04T05:08:22+09:00 Subject: Re: Ruby Book for People Who Aren't (Yet) Programmers Hi -- On Wed, 4 Dec 2002, Daniel Carrera wrote: > Objects > > What is an object? > > An /object/ is the fundamental unit of data storage in Ruby. > Objects have a /type/ (the type of data stored in them) and a /value/ > (the data itself). Some examples include: I know you don't want to throw everything at the learner at once, but I wonder whether this description of objects might make it a lot harder later to explain/grasp the idea of an object as an entity that encapsulates behaviors as well as data -- or even without data. Given the above description, even at the simplest level: Object.new you'd have to do a lot of backtracking and re-explaining to deal with questions like, "What is the data stored in this object? What type of data is it? What is the value of the data?" All of which would be completely reasonable questions, based on the data-storage-unit model. > !Note: Notice that the methods available depend on the object > ! type. Not all objects have the same methods. I might put it the other way around -- an object's "type" can only be inferred from its behavior. Again, I'm not trying to minimize the difficulty of explaining this to non-programmers, just thinking that there could be a certain amount of "But you said..." on the part of the readers. (They might also want to know why the #type method was deprecated somewhere in 1.7.x :-) David Black