Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Re: Re: perl OO - to use or not to use

by leriksen (Curate)
on Sep 16, 2003 at 00:53 UTC ( #291691=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: perl OO - to use or not to use
in thread perl OO - to use or not to use

To some extent I agree with you - very few non-trivial applications are easier/better in procedural vs OO (and I agree with you on the functional approach too - but just try writting a useful Haskell version of a nontrivial app - sheesh!!). It just depends on how wide your values for non-trivial are :-)
I find I use procedural approach heavily in the startup of an app development, and once that is humming, focus on the OO from then on. E.g. I usually focus procedurally during the startup of my app on

  • reading parameters (using Getopt::Long exclusively)
  • setting up logging (using Log::Log4perl exclusively)
  • setting up filehandles (using IO::File exclusively)
  • setting up timing/stats
  • when required, setting up DBI (using DBI)

after that I start doing the decomposition dance
oh, and btw, I make it a rule never to write the same code twice in an app - I always factor out to a sub or method. This help highlight new candidates for classes/modules faster. And if I notice that much of the code is avariation on a theme, I stop and try to find some abstraction that allows me to parametize that code.
I think it was Donald Knuth who said
Every problem in computer science can be solved with either more - or less - abstraction. Experience tells you which one of those to apply.

Comment on Re: Re: Re: perl OO - to use or not to use

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://291691]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (10)
As of 2015-10-09 12:34 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (241 votes), past polls