From: Kero Date: 2005-07-29T22:41:02+09:00 Subject: Re: Meaning of OO [was: Linux Journal article on Ruby] >> > Why is it that people have the idea the ojects are >> difficult for >> > programming newbies? >> >> Because many ppl learned OO *after* learning some >> imperative language? >> Which means they had to adapt their mind, instead of >> using an unspoiled >> brain. > > I always read this on this message board, but must > confess that being a programming and Ruby beginner, > i'm still not 100% regarding the true meaning of OO. OO provides a means of abstraction based on inheritance of functionality. Sometimes you change the implementation, sometimes you add functionality in a subclass. The assumption is that you will have many alike objects that will do the same or similar things. [I'm sure ppl have other definitions or even plainly disagree with what I wrote down here, I'm perfectly fine with that, see last remark of this posting, too!] If the abstraction is not available in the language, you can still program OO, but it will be more verbose. We were taught to program in Abstract Data Types in Pascal (back in 1992), basically put a record and the functions that work on it in one file. a subclass would be `cp from.p to.p` and adding the functionality. more verbose, maintenance nightmare. > How Ruby OO is different from any other OO? If it is different, knowing OO does not help when learning Ruby :) And maybe it is. Since everything is an Object in Ruby and Smalltalk, this has influence on how libraries _can_ be built (and are). C++ offers templates and MI (with certain 'issues'...) Self does not have the concept of a class. So, depending on which OO you learned first, it may be about one thing or another. +--- Kero ------------------------- kero@chello@nl ---+ | all the meaningless and empty words I spoke | | Promises -- The Cranberries | +--- M38c --- http://members.chello.nl/k.vangelder ---+