FW: SPUG: Scope question

Asim Jalis asimjalis at yahoo.com
Wed Jun 12 13:40:18 CDT 2002


Peter Darley <pdarley at kinesis-cem.com> wrote:
> I don't write OO Perl, as I don't see any
> particular value in it unless you're putting
> modules out into the wild.  I find it far easier
> to conceive of functions as being things that
> transform data, so I can have any number of
> functions that get data into a certain state
> before passing it off to another function.

A couple of points. 

First, it is possible to do OO without using the
OO constructs. The OO syntax in Perl is convoluted
and can sometimes become awkward. 

A simpler way to do OO is to group functions
together so that they are acting on the same piece
of data, and then pass the data in as the first
argument. The functions are unadorned humble
non-OO functions. 

The main point here is that I don't want to know
what the data looks like on the inside. I just
want to know what I can do to it (using the
functions).

An example from C: the fprintf/fscanf family of
functions are really quite OO. They let you
interact with FILE data structure without knowing
what FILE looks like on the inside.

Second, the big advantage of OO for me is that it
allows me to wrap my mind around a lot of code at
once. In each object I just have to worry about
that object. I don't have to worry about the whole
system. This breaks the problem of programming
into small bite-sized chunks that are easier to
chew.

The other big advantage of OO is that it makes it
easier to write unit tests.
 
> Thanks for listening to my uninformed ramblings
> :)

Thanks for starting a really interesting
discussion. 

Asim

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org




More information about the spug-list mailing list