Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: To use or not to use OO Perl

by TedPride (Priest)
on Oct 22, 2004 at 14:54 UTC ( [id://401500]=note: print w/replies, xml ) Need Help??


in reply to To use or not to use OO Perl

You use OO when the code is likely to be reused, or when the project is large and you need a fairly rigid structure to make testing and documentation possible.

Replies are listed 'Best First'.
Re^2: To use or not to use OO Perl
by gothic_mallard (Pilgrim) on Oct 22, 2004 at 14:59 UTC

    Surely that explanation applies to modules in general - not just of the OO flavour?

    Modules are by nature designed to facilitate code reuse and naturally they (should) come with their own documentation.

    How OO lends to a "fairly rigid testing structure" I'm not sure as, again, this seems to come under the heading of modules in general.

    --- Jay

    All code is untested unless otherwise stated.

Re^2: To use or not to use OO Perl
by exussum0 (Vicar) on Oct 24, 2004 at 11:51 UTC
    That is generally true of functional programming as well, no? I feel OOP is great when you can seperate you can draw clear lines between your various forms of data and behaviorrs to be taken out on them. Parsers for instance, do not easily fall into this, as you might wind up witha single class called "parser" and a bunch of supporting functions.

    My counter example, is when I thought doing tests for a theory related project, graph colouring, would be silly to do as OOP. But if I can pass the different cases around as objects and the types of tests as classes, then it's a lot cleaner, to pass around the data and have functions available to call on them. Im not able to mix up a behavior with a piece of data. -s

    ----
    Then B.I. said, "Hov' remind yourself nobody built like you, you designed yourself"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 15:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found