Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: To use or not to use OO Perl

by DrHyde (Prior)
on Oct 25, 2004 at 10:52 UTC ( [id://402190]=note: print w/replies, xml ) Need Help??


in reply to To use or not to use OO Perl

Other monks have commented about OOish code being reusable. This is a myth. Or at least, it's a myth that it is any more reusable than non-OO code. For example, look at the standard C library. It's used by everything you ever write in perl, and yet not OO. Or look at any of the hundreds of modules on CPAN which just provide some useful functions but with no OO stuff, such as Data::Compare, Language::Functional and Net::CIDR. Perl's OO doesn't even easily give you one of the other big wins often touted for OO.

Where OO is helpful is that working with objects instead of home-grown complex data structures provides a useful layer of abstraction that lets us hide complexity from ourselves, so we have to maintain less state information in our poor little branes. That benefit alone makes it worth using.

As for your two questions - the answer to the second is simplest. It's "no". And the reason is the answer to the first - I write OO code when I feel that it helps me solve the problem best, which I suppose is a bit wishy-washy. Sorry.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-23 15:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found