On 2006-07-26, Hal Fulton <hal9000 / hypermetrics.com> wrote:
> Picklegnome wrote:
>
> [snip]
>
>> useful. However, I am befuddled by much of the code that I read. While it is
>> possible that I am simply not proficient at algorithm design and am unable
>> to follow algorithms that are designed by others, I suspect that it is more
>> deeply rooted in my lack of "getting" OO.
>> 
>> I've got no idea what resources might be used to overcome this problem, and
>> I am not even certain of my diagnosis. However, I would appreciate any
>> suggestions, resources, or help that you could offer me, because I am
>> excited about Ruby and eager to get past this blockage.
>
> Hmm, I could refer you to chapter 1 of _The Ruby Way_ (soon to be in
> a 2nd edition). But read it in the library first, don't spend your money
> on something you might not use.
>
> Chapter 1 of Damian Conway's _Object Oriented Perl_ is also good.
>
> I also enjoyed the discussion in Bertrand Meyer's book _Object Oriented
> Software Construction_. That's where I learned OO myself in 1990.

I was going to recommend Meyer's book, OOSC, but Hal beat me to it.
It contains a very thorough and well-thought-out explanation of the
concepts of OO programming and design.  Its emphasis is on static typing
(using the language Eiffel as the vehicle - Java, C++, and C# are other
examples of languages that use static typing), which is different from
the dynamic typing of Ruby, Python, Perl, Smalltalk, etc.; but to learn
OO thoroughly, you'll need to learn about both; and a lot of the concepts
in OOSC can be applied to dynamically-typed languages.  OOSC is rather
large, but if you have the patience (and if you're serious about learning,
you will have the patience), reading the sections of it that cover OOD/OOP
explicitly should be very beneficial.  (You might find the first edition
more concise, if you can find it.)

I have Conway's book, but I believe I skipped the first chapter when I read
the book a year or two ago to save time; but the rest of the book is good -
shows a very good grasp of OO -, so the OO intro. chapter is probably a
good way to learn some basics of OOP with a dynamically-typed language.  (I
see that OOSC is one of the books he recommends at the end of the chapter,
p. 19.)  (I'm not familiar with "The Ruby Way", so can't comment on it.)

One aspect of OO that is important (and seems to be sometimes neglected
by experienced developers) is that of creating clean, well-defined
(and documented) interfaces - where interface in this context means
the semantics and services that a well-designed class provides
to users/clients of the class.  These services are not tied to the
implementation of the class (or of the class's descendants/subclasses).
Not needing to care about how a class one is using is implemented allows
one to write code that is cleaner and less expensive to maintain than
otherwise.

>
>> 
>> P.S. I apologize for not using my real name; I understand this to be bad
>> etiquette. As I am a minor, my parents feel I am "at risk" and have asked me
>> to keep all such information private. I hope not to offend by following
>> their instruction.
>
> What?! Picklegnome isn't your real name??
>
> Seriously, anyone who complains about a minor not giving his real
> full name is an idiot (or worse). No one here could possibly be
> offended.
>
> Your parents are probably being over-cautious. Shows like _60 Minutes_
> and _Dateline_ love to talk about Internet predators, but the frequency
> is probably greatly overestimated. However IMO you're obligated to obey
> your parents. I'm old-fashioned that way.
>
> OT: In an age where millions of college graduates can't write a simple
> English paragraph, thanks for writing an intelligent and articulate
> email.
>
>
> Cheers,
> Hal
>
>
> "Times are bad. Children no longer obey their parents, and everyone is 
> writing a book."  --  Marcus Tullius Cicero
>


--