-
(Difference between revisions)
(2 intermediate revisions not shown) Line 6: Line 6: [http://www.ruby-lang.org/en/documentation/quickstart/ Ruby in Twenty Minutes][http://www.ruby-lang.org/en/documentation/quickstart/ Ruby in Twenty Minutes]+ + == Notes ==+ + Objects exist so that we can have data and logic in neat little packages. It's not necessary to remember all the time how to manipulate various kinds of data; by giving the objects methods, we teach them how to operate on themselves. That frees us to concentrate on the larger issues of how our programs are to behave.+ + We also looked at variables today, examining their character and scope. Most Ruby variables behave as pronouns—that is, temporary labels referring to objects and having no meaning outside the structural units (such as methods) within which they are used. More than one variable by the same name can refer to different things, so long as they do not share the same scope.+ + [[polymorphism]]+ + [[category:WebDev]]+ [[category:Programming]]+ [[category:Ruby]]Current revision as of 02:11, 17 March 2010
Ruby Tutorials
Notes
Objects exist so that we can have data and logic in neat little packages. It's not necessary to remember all the time how to manipulate various kinds of data; by giving the objects methods, we teach them how to operate on themselves. That frees us to concentrate on the larger issues of how our programs are to behave.
We also looked at variables today, examining their character and scope. Most Ruby variables behave as pronouns—that is, temporary labels referring to objects and having no meaning outside the structural units (such as methods) within which they are used. More than one variable by the same name can refer to different things, so long as they do not share the same scope.
-
Meta