[sf-perl] Book(s) for learning oo perl?

Quinn Weaver qw at sf.pm.org
Mon Jun 12 11:54:10 PDT 2006

On Mon, Jun 12, 2006 at 01:17:57PM -0500, Andy Lester wrote:
> On Jun 12, 2006, at 1:15 PM, David Alban wrote:
> > I just looked up Object Oriented Perl by Damien Conway on amazon.  It
> > says it's not available.  It was also out of stock at another
> > retailer.  (It's also, I believe, going on seven years old.)
> Then find a retailer where it's not out of stock.
> There is no better book on OO Perl, and it's one of the best computer  
> books ever.

I respectfully disagree.  _Object Oriented Perl_ is a good
intellectual exercise, I think, but a poor introduction to OO and an
even worse primer on OO Perl.  Damian 's approach is to enumerate
every existing approach to OO, detail its benefits and failings, and
then move on to consider a yet better solution.  That's great if you
want to understand his reasoning, but it means that 90% of the
technical detail is throw-away.

In fact, the book predates Damian's Class::Std, which is Damian's
final word on Perl OO, and which prefigures OO in Perl 6.  I think you
are much better off learning Class::Std and skipping _Object Oriented
Perl_ altogether.

What I recommend, then, is Damian's _Perl Best Practices_.  It covers
Class::Std.  It's much more concise (OO is just part of the book).

But first... you probably want to pick up a generic primer on OO
philosophy, and read it first.  That way you can separate the concepts
from the implementation, rather than trying to digest both at once.
Unfortunately, I don't have any recommendations; all the treatments
I've seen are mediocre.

One final hint in the same vein:  if this is your first time with
object orientation, you might consider training up on a language other
than Perl.  Perl makes OO a little weird, even with--or especially
with--the extensive massaging of Class::Std.  (That module uses
so-called "inside-out objects", which are really a hack to overcome
the shortcomings of Perl's scanty built-in OO support.  Few other
languages use them.)

If you go this route, Ruby would be an excellent choice.  So would Python.
I wouldn't choose Java; it makes life too hard by making you predeclare
types and method signatures.

I hope this helps.  Then, once you've wrapped your head around the OO
idea, you have to learn good OO design.  Some people grasp it
instinctively; some people create terrible mush.  Fortunately, it's a
learnable skill.  Write back!  We'll help vet your OO designs. :)

qw (Quinn Weaver); #President, San Francisco Perl Mongers
=for information, visit http://sf.pm.org/weblog =cut

More information about the SanFrancisco-pm mailing list