http://www.perlmonks.org?node_id=48973


in reply to Re:: Adam:: Re:: OO-style question
in thread OO-style question

How much more proof do you need besides http://www.deja.com, http://www.imdb.com, http://www.slashdot.org, http://www.etoys.com, http://cbs.sportsline.com, and any of the other top quarter of the Net that uses Perl from top to bottom?

Why is everyone still waiting for a verdict. It's in. Perl works, for little stuff, and for big stuff. Use it.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Perl Works, but that's not the problem.
by coreolyn (Parson) on Dec 30, 2000 at 19:45 UTC

    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.

      ActiveState, to pull a vendor out of a hat, offers support contracts for their distribution of Perl. That should satisfy your legal folks as far as the actual Perl environment is concerned. It's not a large leap to make the developer liable for the code used in the 3rd-party modules themselves, but that seems like an imperfect solution.

        I confess I haven't done much research into ActiveState as (unless I've made a huge misjudgement) this would only provide solutions for the intel side of the house, which is only a piece of the puzzle. If I take away the crossplatform bonus of Perl I loose one of the major crux's of my advocacy.

        coreolyn

Re: Re: Re:: Adam:: Re:: OO-style question
by Adam (Vicar) on Dec 31, 2000 at 07:42 UTC
    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.

      I agree with you that Perl is not always the right tool for the job. I even agree with you on some of what its weaknesses are.

      However I have to disagree on your belief that somehow other languages are necessarily better. My opinions have come up before. For instance I state them at length in RE (tilly) 1: Java vs. Perl from the CB. More (IMO good) points at RE (tilly) 3 (disaster): Java vs. Perl from the CB. There is no silver bullet for maintainability, and indeed it is a sore spot for the whole industry.

      That said, the kid you see breaking a Perl project will cause pain on a Java project as well. IMO the only good ways to use incompetent people are move them to someone you don't like, put them on data entry problems where you don't really care what they do, or invest the time and energy to make them competent. I prefer the last option but YMMV. But I don't consider it a good criticism of a language that it gives people who shouldn't be given responsibility the ability to cause damage if they are given that responsibility. To me that is, "Well, duh. Don't give them responsibility." But I would diss a language for making competent people unproductive...

      Now, Perl is not right for all problems. I agree that large OO projects are an example of a problem it is bad for. Another is complex GUIs. Another is anything where tight space/time optimizations matter. (Just ask jcwren for more on that.) So learn its strengths and weaknesses, then use it where it fits.

        says tilly Now, Perl is not right for all problems. I agree that large OO projects are an example of a problem it is bad for. Another is complex GUIs. Another is anything where tight space/time optimizations matter. (Just ask jcwren for more on that.) So learn its strengths and weaknesses, then use it where it fits.

        Being very new to programming -- self-taught and not a fast learner -- much of my time has been spent trying to decide which language to work on the most.

        Perl wins my time, not because of a technological benchmark, but because it proves itself the most practical solution. That is, as I've begun to conclude: the most important aspect of any language's practical value is, there must be a community practicing the language. It's from their use of it, that I've learned its usefulness.

        I learn from the users of the language, the mode of thought that taps into the power of its expressions. I observe from them how the language itself structures their thoughts and coaxes out new ideas. I observe how the language shapes, and is shaped by the ethic of the community. I learn in this way not only how to speak, but how to think that way.

        I'm discovering that a programming language is something like a natural language in that way. It does not consist only of its terms and syntax, its design and structure, its parts. Besides these low-level issues, a language is its users and the use they make of it.

        So, the aspect of Perl that most commends it to me as the best solution to most problems is, the way it's used by people to solve their problems. As long as Perl continues to be characterized by this push to improve, and helps others to improve (which includes an ethic capable of discerning who shouldn't be helped), it will continue to be the most natural choice for people looking for a practical solution, and the language itself will continue to improve.

        mkmcconn

      When speaking of OO methods, you wrote:
      > They need to be able to throw named exceptions which the > caller can choose to catch or not. die is the closest thing to a +n > exception in Perl, and eval is a long way from a try block.
      Have you tried using a custom Perl solution for this? Graham Barr's Error module (direct doc link) lets you use standard try and catch semantics for exception handling. I've not used it, because I've always just stuck w/ eval, because it works for me. :)

      You might also take a look at Exception::Class, a base exception class on which you can base any exceptions your system wishes to throw.

      You also wrote:

      > Worse, perl's sub routine simplicity of having subroutines > take a variable number of arguments ...
      Have you ever looked at Class::MultiMethods? It might help you in this area, if you like that sort of structured stuff. :)

      Gee, eval {} seems nearly identical to a "try" block to me. It is the "catch" part that you need to add, but several people have already done so. I think if more people were to try more of these modules then soon we'd have some improvement to some of them and then some agreement as to which ones work best and we might even end up with a "standard" module that ships with Perl and modules could start using structured exceptions and things would snowball from there...

      The lack of good subroutine prototypes is certainly a problem. Though there are modules that provide different replacements for that (Class::Contract is one that I don't think has been mentioned in this thread yet).

      A worse problem is the clumsy nature of Perl's inheritance. Books teaching OO tend to make a big deal of inheritance. Books teaching how to write good code in C++ make a big deal about avoiding inheritance (not avoiding it altogether, just avoiding it unless it is really called for, which it usually isn't). The case for this avoidance is much, much stronger for Perl. You can't inherit only the API (unless you use some module for that -- and the only API Perl defines is a list of method names anyway). You can't have subroutines that aren't also inherited. You can't inherit members (aka member data to those who like to call methods "member functions") (unless you use a module and the ones I've seen still leave much to be desired here). You can't do useless inheritance of useless class data (:

              - tye (but my friends call me "Tye")