[oak perl] Lexical vs. Package variables

Zed Lopez zed.lopez at gmail.com
Thu Feb 10 14:14:19 PST 2005


> More complicated, yes.  But I need to be able to enlarge my thinking so I
> can grasp more complicated programming models.  I can't believe I'm still
> having a hard time "getting" object-oriented programming.  So many people
> are programming Java!

It is a leap to "get" OOP... it's a fundamentally different way of
looking at programming, as being a matter of passing messages among
objects instead of passing data among procedures.

"A Little Ruby, a Lot of Objects" at

http://www.visibleworkings.com/little-ruby/

is a pretty good introduction to thinking in these terms (it's
Ruby-based, but it's more about OOP with Ruby for examples than about
Ruby.)

A lot of Perl guides to OOP suffer from an emphasis on _how_ one
implements OOP in Perl without much content on how to think in terms
of OOP or why it's valuable.

And something that's easy to miss in guides on implementing OOP in a
given language is that OOP is a part of a larger methodology of
problem analysis, specification and design, not just an implementation
technique. (I missed this for a long time.)

Finally, Perl's OOP implementation is kind of clunky -- the programmer
has to think about a lot of low-level details to do things right than
s/he would in other languages. This doesn't exactly help the OOP
beginner to get it.

(And while there are lots of people programming Java, I'd be willing
to bet that a large number don't really get OOP, and are thinking
procedurally and writing bad Java.)


More information about the Oakland mailing list