On Sat, Sep 6, 2014 at 12:59 AM, Andrew Vit <andrew / avit.ca> wrote:
> On 14-09-05, 1:09, Ryan Davis wrote:
>>
>> I can't disagree with this more. There's nothing about "true" OOP that
>> says each and everything is a unique and precious blossom and must have hand
>> crafted code.
>
> For what it's worth, I absolutely agree with you as long as the hash serves
> the purpose. There's a reason I wrote "true" OOP in quotes there. Maybe I
> should have said "academic"?

Sounds slightly better to me.  But even then there is the issue that
(academic or not) OOP does not mandate a _single_ correct solution.
Giving that impression is misleading.  Any software design should be
catered to the problem at hand that needs solving.  That could be a
single Hash, a new class like you suggested or even a much more
complex class with automated indexing and whatnot.  It all depends on
what the program is supposed to do eventually.

The core treat of OO to me is that you bundle data with the allowed
operations on it and can ensure that the internal state of an object
always stays within some bounds that the code establishes.  That
avoids errors and mistakes.  For me the concept of "Abstract Data
Type" comes very close to this property of OO.

And note, that I did not even mention inheritance, which often seems
to be seen very fundamental to OO.  I rather think the fact that you
can have different implementations of the same abstract API is much
more important.  But I'm digressing... :-)

Kind regards

robert

-- 
[guy, jim].each {|him| remember.him do |as, often| as.you_can - without end}
http://blog.rubybestpractices.com/