Slashdot Mirror


Why Corporates Hate Perl

Anti-Globalism recommends a posting up at O'Reilly's ONLamp on reasons that some companies are turning away from Perl. "[In one company] [m]anagement have started to refer to Perl-based systems as 'legacy' and to generally disparage it. This attitude has seeped through to non-technical business users who have started to worry if developers mention a system that is written in Perl. Business users, of course, don't want nasty old, broken Perl code. They want the shiny new technologies. I don't deny at all that this company (like many others) has a large amount of badly written and hard-to-maintain Perl code. But I maintain that this isn't directly due to the code being written in Perl. Its because the Perl code has developed piecemeal over the last ten or so years in an environment where there was no design authority.. Many of these systems date back to this company's first steps onto the Internet and were made by separate departments who had no interaction with each other. Its not really a surprise that the systems don't interact well and a lot of the code is hard to maintain."

20 of 963 comments (clear)

  1. Ockham's Razor tells me.... by arth1 · · Score: 5, Interesting

    ... that it's because it's too complex for them. There's no pointy-clicky visual perl, and absolutely no correlation between code size and complexity. So they can neither hire a $35k/year H1Ber to do it, nor count lines of codes to measure complexity.

    Oh, and without taking special measures, others get to see the code. Including sysadmins, who may laugh at the stupidity of the $35k programmers. Which doesn't make management look good.

    Perl is the enfant terrible of the programming world. A very smart one, but requiring the same smartness of its users.

    1. Re:Ockham's Razor tells me.... by Lonewolf666 · · Score: 4, Interesting

      I suspect they merely have associated "Perl" with "bad" because the existing cruft happens to be in Perl. Because there are very few managers who understand the difference between programming languages.

      Besides, you can create an unholy mess in any programming language.

      --
      C - the footgun of programming languages
    2. Re:Ockham's Razor tells me.... by Psychotria · · Score: 4, Interesting

      And "deliverables" is just as stupid a metric (when measured per day as you suggest) as any other quasi-objective (yeah, ok, subjective) "goal". The "goal" is an "objective" that helps to reach "aims" that are all... subjective.

    3. Re:Ockham's Razor tells me.... by jacquesm · · Score: 5, Interesting

      to me the biggest issue is maintainability, some languages help you in that department, some hinder.

      Perl makes it easier than even C to write obfuscated bits of code that even the author has a hard time understanding a few months later.

      I've seen perl used to create job security for it's coders, in that respect it is the new assembly language.

    4. Re:Ockham's Razor tells me.... by gfxguy · · Score: 4, Interesting

      One python coder here was scared because I was writing some tools in PERL that he was going to have to use and maintain. He complained PERL looked so terrible and was so horrible to follow that he wasn't sure he'd be able to do it.

      Then he saw my code, and understood every line of it...

      I'm like the anti-PERL PERL programmer (although I don't even use it myself anymore). He was absolutely right... when there was a more obscure way to do something, but it saved two characters of code, the PERL programmer would do it. My code was pretty verbose and easy to read.

      If I was passing those scripts off to other PERL programmers, they'd have mocked my style.

      --
      Stupid sexy Flanders.
    5. Re:Ockham's Razor tells me.... by burnitdown · · Score: 3, Interesting

      This has been said ad nauseum: There's nothing inherent about perl that makes its programs unmaintainable or broken. It's all about getting programmers who know how to write maintainable, well-designed code. A bad programmer can make an abortion of any programming language or fancy pointy clicky system.

      That was my response to this article as well.

      They're chasing trends instead of paying attention to the quality of programmers they're using, because smart programmers are not interchangeable parts. They prefer cogs.

      Management isn't all as screwed up as this. Some managers prefer highly intelligent staff that can work semi-autonomously.

  2. Perl IS the problem by Colin+Smith · · Score: 4, Interesting

    Particularly perl, even with coding standards, reasonable indentation, comments etc.

    I stopped writing the stuff years ago because I realised that I was only making things worse. Perl encourages big ball of mud development. It's specifically designed as a "glue" language which lets you stick things together, in fact it's a sticking plaster language which allows you to paper over cracks which would be far better filled in another way.

    Now if I see myself or others considering Perl to accomplish something, I'm pretty sure there's a problem with the entire approach.

     

    --
    Deleted
    1. Re:Perl IS the problem by cshirky · · Score: 4, Interesting

      There are two problems with this analysis. The first is that you (as many coders do) assume that tools that require intelligence on the part of the coder is an unalloyed good. Businesses, however, don't see it that way, especially large ones with many coders.

      As Dave Clark once said in a different context, and architecture is partly there to tell you what you *can't* do. Programming languages are like that as well. Java is very good at encouraging certain idioms and discouraging others. Perl is not so good at either thing. Organizations that want structure will also want languages that support structure.

      The answer "But its their fault for hiring dumb coders!" won't wash, because when you are the gas company working on maintaining a legacy billing system, you have to hire coders of average quality, and a language that allows coders of average quality to do stupid things is inferior to a language that shapes their work, *even if it slows them down*.

      The second problem with this argument is fetishization of the individual coder, when most large codebases, esp in businesses, are social affairs. Even stipulating the impossibility that every business should hire only coders of above-average intelligence, different coders are intelligent in different ways. When 'Code as thou wilt' is the whole of the law, confusion abounds.

      Did you ever see Rael Dornfest's bloxom blog project? Elegant, tight perl that did stuff like string replace on slashes in a fiel path to get an array of dir names, the file name itself, *and* kept the number of substitutions as a variable for traversal depth, in a single line. It was smart, but it also took other coders a long time to understand the JAPHishness of that single line of code, because it was doing three things at once.

      Interestingly, he re-wrote it in Python, and its better, mainly because you can't do stuff like use the Boolean return of an assignment as a side-effect for an if test, and there's no concept of $_. Perl doesn't require JAPHishness and Python doesn't completely banish it, but other things being equal, Python produces more sociable code.

      Once you start seeing the business imperative as enabling a group of acceptably competent programmers to work together, rather than being a platform for individual brilliance, the original article starts to look a lot more sensible.

    2. Re:Perl IS the problem by pzs · · Score: 4, Interesting

      I see this claim all the time - "it's not Perl, it's that people write bad Perl."

      Well then, why is bad Python a million times easier to read?

      I also hear that Perl is great because you can write things quickly. This completely disregards the fact that you can write quickly in many other languages, that do not have the same "ball of mud" tendencies.

      I also think that those Perl mantras: "laziness impatience and hubris" are not virtues and nor is having a thousand different ways to do things - this just leads to code that can only be read by one person.

      Being methodical, aiming for clarity and simplicity, avoiding obscure functionality - this is what leads to code that can be maintained. Perl does not encourage any of these virtues.

  3. heyho, python - the new perl. by apodyopsis · · Score: 3, Interesting

    python seems to be the new perl - ie. a general purpose, scripting glue language. its small number of keywords and simple layout make it easier for the less technical minded to learn quickly.

    of course, many people will prefer to use perl because of its larger amount of add-ons and clever tricks.

    at work I use PHP a lot for many of my simulations and quick fixes, its really good for processing 2M line data files (try doing that with excel). I know its not what it was originally designed for, but it works for me.

    look on the bright side, perl will no longer be learnt by many people and in a few years legacy "perl coders" can command higher wages to work on "legacy system" - much like COBOL programmer do now (though there are less of them every year).

    I think this is the way it will always be, there will always be a simpler language to replace the old standards, and a new shiny technology that those who have managerial power but less technical knowledge can mandate from on high.

    so, what happened to java? I liked it, it never went away but seems to hover on the edge.

    1. Re:heyho, python - the new perl. by mcvos · · Score: 3, Interesting

      python seems to be the new perl

      There's one big diifference, however: python is a well-designed, highly structured language. Perl sort of grew organically from a couple of scripting languages, and had OO pasted on later.

      Perl is probably brilliant for simple scripts, but should not be used for large programs. Python is very useful for large programs, however.

      so, what happened to java? I liked it, it never went away but seems to hover on the edge.

      On the edge of what? Java is the biggest programming language in the world today. It dominates the web and mobile phones, and although it's not quite as popular for desktop programs, it's not uncommon there either.

      It's not a scripting language like Perl, however, so if your world looks like Perl, you may not notice Java that much.

  4. Why not Python? by Raul654 · · Score: 4, Interesting

    At the risk of starting a programming language holy war, can someone explain to me why someone would choose to start a new project in Perl instead of Python? From what I've seen, they both do essentially the same things in the same ways, and they're both (roughly) the same as far as language overhead (from language interpretation) is concerned. But from a readability perspective, there's no question that Python is miles ahead. (Perl's readability, or lack thereof, is literally the source of jokes) In the long run, this translates into lower total development budgets, which is something businesses like to hear. So, why would anyone choose Perl over Python?

    --


    To make laws that man cannot, and will not obey, serves to bring all law into contempt.
    --E.C. Stanton
  5. Re:Age by famebait · · Score: 4, Interesting

    I would also dispute the idea that the simplicity of newer code is necessarily a good thing. Maybe they are yet to find all the bugs that require inelegant solutions...

    That could of course be the case.

    But it is a fact that some programmers have slightly too much interest in "clever" tricks, compactness, and optimisations whether they're called for or not, and too little in clarity, modularity and maintainability.
    I won't claim this as fact, but I also strongly suspect that this kind of programmer also tends to love perl (you find them everywhere though). Many lose these traits as they mature, get to experience the pain and cost of working other people's unreadable code, and as you get more proficient you simply aren't that impressed by low-level coding skills any more. But some seem incurable.

    --
    sudo ergo sum
  6. Perl too readable by QX-Mat · · Score: 4, Interesting

    People keep telling me that Perl is less readable than other languages, but i disagree. It's only less readable when you dont know the language specific semantics used - surely everyone remembers when they saw floor((float)i + 0.5) in C for the first time? It's no different to a perl programmer who uses @array = map { s/something/better/g } @data;

    While I must admit that if you code in perl like a one-liner guru, you're not going to make particularly managable code but not coding in perl has significient RAD drawbacks. In Perl I worry about one thing: variable tainting. In C and C++ I have to worry about tainted variables, constant index-off-by-one errors, the possibility of null pointers and null reference handling, libraries and linking.

    Some Perl programmers could do with more non perl experience to make their style managable. Perl 5 oop is a joke, and perl 6 is trollbait - but these aren't reasons why programmers shouldn't apply wider programming skills as a C/Jaava programmer uses their ADT knowledge and skill between langages.

    Matt

  7. Writing bad code by Phroggy · · Score: 4, Interesting

    As many others have pointed out, you can write bad code in any language. Perl makes it very easy to write terrible code, just as Perl makes it very easy to write just about anything else. There are other languages that place obstacles between you and the bad code you're trying to write - for example, Python won't let you not indent correctly, and Java won't let you not use OOP.

    When coding large applications, it is critical that certain coding standards are followed. Everybody has to play by the rules, and do things in a standardized way. Perl doesn't impose any of these rules for you automatically. If you choose not to self-impose any rules, your code will wind up being an unmaintainable mess. But no language can save you from that - if you write terrible code in Python, it's guaranteed to be nicely indented, but that doesn't mean it'll be maintainable. And, if you want to self-impose some rules to help keep your code clean, Perl Best Practices will point you in the right direction.

    I highly recommend The Daily WTF?. Perl does NOT get a disproportionally large representation there.

    --
    $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
    $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  8. It's possible to write rubbish in any language by jimicus · · Score: 4, Interesting

    Or, to put it another way, correlation is not causation.

    Perl has been around long enough (and, more to the point, was pretty much the only choice if you wanted a half-decent scripting language 10 years ago) that there's a strong chance in any business that badly-designed hard to maintain systems that have been around for 10 years or more include a fair chunk of Perl.

    That's not because of Perl, that's because they were badly done in the first place. I'm willing to bet that there's just as much code which is written in Perl and does a perfectly good job but nobody really knows about it because it's been sitting in the background doing a perfectly good job for so long.

  9. C++0x by js_sebastian · · Score: 3, Interesting

    One thing that really disappoints me about C++ is the direction that it's been heading for the past 5 or 6 years - "template programming". In fact it's about as bad as perl in terms of readability and maintainability, but much worse for debuggability. I can't think of any programming "language" worse than C++ template programming. I stay away from Boost and really hate what it's doing to C++.

    I respectfully disagree. The direction C++ is heading, with C++0x, is awesome. With the next standard, error messages from compilation of templated code will become comprehensible, thanks to concepts. This will mean using complex stl classes will be as easy as using java generics. Of course, designing the STL will still be hard, but I for one do not have to do that.

    Also C++ will become viable for functional programming (which is possible but horrible nowadays) thanks to lambdas and closures.

  10. Re:overpriced and overhyped by Lonewolf666 · · Score: 3, Interesting

    Sometimes it is a matter of not being able to deliver due to lack of architecture. Read, the side effects in the non-architectured spaghetti code finally reached the point of overwhelming the programmers.

    If you managed to avoid this situation with sufficient foresight, it is not always obvious. After all, maybe a simpler system would have done the job too?
    Besides, the point of not being able to deliver due to lack of architecture usually comes later in the lifecycle, and the first versions may be quite successful. So in some cases, the badly designed terrible little programs win by being first and becoming the "industry standard".

    Now the obligatory dig at Microsoft...
    As far as I can tell from the user perspective, Windows seems to fall in this category. For the second time:
    -First time, Windows 9x was quite successful for a while but ended in disgrace with Windows Millennium. Fortunately for Microsoft, they had developed the much more solid Windows NT line in parallel, on which they then built Windows 2000 and XP.
    -Now, it seems Microsoft has managed to overextend its architecture again with Vista. This time I don't see a better product line in the background that could take over. Let's see what happens over the next five years ;-)

    --
    C - the footgun of programming languages
  11. Re:Sometimes the correct answer is the simplest by Daimanta · · Score: 4, Interesting

    Look at this site: http://99-bottles-of-beer.net/

    This site make the song "99 bottles of beer" into a program that displays the lyrics of 99 bottles of beer. Now look at the Java implementation, it's a bloody mess! Waaaay to complex in order to maintain flexibility. Now look at the a comment where another person has done the same thing but then in a simple manner.

    Yes, you can make any language look butt ugly if you try.

    --
    Knowledge is power. Knowledge shared is power lost.
  12. Visual cues by fyngyrz · · Score: 3, Interesting

    I think if I show someone perl code, and then show them python code, they're going to feel a lot more comfortable with python. Perl's $, %, and @ variable prefixes, file i/o weirdness (print $_) and other way-too-shorthands are seriously intimidating and foreign looking as compared to python. Python's regular, sensible indentation makes an impression of regularity and comprehensibility as well. Python's just a cleaner technology by nature. You can make Perl look pretty good, but you have to work at it.

    I know I'm a lot more comfortable with Python, and I wrote in Perl for many years. Basically until I discovered Python, then that was the end of Perl for me. :)

    Just a thought.

    --
    I've fallen off your lawn, and I can't get up.