From: Robert Klemme Date: 2003-04-02T01:47:15+09:00 Subject: Re: OO vs. procedural programming "Peter Ensch" schrieb im Newsbeitrag news:b6cdeh$i8v$1@tilde.itg.ti.com... > I'm just getting started w/ Ruby having worked with perl > for the past few years. I don't have much experience with > pure OO programming and I'm wondering if, when using a > pure OO language like Ruby, I should should make all my > programs OO. > > I people don't always write OO programs in Ruby, how do > they decide when to do so? Since ruby is pure OO we don't have to decide. :-) Seriously: that's not easy answered. Since you will be using the ruby std lib which is in fact a collection of modules and classes then you automatically have to code the OO way. The more interesting question to answer might be, when to start writing your own classes. That depends on the application. A simple file filter (aka grep and similar) can be written without the intervention of new classes. But even for this it might be reasonable to create your own class. For example, if you have to read the whole file before you can process it it is often reasonable to create one or more classes that hold the data from the file in a format that makes access convenient. So, I guess it boils down to: we don't decide when, we just always do. :-) Regards robert