Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: OO-style question

by Adam (Vicar)
on Dec 30, 2000 at 01:35 UTC ( [id://48905]=note: print w/replies, xml ) Need Help??


in reply to OO-style question

If you have a method that seems correct for both A and B, could it be in the base class? Maybe you need a third level, ie a base class, from which C,D, and E inherit, and then A and B could inherit from C. C could even be an abstract class.

I disagree with Tye about Perl's inheritence. The big win in OO is inheritence, that and methods, so if you are going OO - go OO! The problem in Perl is that it is a bit kludgy when it comes to OO. Honestly, the more I work with Perl OO the more I think that a large OO project should be done in C++. It can be done in Perl (what can't be done in Perl?) but I'm not sure that it should be done in Perl. That is, large projects. Perl OO is great for smaller projects, even ones that use inheritence.

Replies are listed 'Best First'.
Re:: Adam:: Re:: OO-style question
by coreolyn (Parson) on Dec 30, 2000 at 03:13 UTC

    I think Perl still needs to be explored in large projects, and a comment about Perl being kludgy. It's Perl's kludginess I like. In comparison, Java seems so steril. The problem with Perl code on large projects is the level of efficiency demanded by the base functions(ok all of them).

    Perl's freedoms come at a price when coding in OO. The demands on the quality of every function begin to make exponential performance variations. In fact in the end (come on Perl 6!!) many of the exponetial problems that occur now may lessen with improved garbage collection, or is it that my code is just that sloppy ... hmmm

    Anyway I really think in the end Perl OO has a shot at Enterprise Acceptence even by the more conservative houses. C++ will always be highly demanded in such organizations, but Perl OO could open up even at the developer level in such corporations if it's objects could be of proven value in the enterprise's reusable component library.

    coreolyn Duct tape devotee.
    -- That's OO perl, NOT uh-oh perl !-)

        It's not the usability of Perl that is in as much doubt, as it is Perl's maintenance, administration, and re-usability that keeps it out of reach for developers in mainframe centric organizations.

        I have spent this last year writing white papers and giving lectures on Open Source and Perl in particular for my 'mainframe centric' company. We now have passed proof of concept for linux on the mainframe and have two internal clients (out of hundreds) that are pushing foward with Perl dependent projects.

        However, Perl is still stuck in the legal offices. This company has been able to collect money for every CPU cycle and re-use of every script from every project. Code that is neither owned by the corporation or liable by another company is kept out of production. Open Source is in total opposition to decades old philosophies and practices.

        I'd also like to point out that behind most of the sites you list as proof, are corporations that are being the clearing house for all the credit card transactions (and credit bureau checks) they process. You WANT a conservative organization managing such processes. Furthermore, none of the sites you list above, manage projects that span the number of various simultaneous projects, protocols, security and support issues that mainframe centric organizations tackle daily as a matter of course. (I'm not even going to get into the diametrically oposed mindset/culture of Open Source developers and Mainframe developers).

        Until Perl can prove it's feasability in managing reusable components accross diverse achitectures and projects as Java (i.e., Application Servers), it will remain just limited to 'duct-tape' operations in the Enterprise.

        This is not a goal that is too far off the horizon. Another part of my job is to evaluate Java Application Servers, and I can tell you they are all seriously overpriced, overbloated, over acronymed monstrostities that are little more than J2EE enabled webservers with high pressure marketing departments working harder than their technical departments are to support or develop them.

        coreolyn -- Duct tape devotee and corporate Open Source choir boy.

        Its not a question of "does it work, can we do it?" Thats a given, I wouldn't be hanging around this site if I didn't think that Perl works and that it can an amazing amount of stuff (almost anything, really...)

        The question is, "Should we use it for this?" and, in my opinion, there are places where the answer is "No." That has been my opinion for some time now, and it hasn't changed. I think that large scale OO projects are a perfect example of where Perl just doesn't cut it. OO methods need to be short and simple while garaunteeing correctness. They need to be able to throw named exceptions which the caller can choose to catch or not. die is the closest thing to an exception in Perl, and eval is a long way from a try block. Worse, perl's sub routine simplicity of having subroutines take a variable number of arguments and always return some value make for a large amount of additional code involved in checking arguments and returning undef when you want a void method.

        Large projects involve multiple programmers from various backgrounds and skill levels. You have to write the code so that the least experienced programmer can work on it with-out breaking everything. And lets face it, Perl just doesn't provide that level of support. Is that a bad thing? NO. That's what makes Perl so much fun - its flexability. But that's also what makes it innappropriate in a large scale project. Sure, an extensive set of coding standards and a crack team of programmers could do it, but eventually some fresh out of highschool skill-less kid is going to have to add a minor feature, and the whole thing will come crashing down. That's why people like C++ and Java and those other languages, they make for maintainable code.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-03-29 05:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found