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."

172 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 silentbozo · · Score: 5, Insightful

      What makes me laugh (and cry at times) is these same businesses, who insist that programmers and administrators are hard to come by, turn to ridiculous metrics like "how many lines of code do you write per day", and require x number of years of experience with technologies which just came out this year (and have yet to be proven.)

      Let them have their H1-Bs, and the deadwood with the inflated resumes. Good riddance.

    2. 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
    3. Re:Ockham's Razor tells me.... by smittyoneeach · · Score: 3, Insightful

      You post invites the question:
      How many internal/script-driven systems have you seen
      over "a few" years old
      maintained by at least "a couple" different people,
      that don't end up a train wreck?
      The need to revamp a system is often more a question of when.
      So, you get to that point, and the question becomes:
      do we keep this funky old perl,
      or start from scratch with something relatively tidy and
      popular from a staffing perspective?

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    4. Re:Ockham's Razor tells me.... by fishbowl · · Score: 4, Insightful

      "So they might try to have it reprogrammed in something popular (Visual Basic? *evil grin*) only to find out that a change of programming language will not magically cure their woes."

      1. It's their money.

      2. If it's not (#1), then it means you are in a position of decision making authority and can rectify the situation in a suitable manner.

      Seriously, as long as your work environment involves calling decision makers "THEY" you really don't have a dog in the fight.
      Why aren't you in an authoritative role by now, if you're so experienced, talented, knowledgeable and skilled?

      It's no different from the other 10,000 slashdot posts where a decision maker was a "them", and somebody else's money was at risk.

      --
      -fb Everything not expressly forbidden is now mandatory.
    5. Re:Ockham's Razor tells me.... by dintech · · Score: 5, Insightful

      I can only speak for investment banking but "lines per day" is not a metric which I've ever seen people actually use. Generally you are measured only one way. "Have you met your deliverables".

      There may be some architecture and best practices you have to meet in carrying out your implementation which is what this article is about I suppose. Perhaps integrating with other systems forces you to use a particular tool or language. However, in general you can do whatever you want as long as you fulfill the user and business requirements.

      That could mean perl but usually we think of that as being a fancy bash script with perhaps a bit of database interaction rather than a platform for writing server-side (or even client-side?) apps.

    6. Re:Ockham's Razor tells me.... by chthon · · Score: 5, Informative

      Yes! Book recommendations for Perl programmers, outside of the standard ones you need :

      • Perl Best Practices, by Damian Conway. This one is really mandatory.
      • Higher-Order Perl, by Mark Jason Dominus, to understand why Perl is so powerful.
      • How To Design Programs, which taught me better ways of using Perl, even though the book is based upon Scheme.
      • Structure and Interpretation of Computer Programs, which is somewhat the bridge between HTDP and Higher-Order Perl.

      All the rest I learned from the camel book. I use Perl on three platforms (Win32, Cygwin and Solaris), using the same libraries, and now also adding Perl/TK to the mix.

      If you need to define several goals, I would recommend Perl Best Practices for writing maintainable and easy to read code and installing a peer review process.

      HTDP is more for individual programmers, to become smarter and better programmers.

    7. 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.

    8. 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.

    9. Re:Ockham's Razor tells me.... by jacquesm · · Score: 2, Insightful

      I've tried to 'repair' a broken perl app and indeed it was much quicker to toss it and rewrite.

      Perl is worse than 'mumps' and that's saying something.

      (mumps anecdote: What, you've reset that string ? Oh, great that was the systemwide editor...)

    10. Re:Ockham's Razor tells me.... by digitig · · Score: 3, Insightful

      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.

      Yes, it's not just Perl code that has developed piecemeal over the last 10 years or so, it's Perl itself, with things like OO being rather clunkily bolted on. It does feel to me like a language that was great in its time but has had it's day and needs to stand aside. No doubt Perl experts will continue to produce useful scripts as they always have done, but more modern technologies make it easier (including easier to get right). And that will turn into a maintenance issue for even well-written Perl code: when finding Perl maintainers gets to be as hard as finding COBOL maintainers, and for the same reason.

      --
      Quidnam Latine loqui modo coepi?
    11. Re:Ockham's Razor tells me.... by rdebath · · Score: 5, Insightful

      Lines per day is frequently proposed and sometimes implemented. But it's also easy to kill, just do that little refactoring job you've been putting off and put in a report of minus two thousand lines.

      They tend to get the message after that.

    12. Re:Ockham's Razor tells me.... by TekPolitik · · Score: 3, Insightful

      I can only speak for investment banking but "lines per day" is not a metric which I've ever seen people actually use.

      Some people use it, but on its own it's a really bad metric. A top quality developer will do the same task in far fewer lines of code, with better reliability, than a poor quality developer. That means metrics based on lines per day alone may identify the worst programmers rather than the best.

    13. Re:Ockham's Razor tells me.... by Hognoxious · · Score: 2, Interesting

      Of course it's a bad one. So why does it get used?

      Because it's easy to implement and it produces a number. Numbers are great because managers can do barcharts and statistics and stuff like that to stick on the wall and go "blah blah KPI blah blah" in meetings.

      And re the GP about doing negative lines - yup, been there (we didn't use LoC formally, but I was questioned on why the programs were getting so much shorter). Is taking out the shit that some imbecile had copy/pasted a few hundred times and putting it in subroutines counted as refactoring?

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    14. Re:Ockham's Razor tells me.... by CrazedWalrus · · Score: 4, Insightful

      At my last job, I wrote a perfectly good perl loader for a large data file we'd bring in every night. They decided to kill it off and go with BusinessWorks instead. BW took 45 times longer (I shit you not -- 45 minutes instead of 1 minute) and broke every week. We finally got sick of the support issues and went back to perl.

      Fact is that shiny pointy clicky just introduces complexity and additional points of failure into the infrastructure. If you want the latest buzzwords, then by all means, go with shiny pointy clicky. If you want your system to work, keep it with tried and true.

      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.

    15. Re:Ockham's Razor tells me.... by pipatron · · Score: 4, Funny

      with things like OO being rather clunkily bolted on

      I beg to differ. I think that how perl handles OO is one of the most elegant ways I've seen any language to it.

      --
      c++; /* this makes c bigger but returns the old value */
    16. Re:Ockham's Razor tells me.... by xaxa · · Score: 5, Funny

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

      I quote the lecturer from my software maintenance course:
      "As I understand it, the standard maintenance method with Perl is to start again."

    17. Re:Ockham's Razor tells me.... by VoidCrow · · Score: 4, Insightful

      I'm a C++ coder. I've written OO code in Perl. Maybe I'm missing something about its elegance. Would you care to explain, with brief examples?

    18. Re:Ockham's Razor tells me.... by jacquesm · · Score: 4, Funny

      oh, don't worry, they'll be brief, this is perl, right ?

      Whether you'll be able to read them though, that's a different matter altogether ;)

    19. Re:Ockham's Razor tells me.... by pdbaby · · Score: 5, Funny

      Well you're a C++ programmer so your vote on elegant OO is NULL and void* :-P

      I jest, I jest.

      --
      Global symbol "$deity" requires explicit package name at line 2. - If only $scripture started "use strict;"
    20. Re:Ockham's Razor tells me.... by shaka999 · · Score: 5, Insightful

      Good grief, how is "deliverables" a stupid metric. Either you deliver a working solution/program on time or you don't. Thats the deliverable. Bascially your saying that having and goal and having to deliver anything is stupid.

      --
      One should not theorize before one has data. -Sherlock Holmes-
    21. Re:Ockham's Razor tells me.... by datapharmer · · Score: 2, Funny

      No need to stay silent about him, it is best everyone knows - I keep finding his scripts running at night on my systems too. He uses the login "nobody", and I'll be damned if I know what his code does! ;-)

      --
      Get a web developer
    22. Re:Ockham's Razor tells me.... by Dr_Barnowl · · Score: 2, Funny

      Point out this scenario and insist they measure lines of diff, not lines of code. Then re-indent the entire codebase and ask for a bonus.

    23. Re:Ockham's Razor tells me.... by Bedemus · · Score: 3, Insightful

      I can only speak to the reasons for going with PHP and JAVA in our company. For one, PHP is really maturing as a development language, JAVA is well supported, and maybe over the years I kept running into some of that poorly designed PERL and it left a bad taste.

      I keep hearing this comment about PHP, but every time I look at the language I come away unimpressed. A typical PHP install can have as many as 4000 functions in the global namespace, and there's not even a clear naming convention to be found.

      Really: addcslashes, count_chars, str_getcsv, str_shuffle, strlen, chunk_split -- this is just a small selection of the functions dealing with strings.

      A brief aside: I used to live near Pittsburgh, PA. It's a great city, with great people. But it has bridges. LOTS of bridges. 446, to be exact. More bridges than Venice, Italy. I used to joke that it was like we built a small town at the center of three rivers when rivers were a primary means of transporting goods, then were taken completely by surprise when it grew.

      I only mention this because that's kind of how I think of PHP. A good community, with a ton of nice people who have nothing but the best of intentions. Yet, when I compare PHP to something like Perl or Ruby, I always come away feeling like PHP just kept tossing up bridges as it grew, without taking a step back and looking at the big picture.

    24. Re:Ockham's Razor tells me.... by grantek · · Score: 4, Funny

      All Perl needs is a shiny new catch phrase...
      Perl on Rails?
      CloudPerl?
      Extreme Perl?
      Perl#?

    25. Re:Ockham's Razor tells me.... by encoderer · · Score: 2, Insightful

      Oh, please.

      First, let me ask, are you a professional software developer or project manager? (I'm not being arrogant, I'm just curious).

      I've got more than a few years under my belt.

      A developer gets a spec. He designs a solution and quotes the spec. Assuming he's given the green light, he schedules the projects start date and sets some milestones.

      I've worked for DOZENS of companies, large and small, in all economic sectors, as both a contractor and a FTE, and invariably it's some variation on this theme.

      The developer designs a solution and sets the schedule.

      "Deliverables" means nothing more than the developer hitting the milestones/delivering the artifacts that he set for himself.

      In smaller projects, this could be the entire application. In large projects, it's just a single function point.

      You can bash the vernacular of the business all you want, but you don't offer any better solution.

      If I'm being paid $50/hr to tap a keyboard, shouldn't I be held accountable for results?

    26. Re:Ockham's Razor tells me.... by MadnessASAP · · Score: 3, Funny

      What is worng with you Perl programmers? Does the thought of a newline or indentation, possibly even whitespace fill you with fear and horror?

      --
      I may agree with what you say, but I will defend to the death your right to face the consequences of saying it.
    27. 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.
    28. Re:Ockham's Razor tells me.... by tha_mink · · Score: 4, Funny

      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.

      That's because PERL, even good PERL, looks like an explosion at the punctuation factory compared to a vast majority of other languages.

      --
      You'll have that sometimes...
    29. Re:Ockham's Razor tells me.... by Lord+Ender · · Score: 2, Insightful

      I'm a developer, not a manager. I have been lobbying for the use of Ruby or Python for all new development (we used to do it all in Perl). The simple reason? Perl is a write-only language. Larry Wall knows this, and that's why he's spent so many years trying to make Perl6 a clone of Ruby.

      I realize that with enough time and discipline, Perl code can be written in a more maintainable form. But that's swimming against the current in the busy business world.

      Ruby is taking hold, and most of the new apps being developed are in that language. Perl is quickly become "legacy" around here.

      [oh yeah, and Perl's terrible object model and use of POINTERS for complex datastructures (FFS!) are pretty embarrassing]

      --
      A slashdotter who didn't build his own computer is like a Jedi who didn't build his own lightsaber.
    30. Re:Ockham's Razor tells me.... by frn123 · · Score: 3, Funny

      don't complain, just s/([;}])/$1\n/gc
      or
      perltidy .conformingsigs

    31. Re:Ockham's Razor tells me.... by kv9 · · Score: 2, Funny

      how about a car analogy?

    32. Re:Ockham's Razor tells me.... by Abcd1234 · · Score: 3, Insightful

      For some subjective metric of "better"...

    33. Re:Ockham's Razor tells me.... by Amouth · · Score: 2, Interesting

      "And when I grow up, I hope to program in java."

      i was agreeing with you till that comment.. now i want to shoot you... (not becuase i dislike you - but rather to save you from your self)

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    34. Re:Ockham's Razor tells me.... by Mr.+Slippery · · Score: 5, Insightful

      A developer gets a spec. He designs a solution and quotes the spec. Assuming he's given the green light, he schedules the projects start date and sets some milestones.

      Sometimes. Sometimes, management gives you a deadline with the spec, and you don't have the ability to set your own schedule.

      And sometimes, the spec is something like "Somewhere in the jungle is a river. Build a suspension bridge over it."

      "Do you have a map of the jungle?"

      "No, it's unexplored."

      "Do you know how wide the river is?"

      "No. I told you, the jungle is unexplored."

      "Is there a road through the jungle to the river?"

      "No. The jungle is unexplored. But look, you've built dozens on bridges, just tell me how long it will take to build this one! Give me a schedule with some deliverables."

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
    35. Re:Ockham's Razor tells me.... by gizmo_mathboy · · Score: 4, Funny

      Perl6?

    36. Re:Ockham's Razor tells me.... by Alpha830RulZ · · Score: 2, Informative

      (and ENCOURAGES it with "implied" scalars)

      Agreed. I resist using them, and won't let anyone on my team use them for code that gets installed at clients. Our client code looks like a well structured C program, as much as we can make it so.

      That said, I like Perl for what we use it for, which is installation glue code, because it's generally easy for client staff to pick up. I like Python myself, but it's harder for marginal IT staff to pick up. Python and Ruby also tend to offend the client IT teams standards folks, who aren't quite sure about this new-fangled stuff. They'd prefer C# or Java, which are completely inappropriate for what we need to do.

      --
      I was taught to respect my elders. The trouble is, it's getting harder and harder to find some.
    37. Re:Ockham's Razor tells me.... by Anonymous Coward · · Score: 2, Insightful


      Yes, it's not just Perl code that has developed piecemeal over the last 10 years or so, it's Perl itself, with things like OO being rather clunkily bolted on. It does feel to me like a language that was great in its time but has had it's day and needs to stand aside. No doubt Perl experts will continue to produce useful scripts as they always have done, but more modern technologies make it easier (including easier to get right). And that will turn into a maintenance issue for even well-written Perl code: when finding Perl maintainers gets to be as hard as finding COBOL maintainers, and for the same reason.

      This is all true. The time it's taking Perl 6 to materialize is at least somewhat indicative of Perl itself. It's not a complete argument but I don't know too many people that don't think Perl is hard to maintain, usually.

      I'm not sure where all the languagism comes from. Perl has a bad rap, period, though. It seems like everyone has seem some lousy perl code somewhere. Does that make perl bad? Not really, it just seems like perl really lends itself well to it. Perl, C, C++, all languages really but these in particular require a lot of discipline from the developers to avoid building crappy code; much like C++, read the mozilla guidelines about all of the language features they don't use, it's an interesting concept. There are perl scripts I rely on on a daily basis, it's a very powerful tool. Piecemeal design or not, terse code isn't always good code, terse code often requires more documentation because of subtlety. The same thing is happening with Ruby, it will rapidly become the new perl, there are some butt ugly pieces of ruby out there that people in the moment think are beautiful and elegant pieces of code, let's just wait 10 years and see when someone has to re-read that closure 500 times because of an assumption about the list it's being applied to that isn't documented anywhere but is fundamental to the code working properly. (but hey, if it fits on one line then you can *see* the whole program at once in vi!!!)

      I think part of it is the learning nature a lot of developers take to to development, they learn as they go. A language like perl, by nature and design, allows a developer to do a task numerous different ways and I've seen more than a few perl programs where developers were trying to do different things in different places to further learn the language. This probably says more about the current state of the industry than it does about any language though.

    38. Re:Ockham's Razor tells me.... by Anonymous+Brave+Guy · · Score: 2, Insightful

      I've always liked Bill Gates' perspective on this one:

      Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

      --
      If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
    39. 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.

    40. Re:Ockham's Razor tells me.... by agbinfo · · Score: 2, Insightful

      how is "deliverables" a stupid metric. Either you deliver a working solution/program on time or you don't. Thats the deliverable.

      Let's see, what is the deliverable again? a working solution? What about maintainability? flexibility? What if the person had to mentor others when trying to deliver the product? What about managing priorities? providing useful and easy to maintain unit tests? documentation? What about team work and consensus in trying to achieve that working solution? What about raising issues early?

      What ever the metric you use, it might be a fine tool to measure progress of the project. Just don't use it to measure productivity of individuals or you'll end up with programmers that meet their objectives and only their objectives.

    41. Re:Ockham's Razor tells me.... by hercubus · · Score: 2, Interesting

      At my last job, I wrote a perfectly good perl loader...

      during my entire working life managers have been trying to replace "coders" with tools that don't need a skilled operator (just point and click!)

      they (mgmt) probably were more interested in getting rid of their dependency on you (or someone like you) rather than just Perl

      and i don't know if they're right or not. do companies with super-skilled cadres of developers always win out over competitors with retrained VB code monkeys?

      often i hear about companies being taken over (i.e. they "lost") and the IT staff cannot believe how messed up the parent's IT infrastructure is

      --
      -- How I want a drink, alcoholic of course, after the heavy lectures involving quantum mechanics.
    42. Re:Ockham's Razor tells me.... by wmwilson01 · · Score: 2, Funny

      ...followed by: "Well, how the hell do you know there's a river?"

    43. Re:Ockham's Razor tells me.... by rk · · Score: 4, Insightful

      Lord, I thought the bless thing was a pain, and now you're telling me that there's at least FIVE different CPAN thingys that give me a way to do object-oriented Perl development? Perl's been on my "avoid" list for years now, and what you've revealed to me scares me to my very core, and only further cements my desire to continue avoiding it. It was great in the early-mid 90s as a way to make interactive web apps, and it fit really nicely into that "need more power than a shell script, but C is overkill" niche, but now? Perl sounds like the MCP from Tron, absorbing all functions into it. :-)

      Since there are at least five of them, something tells me that the odds are decent that at a given Perl shop, some genius thought they all sucked and rolled his own all-singing, all-dancing object model. The net result is basically nobody can now claim to be truly knowledgeable about object-oriented development in Perl.

    44. Re:Ockham's Razor tells me.... by nabsltd · · Score: 2, Informative

      How do you measure whether you're on schedule to deliver the deliverable on time?

      Simple. The "deliverable" is "Module Foo". The metrics to measure are:

      • Module Foo: coding complete
      • Module Foo: code review complete
      • Module Foo: unit testing complete
      • Module Foo: integration testing complete

      When you defined any deliverable, you allocated resources (people and days) to each of the steps in creating the deliverable, based on the requirements. This is how you know what answer to give when the client asks "how long will it take and how much will it cost to add the 'Foo' capability to the project?"

      • Foo coding: Joe & Bob, 10 days
      • Foo code review: Fred (with Joe & Bob), 3 days
      • Foo unit testing: Mary & Bill, 3 days (concurrent with code review)
      • Foo integration testing; Mary, John & Max, 5 days

      Although there are various ways of interpreting "on schedule", at least this lets you know that about 3 weeks from start, you should be damn near done with "Foo".

    45. Re:Ockham's Razor tells me.... by David+Greene · · Score: 4, Insightful

      Right on. This is the real problem with Perl. Everyone rolls their own and we end up with multiple reimplementations of the same concept done in sometimes subtly different ways.

      CPAN is one of my worst nightmares. There's no peer review so one ends up looking at several different libraries that do the same thing, only they all do it differently and have varying levels of feature complexity. I just want to get work done, not evaluate libraries.

      --

    46. Re:Ockham's Razor tells me.... by FrozenFOXX · · Score: 5, Funny

      All Perl needs is a shiny new catch phrase... Perl on Rails? CloudPerl? Extreme Perl? Perl#?

      How about "Perl Necklace?"

      --
      "Just a fox, a whisper."
    47. Re:Ockham's Razor tells me.... by UnknowingFool · · Score: 2, Funny

      When I thought about learning perl, I looked up some sample scripts on the internet. At first I thought the code was corrupted or possibly encrypted. But it wasn't:

      while (/(<\/[^>]+>)|(<[^>]+>)|([^><]+)/go) {

      That's when I decided not to learn perl.

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    48. Re:Ockham's Razor tells me.... by Danny+Rathjens · · Score: 2, Insightful

      No, we'd simply mock you for calling it "PERL" instead of "perl". :) But seriously, professional perl programmers are well aware that perl golf (accomplishing something with the smallest number of keystrokes) and writing professional working and maintainable code are two entirely different endeavors. The fact that you don't think so, and that you call it PERL, indicates you haven't really been a part of the perl community or encountered many professional perl programmers.

    49. Re:Ockham's Razor tells me.... by emilper · · Score: 4, Insightful

      what's not obvious in that line ?

    50. Re:Ockham's Razor tells me.... by mr_mischief · · Score: 3, Insightful

      my %hash = ( [ 1, 2, 3 ], [ 4, 5, 6 ] );

      My, that's awfully ugly, isn't it?

    51. Re:Ockham's Razor tells me.... by richardchaven · · Score: 2, Interesting

      my PERL code looks like Pascal: descriptive variable names; breaking evaluations and operations into intermediate steps; king-pinning functions. For example, I name the iterating variables in "for" loops 'counter', not 'i'

      Some Delphi programmers think I'm too descriptive.

  2. Age by damburger · · Score: 4, Insightful

    Could it be that, as well as being from an era of more ad-hoc approaches, the code is simply showing its age? System tend to get modified over time, and such modification is often done by multiple people under multiple managers.

    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...

    --
    If we can put a man on the moon, why can't we shoot people for Apollo-related non-sequiturs?
    1. 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
    2. Re:Age by budgenator · · Score: 2, Informative

      unreadable COBOL wow I could see incomprehensible but unreadable has to be some kind of a record for COBOL!

      --
      Apocalypse Cancelled, Sorry, No Ticket Refunds
    3. Re:Age by Mutant321 · · Score: 2, Interesting

      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

      As you say, there's no way of proving this as a fact. But even if it is true that a lot of Perl programmers like "clever" tricks, it's irrelevant.

      The way to avoid these things ending up in your code base is not to choose a language you think is less likely to have "clever" coders, but to put in place a good set of development practices, and ensure you have a decent ratio of "tech leads" (or whoever it is responsible for ensuring the standards are kept up) to other coders.

      There are two main problems with a lot of the legacy systems in Perl. Firstly, when they were written (late 90s), it was the Internet boom, and everyone was a start-up, at least in the Internet field (even if they were an established company already). Secondly, a lot of the development practices that are mandatory today (eg. TDD, Continuous Integration, even Source Control) were far from ubiquitous back then. And it's quite hard (and expensive) to retro-fit those standards to a code base.

      Business people usually aren't interested in paying for that, because there's zero direct business value from it. Although this is something that's slowly starting to change as business realise how important technology is, and how hard it can be to get right.

      I don't think it's really a language specific thing, it's just that a lot of this stuff was done in Perl in the late 90s, and altho you can write bad code in any language, without good practices, it can get bad really quickly in Perl.

  3. It's the slashdot effect! by pjf · · Score: 5, Funny

    It's simple why businesses don't like Perl. Slashdot is written in Perl. Whenever a business is mentioned on slashdot, their website goes down. Ergo, Perl is bad for business.

    1. Re:It's the slashdot effect! by smittyoneeach · · Score: 2, Funny

      Your ideas are intriguing to me and I wish to subscribe to your newsletter

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  4. Give the yahoos what they want by Anonymous Coward · · Score: 3, Insightful

    Shiny.
    New.
    Perfect.
    Can use it without knowing anything.

    They'll start complaining about the new stuff as soon as they realize it only gives them a new untested set of problems and work-arounds. If you want to keep working there, you'll change yet again when enough of the 'decision makers' can't take it anymore.

    I have a client with a very workable multi-platform enterprise calendaring/scheduling system. Two people out of 15 in the organization want to use Outlook. It's a fair bet the company will migrate to Microsoft Exchange within the next 6 months and if I want to keep making money from them, I will be training these two users and their colleagues on how to share calendars in Exchange/Outlook. Will life be any better for them? I think the learning curve for sophisticated use of Outlook/Exchange is a bit higher than for MeetingMaker... but we shall see.

  5. 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 niceone · · Score: 4, Insightful

      Perl encourages big ball of mud development

      Is it really fair to blame the language? I think the reason perl is the centre of so many big balls of mud is that it is easy to do prototypes in it. If people choose to take those prototypes and turn them into big balls of mud, then that is their own fault. If you start with a clean sheet of paper, do a good design and then decide to implement it in perl you won't end up with a big ball of mud.

    2. Re:Perl IS the problem by jacquesm · · Score: 2, Insightful

      A good worker picks his tools carefully so he doesn't have to blame them. If you're forced to maintain a bunch of code and you can choose the language would you prefer to maintain a batch of perl code or a batch of python or C code ?

      I've done all three and I really *much* prefer C over both python and perl and python over perl.

      I'm sure that you can write very beautiful code in Perl the first time out, but that goes for any language, the real acid test is what you get after 10 coders have touched your poetry over the course of a few years maintaining a project and adding new functionality.

    3. Re:Perl IS the problem by Rogerborg · · Score: 4, Insightful

      The language itself is not the problem, but the 'community' and their promotion of it may be. I have seen good Perl written by good corporate developers, but that's despite the available Perl tutorial and examples.

      I can't recall seeing a Perl learning resource that presents code that is well structured, commented, and tolerant of bad inputs. That leads me to suspect that Perl attracts developers who take pride in hacking together "Works For Me" code in the shortest possible time using the fewest, tersest lines. Yes, you can do that in a C-like language, but Perl lets you get your "good enough" result faster.

      When Perl is promoted by impatient, sloppy bodgers, it's no mystery why it would attractd similarly minded developers. It doesn't have to be that way, but that does seem to be the de facto situation.

      --
      If you were blocking sigs, you wouldn't have to read this.
    4. 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.

    5. Re:Perl IS the problem by Dubu · · Score: 2, Insightful

      I think the reason perl is the centre of so many big balls of mud is that it is easy to do prototypes in it.

      You're very right with that, but there's more.

      In many cases, Perl allows you to reach your programming goal easily, without much effort. But this unfortunately also means that it encourages quick & dirty programming. Just scribble down your code and the job is done; it just works. In other languages that are less powerful/flexible in their syntax (that does not mean restricted in their possibilities!), like C, C++ or Java, you normally have to write a lot more lines of code. This not only makes the code more readable in many cases, it also urges you to think more about what you are doing. If your programming task will take a lot of time to implement, you will try to find an optimal (or at least, good) approach, a better solution to it, make it reusable, use a design pattern - you will just think more. And the time you invest in the design is well spent, as it may save you unnecessary effort in the coding and debugging phases.

      Okay, so a C/C++/Java/whatever programmer will need more time to design and implement. Perhaps. But that's not all: primarily, you must be able to design your software. You must know your design patterns, your algorithms, your best practices. Without that knowledge, most languages will give you a hard time to create working code. Heck, with many languages you will not even make it to "Hello, world" without compiler warnings if you don't understand how it works.

      But not with Perl. It makes your start quite smooth. You don't have to declare your variables, care about strange #includes or imports, just write print "Hello, world!" and it will compile and execute (and you will not even see these different steps). And unfortunately, this also means -- and that is also my experience with a lot of beginners in different Perl forums and on the Usenet -- that Perl is more attractive to those who do not have a formal education in software engineering. They do not have to wade through thick volumes about "C++ in $smallint days", just to find out how to convert a string into a number, split an input line at commas, or grab a page from the Web. They will soon find a quick&dirty, one-line solution in an online tutorial or a forum that can be pasted into their code without even breaking the rest of it or make the compiler scream (no beginner will use strict or warnings pragmas unless urged to). It will not be the most efficient solution. It will probably break when the input data vary a bit. It will likely be full of security flaws (but at least no buffer overflows!). But it will do the job and give even the hobby coder a (false) feeling of competence and aptitude.

      PHP has even more of that "easy for beginners" nimbus (sorry, folks), but Perl does not stand much behind. You can see the results most obviously in a lot of the CGI code that can be found on the Net. (Anyone think of "Matt's script archive"?)

      So, is it the fault of a programming language that it is attractive to non-programmers? Perhaps. I'm not the one to judge.

      If people choose to take those prototypes and turn them into big balls of mud, then that is their own fault. If you start with a clean sheet of paper, do a good design and then decide to implement it in perl you won't end up with a big ball of mud.

      YES, absolutely! But it is just so easy to get persuaded by Perl to do it quick, sufficiently working, and dirty. *sigh*
      I took the bait myself far too often.

    6. 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.

    7. Re:Perl IS the problem by fbjon · · Score: 4, Insightful

      Perl attracts developers who take pride in hacking together "Works For Me" code in the shortest possible time using the fewest, tersest lines. Yes, you can do that in a C-like language, but Perl lets you get your "good enough" result faster.

      For me, that's the strength of Perl. I don't use it for anything other than works-for-me type small tidbits of code. Will it require maintenance, or extending, or support by other people? Then I don't use Perl, because it's complex enough to warrant a strict language. In essence, text parsing and one-off scripts are fantastic, other stuff I stay away from.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
    8. Re:Perl IS the problem by Blakey+Rat · · Score: 3, Insightful

      People on this board blame VB all the time for bad programs. Perl doesn't get a pass.

      (That said, I agree with you, I don't think you can blame the language for bad code; I *do* believe a language can contain features that encourage bad code.)

    9. Re:Perl IS the problem by 10101001+10101001 · · Score: 2, Interesting

      I think the reason perl is the centre of so many big balls of mud is that it is easy to do prototypes in it.

      Perl is the center of so many big balls of mud because elegant Perl code tends to be both powerful and obtuse. Prototyping merely encourages the creation of more powerful code.

      If people choose to take those prototypes and turn them into big balls of mud, then that is their own fault. If you start with a clean sheet of paper, do a good design and then decide to implement it in perl you won't end up with a big ball of mud.

      Most corporations are more concerned with getting a project out and working by deadline than whether good design was carried out or that non-critical bugs persistent. In short, if you know ahead of time that you're likely never going to go back and do a clean design, you should choose a language that at least encourages good design from the start if you want to minimize the mudball that will form; that means choosing a language other than Perl (or finding the few Perl programmers who follow good design).

      --
      Eurohacker European paranoia, gun rights, and h
    10. Re:Perl IS the problem by encoderer · · Score: 5, Insightful

      Yes, it is.

      It's like saying "Most Basic & VB Code is Verbose, is it really fair to blame the language?"

      YES!!

      Every language has a unique idiom. And the best languages use this idiom to painlessly guide the developer to best practices.

      For exammple, lots of devs consider Java to be over-engineered and overly-complex. You've probably heard a dev talk about building something in, say, RoR in a week that would've taken 4 weeks in Java.

      That's probably true, because Java is a tool best designed for large applications and when you're using Java, it's idiom guides you into building multi-tiered architecture.

      Python's idiom guides devs into producing well formatted code and it's a great language for web apps because it puts powerful data structures right in the developers face.

      C# is a FANTASTIC language for teaching OOD to procedural developers. It's HARD for a procedural developer to think in terms of object hierarchies. The mechanics are easy to pick up. The ability to deconstruct a problem into an object hierarchy is hard.

      But you put them in front of a new project in C# and the language -- entirely OO itself -- just guides a developer to the right thing. It's very hard to shoe-horn a procedural architecture into an OO-only language.

      JavaScript makes it insanely easy to create an event-driven application. Anonymous functions, LAMBDAs, etc, guide a developer into producing code in an event/event-handler model.

      Any developer can do nearly anything with any language. But a language itself can make it easy and obvious when you're doing things right, and painful for you when you're doing them wrong. And a good IDE will reinforce both of these behaviors.

    11. Re:Perl IS the problem by Abcd1234 · · Score: 2, Insightful

      The funny thing is, all of your comments are equally applicable to C++. It's incredibly easy to abuse the language in a myriad of ways if you really want to, with many weird little edges and corners, and multiple possible styles available. And different programmers have a range of skill and discipline levels, producing code that widely ranges in terms of quality. But you don't see people blaming the language (well, okay, some do, but the industry uses it heavily anyway). Instead, we have things like coding guidelines and general corporate culture, code reviews, etc, to ensure that the output from poor to mediocre programmers is up-to-snuff.

    12. Re:Perl IS the problem by geminidomino · · Score: 2

      Ahh. So, got any context for that quote? Something tells me there's more to it than just that (for example, I consider laziness a virtue in a programmer because it encourages modularization and code reuse... I'm too lazy to rewrite the same things over and over).

      That's exactly the context Larry meant by laziness being a virtue.

    13. Re:Perl IS the problem by Just+Some+Guy · · Score: 2, Insightful

      When Perl is promoted by impatient, sloppy bodgers, it's no mystery why it would attractd similarly minded developers. It doesn't have to be that way, but that does seem to be the de facto situation.

      Oh, you nailed that one. When I was hacking Perl in the late 90s, it was fun and exciting and elite. The Perl culture was that we were special and cool and not like the corporate drones writing RPG in their cubicles. The problem was that it actively pushed you to do stuff as un-drone-like as possible as an ends to itself. If you did stuff in a clear, maintainable manner then you were just like one of "them", and that would have been missing the whole point of Perl.

      --
      Dewey, what part of this looks like authorities should be involved?
    14. Re:Perl IS the problem by Just+Some+Guy · · Score: 2, Informative

      I have never once heard those listed as "Perl mantras"... where is this coming from?

      "We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris." -- Larry Wall, Programming Perl (1st edition), O'Reilly And Associates

      It neither encourages nor discourages.

      He misspoke. Perl itself neither encourages nor discourages. Perl's community, however, is largely centered around those three exact things.

      --
      Dewey, what part of this looks like authorities should be involved?
    15. Re:Perl IS the problem by Exlee · · Score: 2, Interesting

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

      You won't get hit by a car if you're chained to your kitchen.

      And while impossibility of being hit by a car is a good thing, having chains around your leg gets troublesome.

      I have seen spaghetti code written in Python (10.000+ lines, jumping back and forth between files). I wonder if you would say it is maintainable?

      I also hear that Perl is great because you can write things quickly

      Just to illustrate the example:

      I rewrote small script written previously in Python to Perl. Around 130 lines of code (mostly CLI) turned into 20 lines of code while preserving readability, 100% of functionality and even adding some of its own, just because of "perl magic". And that's the prototyping speed I want!

    16. Re:Perl IS the problem by mr_mischief · · Score: 2, Informative

      You seem to be unfamiliar with the work of Damien Conway, Randal Schwartz, Tom Phoenix, and Lincoln Stein.

      Stop by Perlmonks to read some book reviews and maybe lurk the Seekers of Perl Wisdom or Meditations sections. You'll see that what you've been reading is not representative of how things actually get done.

      There are Perl Poetry and Obfuscation sections on the Perlmonks site, but those are games. You'll notice that there's a clear division between neat tricks for the sake of neat tricks and maintainable code for the sake of maintainable code.

    17. Re:Perl IS the problem by mr_mischief · · Score: 2, Interesting

      I disagree. Languages don't encourage bad code (well, maybe Intercal, Malbolge, etc). They just don't enforce good coding practices.

      There are problems with enforcing good coding practices, too, though. One that there are so many from which to choose that are good in different ways. You could just pick one, as Guido did, but then that makes other ones harder to use or less clear.

      Vertical whitespace often makes things easier to read than horizontal whitespace does, but the majority of the time horizontal whitespace wins. Objects can really help clarity and modularity, but they get in the way when a small procedural program makes more sense. Some programs make more sense in a functional style with recursion while many recursive solutions can be made clearer and faster with iteration and a few side effects.

      The difficulty people have with Perl is not that it encourages bad coding. It's that puts the responsibility for choosing a decent style and model on the programming team. If you're not ready to make those decisions, you can use Perl::Critic and PerlTidy or you can use a language that makes those decisions for you.

      Just be aware that whether you make coding standard decisions consciously or by defaulting to some language designer with a particular taste, you're going to have pros and cons to your coding standards. It is an advantage in some ways, I suppose, that you end up with the same standards as your competitor down the street. It's also an advantage if you come up with one that allows your coders to be more productive than his.

  6. To be fair to the corporates by Sycraft-fu · · Score: 4, Insightful

    I see the same thing with developers in general. Nobody wants to use Perl anymore, PHP was the new thing, and now Ruby is eclipsing that. Now I'm not talking about cases where the new language legitimately makes something much easier, I'm talking about a good deal of fanboy-ish "Oh I do all my code in Ruby now because it's way better!"

    It isn't just PHBs, programmers themselves seem to fall victim to fads in development. They want to use the new shiny stuff, simply because it is new and shiny. Hell I've seen developers say C/C++ are "dead" and that shiny_language_x is going to take over.

    1. Re:To be fair to the corporates by famebait · · Score: 5, Insightful

      Hell I've seen developers say C/C++ are "dead" and that shiny_language_x is going to take over.

      That may be not so much fadism as well-informed wishful thinking.

      OK, plain C is not _that_ bad, but you do need to fight its innate spirit in order to implement sane coding practices.

      But I recently had to return to C++ on a recent project, and although I was expecting some tedium, it was way worse that I remembered. MY GOD how painful it makes a lot of really trivial things. Even the nasty hack known as PHP starts looking well planned in this light.

      It may be better than alernatives if you really need the performance and low-level capabilities, but if you don't (or only a small part of your project does), you're paying a huge price for wizard points you don't need.

      Glitzy clicky interfaces do not a good product make, but a platform where _some_ thought has been given to workflow really is something we should start to expect in this day and age.

      --
      sudo ergo sum
    2. Re:To be fair to the corporates by iron-kurton · · Score: 2, Insightful

      It's true that programmers fall victim to fad-ism, but the fact is that the learning curve of Perl is quite steep compared to that of PHP. PHP (and, arguably ASP) brought something to the table that Perl lacks -- readability, comprehensibility, expandability.

      As far as RoR is concerned, it's nothing new -- it's simply a framework (a very young, immature one, at that, in terms of software maturity) that could have been written in ANY language (PHP on Rails, anyone?). This is why we're seeing RoR developers get frustrated and go back to PHP!

      I haven't heard many PHP developers going back to Perl.

      --
      Change is inevitable, except from a vending machine -- Robert C. Gallagher
    3. Re:To be fair to the corporates by Vexorian · · Score: 2, Insightful

      Sometimes I get the impression that the prophets for the Cs' demise might keep being wrong from quite a while, this has been predicted even since the nineties and the Cs are still around, I think that more dynamic languages focused in easy to use and fast development of mediocre apps are good things, however they are more likely to replace each other than to replace the Cs which are meant for another kind of application.

      I mean, python's all right as a language, but even if python took over - someone will have to code the interpreter...

      --

      Copyright infringement is "piracy" in the same way DRM is "consumer rape"
    4. Re:To be fair to the corporates by encoderer · · Score: 2, Interesting

      C++ is still around for a reason. There are whole classes of problems that simply cannot be solved using the higher level languages you're used to.

      Anyone that's ever used C++ for more than the required chapter in school would probably agree that it's not a language for dabblers.

      That is, if you want to get GOOD at C++, you need to use it regularly. You need to get GOOD at it. When you do, you learn how to avoid the most painful/tedious parts. You have easily accessible things in your toolbox, like a solid string class that you understand well.

      And you learn to avoid things like MFC where they're not needed.

      And more than anything, a good C++ developer knows that his language can do anything, and faster, than a higher level language. Device drivers. OS Kernels. Things like that.

      I'm no longer a FT C++ dev, but I did it for a long time. The ability to create and boot your very own OS is so, so worth the investment you make in the language.

      I'd never create a CRUD app in C++ because I can't see any reason I'd need to. But I could if I wanted to. And that's something that, say, a Ruby or PHP developer couldn't say (That they could build ANYTHING they wantetd to).

      And, really, if you think PHP is a "nasty hack" then you seem to me to be trading only in cliches here.

      I'm not a huge fan of PHP, but it's a modern language. It's library is ugly. It lacks naming conventions. But its actual code-base is really quite good. If you want to see some well done C++ code, check out the PHP internals. It's made a lot of progress in the last 5-7 years.

  7. 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.

    2. Re:heyho, python - the new perl. by Anonymous Coward · · Score: 4, Insightful

      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.

      Your assertion that Java 'dominates the web' is laughable, as applets have been a near-total failure, replaced wholesale by Flash- and AJAX-based systems, while on the backend PHP, Perl and more recently Python and Ruby have eaten Java's lunch. Where Java has succeeded is on big iron and with corporate accountingware (it is the new COBOL, much as C# is the new VB), and on mobile phones (as you stated), with some moderate success on the desktop.

    3. Re:heyho, python - the new perl. by baest · · Score: 3, Insightful

      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.

      You can argue that Perl's OO is pasted on, which is somewhat true, but that doesn't mean that it isn't powerfull. Try Moose. Certainly OO is a thing being fixed in Perl6. Until that is available use Moose or try to realize that OOP isn't the only form of programming.

      Saying indirectly that Perl5 isn't well designed, just pisses me off. It grew organically, but changed during these years and got refined. If you keep to best practises, Perl code can be as readable as any language and even better as it is more powerfull.

    4. Re:heyho, python - the new perl. by mcvos · · Score: 3, Insightful

      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.

      Your assertion that Java 'dominates the web' is laughable,

      No, it's your suggestion that applets are even relevant to this discussion that's laughable.

      Have you ever heard of servlets? Have you head of the dozens of web frameworks that run in them?

      You're living 10 years in the past. Right now, Java does dominate the web backend. PHP and Perl are hasbeens, and simply not suitable for the large scale web applications of today. Ruby is deifintely up and coming, but is still a long way from eating Java's lunch (though I'm sure that will happen someday -- I hope it will, because Java kinda sucks).

    5. Re:heyho, python - the new perl. by Fross · · Score: 4, Informative

      Applets? This isn't 1998.

      If you missed it, this thred is about corporates. All the big players - governments, big iron (ibm, etc), large enterprise developers (logica, capita, etc), military and most cutting-edge science development projects, use Java for Enterprise-grade applications.

      Sure, the front-end desktop/browser embedded side is dominated by flash and ajax, with flex on the rise. But only small to medium development houses use much PHP and Python. Ruby is too new/too niche for now, and Perl *is* legacy, due to too few developers around, and no major new projects being written in it (Thank God).

      Thanks for playing, try again sometime.

    6. Re:heyho, python - the new perl. by mgkimsal2 · · Score: 2, Insightful

      Right now, Java does dominate the web backend.

      In what context? PHP/Perl and to a growing extent Ruby have scads of hosting options for public projects to fit every budget, which means companies and individuals of every budget can write or use web apps and make them available publically at a domain name. This doesn't require any sort of weird mod_rewrite hacks or anything of the sort.

      Website hosting for Java-based apps is abysmal (and more expensive) by comparison. It's far more complicated to set up and maintain, hence fewer orgs offering it, less competition, fewer innovations, and more expensive service. It's also far more memory hungry than typical PHP (and perl, etc) apps.

      There are dozens of web frameworks to run Java apps. So what? There are dozens of web frameworks for PHP. And you can deploy most of them in a couple of minutes on almost any shared web host out there.

      It may 'dominate' the 'web backend' in certain vertical markets in internal usage at many companies. But that's defining the 'web' pretty narrowly.

    7. Re:heyho, python - the new perl. by Richard+W.M.+Jones · · Score: 3, Informative

      There's one big diifference, however: python is a well-designed, highly structured language.

      But still, dynamically typed so we get type errors at customer sites, slow, and memory hogging. (Also 'features' of Perl too). OO-paradigm, so clumsy to use. And the stupid whitespace thing means that patches get misapplied and it's very easy to accidentally misindent some existing code in the editor, not notice, then have the program do some totally different thing.

      Perl is probably brilliant for simple scripts, but should not be used for large programs

      That's complete nonsense. I personally have maintained 100,000-line Perl programs without problems. Divide the program up, factor out modules as libraries, do lots of testing and code reviews. It's really not that hard.

      Rich.

    8. Re:heyho, python - the new perl. by Parham · · Score: 2, Insightful

      Sorry, "hasbeens" is a strong word for a language (PHP) that can run that behemoth we call Facebook. I don't know exactly how much code is behind it, but it can't be small for the stuff they're doing.

  8. 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
    1. Re:Why not Python? by cheater512 · · Score: 2, Insightful

      Python's syntax pisses me off.

      I primarially program in Perl, PHP and C/C++ which all share virtually identical syntax.
      Makes it a lot easier mentally and you can still use the right tool for the job.

    2. Re:Why not Python? by gullevek · · Score: 5, Insightful

      Very simple:

      * the user has deep knowledge of perl but not of pythong
      * the program needs certain libs that are easy available for perl but not for python
      * the user is not very keen on the syntax of python
      * there already exists a lot of perl code & libs that can be re-used and would need to be re-written to python

      whenever you start something from scratch in a different language you have to see if it pays off. If you already have tons of libs & classes and knowledge in one language there is no need to write it in another again.

      That's why I code my scripts still in perl, because I know what I am doing, I am fast, I get it done and I have classes that help me do the things I want to do. I see no reason why I should start again in python. I really don't have the time to re-do everything from scratch ...

      --
      "Freiheit ist immer auch die Freiheit des Andersdenkenden" - Rosa Luxemburg, 1871 - 1919
    3. Re:Why not Python? by El_Muerte_TDS · · Score: 4, Funny

      Reason is simple.
      Pearls are shiny and worth a lot.
      Pythons are scary, they can bite, and have venom and stuff.
      Rubies on the other hand are a viable replacement for pearl.

    4. Re:Why not Python? by BlackCreek · · Score: 2, Insightful

      What lack of readability? All my Perl stuff is very readable, and it's easy to follow what's going on.

      Myself I almost never have a problem reading my own code. It is generally other people's code that are hard to read. You will only have an honest idea of how readable your code is when somebody else has to start maintaining it.

    5. Re:Why not Python? by jacquesm · · Score: 2, Insightful

      no, but I really don't feel a need to go back to the seventies when 'significant whitespace' was all the fashion.

      Especially the fact that tabs and whitespace are visually indistinguishable and will cause your code to suddenly not work is a real hoot. Similar gripes apply to makefiles and DNS configuration files that need significant tabs in some places. Utterly ridiculous.

      Try switching editors, importing a chunk of code using cut-and-paste with a non-python aware tool and so on.

      IMNSHO this was the biggest possible stumbling block that they could have installed to avoid large scale python adoption, it seems to have worked admirably so.

      I'll give you this though, perl is worse :)

       

  9. Sometimes the correct answer is the simplest by tanveer1979 · · Score: 3, Informative

    If we forget the conspiracy theories for a while, there are other reasons too.
    A 100K/year good programmer can also have difficulties understanding perl code.

    If you look at the most efficient perl code, it will be very small, and do a lot. But it will also mean that nobody else can understand the code

    Heck I have difficulty in understanding a couple own scripts if I look at them after a year, and that too when I add comments.

    Perl is a very very powerful language. A small change can make the code do something completely different, hence the fear.

    For example look at this
            s!(?:^|\w*/|\.\./|\./)[^\s,@;:]*(?<=/)([^\s,@;:]+?)(?=[\s,@;:]|$)!$1!g;

    Interesting?
    Thats a one line regexp which does something which appears to be very very simple to do, but actually isnt.

    --
    My Aurora : http://www.youtube.com/watch?v=o91ZsGwJYyg
    FB : https://www.facebook.com/TanveersPhotography
    1. Re:Sometimes the correct answer is the simplest by smittyoneeach · · Score: 5, Insightful

      Regular expressions are by no means a perl-only feature.
      Possibly not the best example of why perl is shunned.
      Perl is simply not winning the marketing war.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    2. Re:Sometimes the correct answer is the simplest by Alioth · · Score: 4, Insightful

      Your regexp example isn't awfully good - any language that has regexp support will have lines like that. These days, PHP has regexp support (possibly always has), C has regexp support, C++ has it, Java has it, and I expect that even C# has regexp libraries.

      The alternative to a regular expression is usually a very convoluted parser that's a lot of effort to support.

    3. Re:Sometimes the correct answer is the simplest by tomtomtom777 · · Score: 3, Insightful

      s!(?:^|\w*/|\.\./|\./)[^\s,@;:]*(? Interesting? Thats a one line regexp which does something which appears to be very very simple to do, but actually isnt.

      That looks really simple? Sorry but it doesn't look to me. Perl may be a a very very powerful language, but that alone does not make it a language of choice.

      For a company to choose a language, one should not only consider the power, but also the maintainability. One should not only consider how a strong programmer would perform in it, but also how a beginner can screw it up, and how a beginner can understand a powerful program.

      These considerations make Perl generally a bad choice. As a simple test, download 50 perl programs at random, download 50 python programs at random, compare the quality. Fact that there is to much f*cked up perl code, shows that it is an inferior language.

    4. Re:Sometimes the correct answer is the simplest by baest · · Score: 5, Insightful

      For example look at this s!(?:^|\w*/|\.\./|\./)[^\s,@;:]*(?<=/)([^\s,@;:]+?)(?=[\s,@;:]|$)!$1!g;

      But this "Perl" code is really a regular expression which is also used in PCRE and PHP and so on. Copied because it was the best there was.

      To improve readability of a regex use best practise and use /x (with whitespace and comments) and stop confusing Perl and regex.

    5. Re:Sometimes the correct answer is the simplest by BlackCreek · · Score: 3, Insightful

      s!(?:^|\w*/|\.\./|\./)[^\s,@;:]*(?<=/)([^\s,@;:]+?)(?=[\s,@;:]|$)!$1!g;

      "You have a problem, and you discover you can solve it by using regular expressions.
      Well, now you have another problem"

      I read this in the opening of a regular expression chapter of a Python book by Tim Peters (though the quote is certainly not exact); so I am unsure whether he was quoting somebody, or not. Anyway, the point stands.

    6. Re:Sometimes the correct answer is the simplest by unavailable · · Score: 5, Insightful

      s!(?:^|\w*/|\.\./|\./)[^\s,@;:]*(? Interesting? Thats a one line regexp which does something which appears to be very very simple to do, but actually isnt.

      That looks really simple? Sorry but it doesn't look to me. Perl may be a a very very powerful language, but that alone does not make it a language of choice.

      Well that is a regular expression, not Perl. It's a different language, and is the standard way of handling strings in most programming languages. To be honest, I first learned about them in a formal language class in college, years before I picked up Perl.

      If you don't like regular expressions, that's your choice, but it really has nothing to do with Perl, and you should try to understand them, as they are very useful, even outside programming.

    7. Re:Sometimes the correct answer is the simplest by jsebrech · · Score: 3, Insightful

      So your argument boils down to "perl is unmaintainable, but that's ok, because you can just replace code instead of maintaining it".

      You must write bug-free code if you never have to make small changes to existing code. My hat is off to you sir.

    8. Re:Sometimes the correct answer is the simplest by jalefkowit · · Score: 3, Informative

      The actual quote is this:

      Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

      The source of the quote is Jamie Zawinski, who said it on Usenet in 1997.

    9. Re:Sometimes the correct answer is the simplest by houghi · · Score: 4, Funny

      Do you need help with regular expression?
      http://houghi.org/shots/vim001.gif

      --
      Don't fight for your country, if your country does not fight for you.
    10. Re:Sometimes the correct answer is the simplest by Phroggy · · Score: 2, Insightful

      Fact that there is to much f*cked up perl code, shows that it is an inferior language.

      I'd say it shows that there is a lot of perl code out there. There was a time when Perl was one of the only scripting languages that people wrote crappy code in, but now people are free to choose from Python, Ruby, PHP, Java, or other languages to write crappy code in. However, since Perl is older, more crappy code has been written for it.

      I challenge you to take a random sampling of code written in the last five years, in different languages. When you exclude code written more than five years ago, you might find that Perl fares rather better, comparatively.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
    11. Re:Sometimes the correct answer is the simplest by totally+bogus+dude · · Score: 4, Insightful

      Interesting that you got modded so high, despite failing to understand what the GP was saying.

      I'm not positive what that regexp is doing, but the presence of / and ../ or ./ matches suggests it's manipulating a directory path in some way. After a few tests I think it may be intending to return the filename portion from a path, but if so it's a little buggy (and a good example of why reinventing the wheel isn't a great idea; just use basename).

      You do make a point, but I feel your method of comparison is a bit questionable. While Python is a fairly old language, it's only seen general use for a very short period of time compared to Perl. That means that a) there's likely to be a lot more Perl code around than Python code, and b) a lot of the Python code that's around will be of high quality.

      The main reason for this is that when a language first begins to be noticed, it's usually going to be embraced by people who want to show how good it is. They'll take extra care to make sure it's well written and easy to understand, because they're evangelizing the language. As a language ages, people will be using it who really don't give a crap about the quality of the code, and that will "pollute" your sample set.

      Accessibility will also have a lot to do with it. Even when PHP was a pretty new language, a random sample of code would reveal it to be vastly inferior to just about every other language you could possibly think of. A lot of this is simply because PHP became so widespread that virtually every cheap (and many free) web hosts supported it, so every newbie who wanted to learn to program started with PHP.

      A new programmer -- or a bad programmer -- can write terrible Python code just as easily as they can write terrible Perl code. But at least it will have proper indentation. I would be very hesitant to base too much of my assessment of a language on its "newbie safety factor". Else we'd all be using BASIC and Logo.

    12. Re:Sometimes the correct answer is the simplest by famebait · · Score: 5, Insightful

      The problem here is that small != mean efficient.
      Parsing the code is not what makes a program slow, and
      we don't code for 1K or RAM anymore.

      "impressive" oneliners completely fail to impress me.
      Lines are cheap.
      Time is not.
      And bugs are expensive as hell.

      I'm sure if you wrote code that walked through the
      steps in what you are trying to achieve, all the
      following would be quicker:

      * for me to see the point of what you're doing
      * for me to correctly change what it does.
      * for you to get it working right in the first place.

      If you feel it is childish to write code like
        "find A"
        "find B based on A"
        "generate C based on B"
        "silently fail for some values of C"
        "replace B with C"
      -rather than one giant, brittle regex-replace, I submit that you are the childish one.

      --
      sudo ergo sum
    13. Re:Sometimes the correct answer is the simplest by samkass · · Score: 2, Interesting

      I don't think so. It's much, much harder to write crappy code in Java than it is in Perl. Java enforces a lot of practices in its syntax that annoy the code hacker type but make the software much more maintainable down the road.

      --
      E pluribus unum
    14. Re:Sometimes the correct answer is the simplest by bytesex · · Score: 2, Informative

      And even then, perl deals with regexes more elegantly than others, because they are an integral part of the language's syntax. In java, the GP's example would have to be enclosed inside a string, and be escaped.

      --
      Religion is what happens when nature strikes and groupthink goes wrong.
    15. 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.
    16. Re:Sometimes the correct answer is the simplest by nstlgc · · Score: 3, Insightful

      You don't have to understand how to read it, beyond grepping for comments and function names.

      This has to be the single most retarded thing ever to be said in the context of software development.

      --
      I'm Rocco. I'm the +5 Funny man.
    17. Re:Sometimes the correct answer is the simplest by jacoby · · Score: 3, Insightful

      A new programmer -- or a bad programmer -- can write terrible Python code just as easily as they can write terrible Perl code. But at least it will have proper indentation.

      And we all know that proper indentation will never break anything.

      TAB Code
      TAB Code
      SPACETAB Code
      TAB Code
      TAB Code

      How long would it take you to debug that problem? It took me two hours the first time I tried to learn Python (reading someone else's code) and that's why there hasn't been a second time.

    18. Re:Sometimes the correct answer is the simplest by glop · · Score: 4, Insightful

      So true.
      I switched to Python because I could not market Perl to anybody including myself.
      I was using it from time to time and would try to convince coworkers to use it too.
      But the readability issues and the lack of keywords made it more difficult to look for documentation etc.
      As a result I could not market it to my coworkers and started having serious doubts myself. So I switched to Python.
      Suddenly, I could convince my coworkers easily as it looked good, readable, easy to learn by example etc.
      Also Perl and Python are very similar in what they offer (regexps, hashtables, string parsing, networking, modules). But Python usually offers a language construct to support important software engineering concepts (e.g. objects are native and not reimplemented every time as in Perl).

      Just my 2 cents. I tried to love Perl and market it around me. But I couldn't. PHP, Python, Linux, Wikis are easy sells but Perl is not.

    19. Re:Sometimes the correct answer is the simplest by parnold · · Score: 5, Informative

      How long would it take you to debug that problem?

      About 12 seconds. Run Python with the -tt option and it will tell you about lines with inconsistent use of tabs and spaces.

      --
      this sig intentionally left blank
    20. Re:Sometimes the correct answer is the simplest by Talderas · · Score: 2, Informative

      use strict;

      --
      "Lack of speed can be overcome. In the worst case by patience." --Znork
    21. Re:Sometimes the correct answer is the simplest by DuckDodgers · · Score: 2, Interesting

      A major Perl moto is "There is more than one way to do it".

      Flexibility in a language is good. Too much flexibility is a problem. You only need to know one way to do a set of tasks in Perl to write an effective program. I only need to know one way to do a set of tasks in Perl to write an effective program. He only needs to know one way to do a set of tasks in Perl to write an effective program.

      But you, he, and I need to know multiple ways to do sets of tasks in Perl to read, fix, and extend each others' code.

      Now, I agree that Perl's biggest problem is really just the marketing war. But this too-much-flexibility problem also exists. I understand Perl6 addresses that somewhat, but I haven't heard whether any of the compilers has a final release yet.

    22. Re:Sometimes the correct answer is the simplest by slashgrim · · Score: 2, Informative
    23. Re:Sometimes the correct answer is the simplest by bar-agent · · Score: 2, Informative

      So, the significant whitespace conveys the information formerly within { and }.

      There's more to it than that. It's like Python has personal space. Whenever another tool, or even another conceptual model impinges on its personal space, it gets cranky. Three examples:

      First, in complex software environments, you sometimes need to edit, elide, or change source code on the fly to support special software distributions. This is error-prone when you have to care about tabs and spaces.

      Second, XML and HTML. They don't acknowledge differences between spaces and tabs, or even the existence of consecutive white space. You put Python code in one of those formats, and you are guaranteed to receive errors of some kind or another. If you've ever used the STAX testing framework, you'll know this pain.

      Third, copy & paste. You can't use it reliably.

      --
      i'd hit it so hard, if you pulled me out you'd be the king of britain [bash.org]
  10. Face it, Perl IS hard by Pecisk · · Score: 3, Insightful

    Setting aside obvious reasons why corporate hats would hate anything they don't dig (tip: it is matter of control. Yes, they want to have possibility to fire you any moment without hesitation), Perl is powerful, but really hard language. Specially when it is written in hurry to complete some task. Without any shred of doc or help it is almost impossible to maintain for thirty party.

    Also, in broader picture, it is common problem with IT everywhere - nondocumented stuff which does system critical stuff is big no no. I know, lot of people see it as job security, but it is the same variation as terrorist has job security when it has hostages.

    If you want real job security, do your job properly, and you will get rewarded. And if there will be firings, they will happen in any case.

    --
    user@ubuntubox:~$ stfu This server is going down for shutdown NOW!
  11. Why Corp. hate Perl? by Manip · · Score: 4, Insightful

    Hmm let me think:
    - Few Perl Developers
    - Difficult (or impossible) to maintain
    - There are better alternatives
    - Easy to write badly difficult to write well (e.g. Language doesn't lend its self to good practices)

    Perl is a dying language and frankly it is easy to see why. The real question is what does Perl do better than the competition other than being older than my Dad and having a bunch of essentially pointless libraries?

    1. Re:Why Corp. hate Perl? by pakar · · Score: 2, Funny

      - Few Perl Developers
      Disagree. Lots of people are using it to do small fixes or administrative stuff like parsing logs etc.

      - Difficult (or impossible) to maintain
      NO. It's the same as any other language, it's only hard to maintain if the code is written badly and without comments.

      - There are better alternatives
      Like what? In what other language can you write a simple log-parser that creates some graph's over usages in less than 5 minutes and only requires minimal system-resources?

      - Easy to write badly difficult to write well (e.g. Language doesn't lend its self to good practices)
      It's easy to write well but it requires someone with some degree of development-skills to do so.

      Perl is easy to learn, easy to use. BUT it's too easy to get started with and that causes lots of new developers (or sysadmins with shell-scripting experience) to try it out and that can only result in lots and lots of ugly code.

    2. Re:Why Corp. hate Perl? by ggvaidya · · Score: 5, Funny

      other than being older than my Dad

      Perl 1.0 was released in 1987, four years before Python. How old is your dad - and more to the point, how old are you?

    3. Re:Why Corp. hate Perl? by CheeseTroll · · Score: 3, Funny

      In Internet Time, 1987 was 84 years ago.

      --
      A post a day keeps productivity at bay.
    4. Re:Why Corp. hate Perl? by jjn1056 · · Score: 2, Insightful

      People have been saying Perl's dying since 1999, almost ten years but I still get lots of recruiters calling me. Not sure what to say except:

      http://lui.arbingersys.com/

      which shows Perl ahead of all scripting languages except PHP, which has been the case for many, many years already. The numbers I see are pretty stable. Ruby had a bump last years when RoR was the new hotness, but it's back down to a more expected growth curve.

      --
      Peace, or Not?
    5. Re:Why Corp. hate Perl? by ignavus · · Score: 2, Interesting

      Perl is dying because Perl 6 is taking as long as "Duke Nukem Forever" to be released.

      There are more choices in scripting languages now than there were back when Perl 5 came out: PHP, python, Ruby, ...

      --
      I am anarch of all I survey.
  12. 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

    1. Re:Perl too readable by Bryan+Ischo · · Score: 4, Insightful

      I respectfully disagree. Which languages are easier to read and which ones are harder is of course obviously subjective. So maybe for YOU perl is easy to read. However, I myself have never, ever read or written (or written and then later read) perl code that was easy to read. There are lots and lots of very very small symbols which have very large effects on Perl code. Single characters can completely change the meaning of statements in perl. Sure that's true in many languages, but perl takes this problem to a whole new level.

      Perl will die if people in general find it to be too troublesome to write and maintain. I personally have been in that camp for years and years. This article suggests that this is a global trend, and I say, good riddance.

      C++ and perl are such different languages, that it's not really useful to compare them. They live in completely different parts of the programming language space. So it's not very useful for me to say that I find it much easier to write maintainable C++ code than perl code, even though it's true.

      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++.

    2. Re:Perl too readable by ultrabot · · Score: 2, Interesting

      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++.

      Actually, templates provide a sense of "duck typing" familiar from Python and the likes, but with static linkage and native code performance.

      Templates enable quite a lot of things that would look quite awkward without them, and perform terribly. Basically, you rarely need to create your own templated classes - they mostly reside on the "library" side of the application, so most of the time you are not really writing new templates, you are just instantiating them.

      I have spent a lot of my programming career programming in C++ without templates (because the platform discouraged their use) - but now, when I'm working on a project that encourages the use of templates, it's a hoot.

      Regarding the original topic - I thought everybody, not just the corporates, hate perl. Wake up and smell the python...

      --
      Save your wrists today - switch to Dvorak
    3. Re:Perl too readable by VVelox · · Score: 2, Insightful

      You are making the common ignorant statement made by many people and are assuming that Perl is all regex.

      I've actually have written many Perl programs that make no use of regex.

      If you are ever writing stuff you don't understand later, what it means is your skills as a programmer as severely in question. That is what comments are for. In fact Perl makes documentation a breeze with POD.

  13. "Hate" isn't the right word. by jjgm · · Score: 5, Insightful

    The problem is, Perl is just a programming language, not a conceptual system. Arguably it is the antithesis of a conceptual system. Many teams then create their own application frameworks atop it (e.g. Mason, POE), and it's rare for these frameworks to be compatible since Perl offers so many variations in the construction of even standard programming artifacts like classes & objects.

    In addition, the level of expression (i.e. TMTOWTDI) means in practice that highly varying programming styles occur throughout large, long-lived bodies of code.

    As a result, significant Perl-based business applications tend to become hard-to-maintain hairballs of divergent style and subtly variegated concept.

    The root cause: as I started with; the absence of a standard conceptual framework for Perl means that during the early phases of a project, it's much harder to reason meaningfully about the eventual form of the system than it is with, say, Java or .NET where many of the design patterns are explicitly standardised.

    I wouldn't say that "Corporates Hate Perl". It's just the Perl as an application language doesn't suit the formal design & architecture process we're seeing increasingly as IT departments start to grow up and realise that they're not the most important people in the company.

    That doesn't disqualify Perl from being a useful tool, and it'll always have a place in data transformation, but it does mean that Perl isn't going to be one of the general-purpose application programming languages of the future.

  14. For goodness sake, move on. by PinkyDead · · Score: 5, Funny

    You have to migrate your badly written and hard-to-maintain Perl code into badly written and hard-to-maintain Java code as soon as possible.

    --
    Genesis 1:32 And God typed :wq!
  15. This isn't just about "new and shiny" by wyldeone · · Score: 3, Insightful

    While it's possible to write readable code in any language (well, maybe not Brainfuck), and just as possible to write horrible spaghetti code in the same, Perl does not encourage clean, readable code like python or ruby (my preference.) As a result, nearly all of the perl code I've seen has been virtually indecipherable to anybody not a perl veteran. More modern scripting languages like ruby and python not only have "syntactical sugar" that allows complexities to be expressed more simply (and therefore, more readably) but in general discourage things like the perl super variables that radically decrease readability. Additionally, their object-oriented structure allows for more clear code organization, making 100,000+ line programs possible to understand (look at rails, for example; hundreds of thousands of lines of code, but readable for someone without great knowledge of the codebase).

    --
    In the beginning the universe was created. This made a lot of people very angry and is widely considered as a bad move.
    1. Re:This isn't just about "new and shiny" by outZider · · Score: 2, Insightful

      Python, I can agree with, but Ruby? It effectively looks the same as Perl when it's all said and done. It encourages the same use of odd characters, shortcuts, whitespace issues, and poorly managed namespaces that Perl does.

      Disclaimer: I'm a Perl developer.

      --
      - oZ
      // i am here.
  16. This is an insult by Skapare · · Score: 4, Funny

    This is an insult to associate us Perl-Haters with corporate types.

    --
    now we need to go OSS in diesel cars
  17. Re:Perl is WRITE-ONLY language. by Vectronic · · Score: 3, Funny

    Dim Perl As String.WriteOnly
    If You = Well.Disciplined.Person And Write.Comments(UBound(Perl.Lines) = True Then
            If Decrypt(Flow) Then
                    Such Things Happen
            Elseif Other.Languages = (C++ Or Java Or Python)
                    Decrypt.Method += Hard
            End If
    End If
    If Syntax.Contains("$") Then
            Return Format(My.Opinion, Humble) & "Bad Syntax"
    Else
            Return Format("", Opinions.Null)
    End If

    Ok, so the code sucks (in VB no less)... but, I just found the way you wrote your comment kinda weird...

  18. 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;
    1. Re:Writing bad code by Geoff-with-a-G · · Score: 2, Insightful

      When coding large applications, it is critical that certain coding standards are followed.

      I wholeheartedly agree with your post, but this is where the point gets missed. Perl, along with MS Access and VB, is responsible for some huge, nasty, unmaintainable systems that nonetheless are entrusted with critical functions in large companies. This is not because they are bad platforms. You touch on it by saying that "Perl makes it very easy to write terrible code, just as Perl makes it very easy to write just about anything else."

      Almost every large system started out as a small system, just as almost every large company started out as a small company. When you're a 50 man company, with a single network engineer, you don't need (and can't afford) an Enterprise IP Address Management Solution, but your engineer does need a way to manage or track addresses. So he discovers, that as a non-programmer, having never even heard of most programming best practices he is able to throw together some tools with Perl/VB/Access in a couple days. These tools work 95% of the time, and make it vastly easier for him to do his job. Some important things to realize:

      1. He would never have built these tools if his only option was to set up J2EE and follow coding best practices with source control.
      2. He is better off having built these tools than not having them.
      3. Any "real" programmer will scoff at his tools and say they are horribly written amateur code, and the programmer will be correct, but irrelevant.

      With luck, the business grows, and so do these tools/systems. Features get added. Staff gets added. Scope increases. It turns into a nasty homegrown kludge monstrosity, any starts having problems. Often around the same time that "works 95% of the time" is no longer an acceptable standard. Management will start to roll their eyes and call it a "legacy system" and suggest that HPCs come in to build a proper (aka expensive) version, or purchase some sort of industry standard version of the system and adapt that. They will usually be correct.

      It's important to understand that nobody is stupid here, and none of these tools are bad. This is just a natural evolution and you'll see this story play out over and over again.

      1. Easily accessible platforms like Perl, VB, and Access enable non-programmers (whether it's a network engineer like my example, or a PM, or accountant, or security auditor, etc) to create very useful tools that improve their productivity.
      2. If those tools work, and the company prospers, it is natural for them to expand.
      3. At some point, that expansion will scale past its proper limits and become unmaintainable, especially if its admins move on, or it starts having to integrate with other systems.
      4. The right thing at this point is to replace it with a more scalable system, or at least have professional coders drastically overhaul the original system, but this does not mean the original was a bad idea or a bad system or a bad platform. It served its purpose very well.

    2. Re:Writing bad code by synthespian · · Score: 2, Insightful

      One of the tenets in Perl's design was to keep it somehow like a human language.

      Now, consider the snippets you submitted. I will argue that the variability makes it easy to remember the code. Why? Because you are basically retaining the functionality of the code. That is to say, do people remember code per se or do they remember the functionality of the code? They remember the functionality of the code.

      Now, I have no empirical data to support this - and this is one aspect of programming that I find deeply aggravating, i.e., nobody seems to research the human factor, the psychological factor. There's very little empirical data and there's just too much opinion. It fucking looks like the social sciences, sometimes.

      But if we look at some surrounding evidence, mathematical writing, we will see that there's not a single book where Mathematics itself was not described in a human language. There's no book with Theorem/Proof Theorem/Proof/Corollary, etc. ad infinitum without a written descripition of the Mathematics.

      Of course, as you mature, you move towards heavy notation. Likewise, in Perl, as you progress you move to operators, etc, to the point where sigils abstract very nicely what you want to say (contexts in Perl are important).

      To say it differently, there cannot be pure Logos.

      --
      Main difference between the BSD license and the GPL license: one is from California and the other is from Massachusetts
    3. Re:Writing bad code by Phroggy · · Score: 2, Informative

      Pick one of the 5 methods, not all of them. Although I guess I'm ok with #5 since it is mimicking sh scripting behavior.

      Funny, that's the first one I'd avoid.

      You're right that there are at least five different ways to do this, but it should be fairly obvious which way makes the most sense in a given situation. For starters, since it looks like $debug is going to be a boolean value, you don't have to compare it to 1 or 0 at all, so that eliminates two of your options (the ones that compare to 0). Writing a conditional that doesn't look like a conditional is probably not a great idea, so we can scratch #5. That leaves is with only two options:

      • if($debug) { print "foo\n"; }
      • print "foo\n" if $debug;

      So which of these is the best? Well, syntax #1 is designed for multi-line blocks, while syntax #2 only allows single statements. If you're only going to be using single statements this way, #2 might be best; if you're going to be putting multiple print lines in your conditional block, then it's probably best to use #1 every time, even when you use a single-line block (in which case you should probably NOT write the whole thing on one line like this example, but go ahead and put the print statement indented on the next line).

      The other consideration is, syntax #1 puts the emphasis on the condition: if we're in debug mode then stop and take a break from the normal flow of our code so we can step off to the side and print "foo" before getting back to what we were doing. Syntax #2 puts the emphasis on the print statement (which may be mixed with several other print statements), with the conditional added as an afterthought.

      Some coders will pick option #2 every time, simply because it requires typing slightly fewer characters. I've been guilty of this myself, but if the idea you're trying to express doesn't lend itself to that syntax, it's better not to use it.

      Perl is about the expression of ideas in code. What's the best way to express your ideas? There are many different ways to express an idea when talking to someone, but with practice we learn how to choose the way that will help us communicate most clearly. Perl isn't much different.

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  19. 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.

    1. Re:It's possible to write rubbish in any language by arth1 · · Score: 2, Interesting

      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.

      Until someone finds out it's written in perl, and launches a project to get it ported.

      In a company I worked for, that happened. A small perl script scanned all the web server logs, removed internal accesses, and presented a list of the most common search terms, ordered by soundex (to catch and list common misspellings).
      This worked surprisingly well, providing a service that the search engine didn't. For years.

      Until someone found out it was a (hiss! spit!) perl script, and decided that it needed to be rewritten as a managed java application, supported by the search vendor.
      Of course, the result cost about as much as a small house, needed its own server, log transfers took several hours a day, and hours of manual intervention whenever (daily) a transfer failed (like if a file was larger than 2 GB or the passwords had expired), and it could not correlate results by soundex.
      This was called a success.
      The lack of functionality in the new replacement app was blamed on, I kid you not, perl, for being inherently difficult to port to java.

  20. How about the right tool for the job? by MaX_3nTrOpY · · Score: 5, Insightful
    "I realized at that point that there was a huge ecological niche between the C language and Unix shells. C was good for manipulating complex things - you can call it 'manipulexity.' And the shells were good at whipping up things - what I call 'whipupitude.' But there was this big blank area where neither C nor shell were good, and that's where I aimed Perl."
    -- Larry Wall, author of Perl

    I rest my case.

    --
    My signature is in the cloud.
  21. I don't get it by RichiH · · Score: 3, Insightful

    So, you are saying that someone, who is not specified, wants to move away from some program, which is not specified and written in Perl, to a solution based on a different language, which is not specified. You then speculate that this or might not be due to the grown & evolved nature of the unspecified program.

    How is this news? What do you actually want to tell us?

    Don't get me wrong, I love Perl. I simply do not understand why you would submit this to /. or why it would get approved. I am seriously confused.

  22. Re:Clarity and whatnot is for retards. by Lonewolf666 · · Score: 4, Insightful

    Sure, you can argue that it makes "better" code, but that "better" code has NO MORE EXTRA FEATURES. It only allows retards to work on it. And really, is that a feature?

    From a manager's point of view, yes. Because it makes it easier for the company to find someone who is capable of maintaining it once the 133t haX0r has moved on to another job.

    Besides, don't underestimate the importance of clarity and modularity in architecture. Which is not the same as "coding standards" that enforce things like naming schemes for variables. The latter is rather low-level and understandable to a PHB, the former is still more of an art and not easily measurable.

    --
    C - the footgun of programming languages
  23. Re:dynamic Lang by fishbowl · · Score: 2, Informative

    I worked in a shop that replaced a really complicated process that had been written in COBOL, with
    a really efficient, compact, regex-based, DBI-enabled perl program. I'll let you explain to them
    why that's inappropriate for their enterprise scope... :-)

    --
    -fb Everything not expressly forbidden is now mandatory.
  24. Re:Perl is WRITE-ONLY language. by fishbowl · · Score: 5, Insightful

    >IMHO, a syntax where you have to prefix a variable with a special character ($ in Perl's case) is a bad syntax.

    The argument isn't really about syntax; it is rather the strong-typing versus weak-typing argument,
    and that is worthy of far more investigation than simply declaring it "bad".

    --
    -fb Everything not expressly forbidden is now mandatory.
  25. Re:I hate perl too by Hal_Porter · · Score: 4, Funny

    chomp is not ambiguous. RTFM and stop crying.

    http://perldoc.perl.org/functions/chomp.html
    This safer version of "chop" removes any trailing string that corresponds to the current value of $/ (also known as $INPUT_RECORD_SEPARATOR in the English module). It returns the total number of characters removed from all its arguments. It's often used to remove the newline from the end of an input record when you're worried that the final record may be missing its newline. When in paragraph mode ($/ = "" ), it removes all trailing newlines from the string. When in slurp mode ($/ = undef ) or fixed-length record mode ($/ is a reference to an integer or the like, see perlvar) chomp() won't remove anything. If VARIABLE is omitted, it chomps $_ . Example:

    If anything I'm crying harder after reading that.

    --
    echo -e 'global _start\n _start:\n mov eax, 2\n int 80h\n jmp _start' > a.asm; nasm a.asm -f elf; ld a.o -o a;
  26. 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.

  27. Programming tricks by dargaud · · Score: 3, Insightful
    Exactly. In the words of one of my former bosses (while working on Perl projects):

    Whenever you think of a clever programming trick: forget it !

    --
    Non-Linux Penguins ?
  28. What's killing Perl... by pjf · · Score: 3, Informative

    ...is backwards compatibility. In general, you can take some obscure piece of code that someone wrote almost a decade ago, and it will run on your modern Perl system. Unfortunately, people then take those obscure snippets of code, and try to learn from them. They may have been the best way to do things eight years ago, but they're certainly not now.

    As such, one of the hardest problems with Perl is education of new techniques. Too many systems still use CGI.pm when they could use Catalyst. They use some home-grown system of objects, when they could be using Moose. They put up with outdated techniques when Perl::Critic would find them in a heartbeat.

    So, if everyone learnt the new techniques, we'd be fine, right? Unfortunately, it's not that simple. I teach Perl for a job, it's still an incredibly popular language here in Australia. But because that old code still works, I still need to teach people how to understand it, even if I then proceed to teach them better ways so they can avoid it. That increases cognitive workload, and there's only so much one can fit into a fresh brain during its first contact with a language.

    Perl still remains the language of choice for writing minesweeper bots.

  29. Quality vs Complexity by Hairy1 · · Score: 5, Insightful

    As a software manager what i'm interested in is developing quality applications. The biggest cost in software is maintenance. If a language is difficult to read by the original author it will be impossible to maintain by anyone else.

    I would consider Python because it encourages good design and readable code. Professionally I use Java because I can easily hire people who use it, and it also encourages good design and readable code, if a tad verbose.

    Perl is very consise, but also difficult to read. It turns into a maintenance nightmare, and there are far fewer developer who know Perl.

    Python is far better; it is more consise than Java, has similar OO features, is readable. It isn't quite up to replacing Java, but has impressed me and many other Java coders.

    Oh, and I have no sympathy for coders who think they are so cool being able to code in ways nobody else understands. I would rather see a slightly slower algorithm thats clear than a fast one that is unmaintainable.

    Complex code is the enemy of quality, as is premature optimization.

  30. Or it could be that humans connect dots by Moraelin · · Score: 2, Insightful

    Or it could be that humans are smart enough to notice things and connect the dots, even if they don't fully understand the subtleties of what they're connecting. They notice that smashing two flintstones together makes sparks, and sparks can light a fire, and all of a sudden the whole tribe has fire. Even if they don't fully understand what fire is or why those stones create sparks. Or they put their finger in the candle flame once, it hurts, they don't do it again. Or maybe if they want to be really sure and scientific about it, they put their finger in it a couple more times. It hurt again, so they stop doing it. They don't wonder exactly what happened there and what nerve endings fired that signal, but they stop doing it anyway.

    In this case, the summary already tells you what you need to know: " 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."

    Ah-ha. Maybe _that_ is why management is trying to steer off it? My understanding of Occam's Razor say it might just be the right explanation.

    And in the end that's what they're supposed to do. If all those many projects and departments (again, TFA spells it out), and indeed many other companies too, produced unmaintainable code in Perl, maybe it's time to try something else than Perl. It's that simple. And if you can hire 3 new kids fresh off university who are already good in Java and/or Python instead of 1 mythical uber-coder who can user Perl right, then it's even more of a no-brainer. That's the kind of thing management is supposed to do.

    You _could_ say that it's not Perl's fault, it's the humans who don't use it right. But then they said the same thing about Communism in the USSR. Let's face it, the smart way to do anything is to figure out how to use the resources you actually have, not to try to pretend they're something else. We have plenty of examples of people who tried to idealize humans as having to be anything but what they actually had, and lost. The USSR is one example. Napoleon III and the silly French notion that they should just have "elan" and overcome any odds or equipment disadvantages, is another. I'm sure that while he was capitulating at Sedan he had time to think about it.

    The same applies here. If the humans you have (H1Bers or anything else) are bad at Perl, then maybe it's time to try something else.

    And while you may laugh at "pointy-clicky" tools and trying to use cheap incompetents, well, that's the history of human civilization. That's why we built tools in the first place. So some ape who's too much of a wimp to bite a gazelle's neck off, can still hunt as well as the lions. Then so some wimp who can barely lift 20 kilos of rocks, can use ropes and inclines to move 20 ton blocks up a pyramid. Then so some half-educated merchant who can barely do maths up to 20, can use an abacus to do maths up to tens of thousands. Etc.

    There's no failure, management or otherwise, to try to use better tools. Even if it's instead of wishing for that uber-guru who can do the same job without tools, at only 10x the price. If we waited for the uber-workers who can lift 20 ton stones, we wouldn't have pyramids yet. And if in the process you enlarge the potential pool of workers a bit, well, even better. Society on the whole then can use more of them and achieve more.

    Yes, maybe you can program without "pointy-clicky" tools. And some people still can weave without mechanized looms. Guess what? The industrial revolution happened when we figured out a tool (that mechanized loom) which let masses of drooling retards weave just as well as those l33t weaving gurus did without tools. And even faster at that. And guess what? We all ended up better off for it.

    --
    A polar bear is a cartesian bear after a coordinate transform.
  31. Why the python tag? by PhilHibbs · · Score: 2, Informative

    The article talks about PHP and Java as the alternatives that these companies are talking about, not python. Why is this tagged as "python" when it has nothing to do with the article? Why not tag it "c" or "ruby" "cobol"? Smells of fanboy to me, and that isn't a good smell.

    1. Re:Why the python tag? by discord5 · · Score: 2, Interesting

      Smells of fanboy to me, and that isn't a good smell.

      Most of the comments here smell like fanboyism, both from the perl camp and the other camps. I like the way articles like this always get 500+ comments in no time eventually ending in language du jour-camp claiming to have a better language with awesome syntax, language of old-camp claiming they can rapidly do things (it's called experience, btw), language-of-non-related-camp chiming in on having better OO-support, and language-of-years-of-training-in-acronyms-camp loudly proclaiming to be dominating the market in acronym.

      Language wars aren't productive. I spent a year in an office with two guys that loved flaming eachother over their favourite language. 3 years later both of them have chosen other languages to go all zaelot about, and I'm so incredibly happy not to have to listen to it all day long.

      But for completeness, I used to use perl a lot in my previous job, mostly for CGIs and quickly hacking together something I'd rather not do in bash. These days I spend a lot of time in java and C++, with every now and then a dash of python. I like to think that each programming language comes with its own mindset, idioms (and idiots) and each has their own advantages and disadvantages. I still use perl for small personal projects or quickly parsing a 200MB textfile and formatting it to another kind of textfile, simply because I can use it to things quickly or because it only needs to be done once.

      Perl may have the elegant look of an infuriated elephant ramming a jeep (depending on the sloppiness of the programmer), but it's helped me do things on so many occasions in a matter of minutes that would take a lot longer in another language that I occasionally grab back to it. I still prefer it over bash for something more complicated than piping a couple of programs, and that will probably not change until it's no longer included in the operating system I will be using then.

      As for all the regex hate on slashdot... I don't really get that. They're incredibly handy for parsing text quickly, but like with all things: if you take it too far you're just asking for trouble. I actually saw someone hack together an XML parser in 3 very complicated regexes, while thinking "That's impressive, but probably a very bad idea". A few days later I saw him throw a hissyfit over XML namespaces and thought "That was a bad idea".

  32. 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
  33. Re:Perl is WRITE-ONLY language. by oliderid · · Score: 3, Insightful

    If you give your variables/functions meaningful names (ie: $StoredPrice instead of $st, savePrice() instead of sv()) then half of your reading problems is fixed already.

    I'm truly tired of that laziness. Well written codes should need the minimum of comment. Oh...And by the way, tabulation and don't play the genius coder while trying to put as much as instructions per line. Split them wisely. Then everybody is happy, whatever the language is...It will be readable.

    My main concern with Perl is the object oriented feature, for the rest, it works like a charm. The synthax isn't that hard, the problem is the lambda Perl coder bad habits IMHO (trying to be the most cryptic possible), it is purely cultural and it has nothing to do with the language as far as I know.

  34. Re:Clarity and whatnot is for retards. by famebait · · Score: 3, Insightful

    None of the things you mention improve clarity, modularity and maintainability.
    Well possibly wrapped accessors, but only when called for.

    What i meant was avoid clever-but-stupid shit like displaying
    how much crap you can get done with a bodyless for-loop,
    deep if-trees that might save you a superflous comparison or
    two, but take all day to read correctly and correctly implement
    a really simple change in the underlying rule.

    If you do database access, data representation, transformations
    and file output, please don't do them all all over the place.
    You don't need to amake a plugin architecture, but it really
    doesn't cost much to design a simple output module API so it might
    be switched with a completely different output engine later.
    And guess what: it will make your code clearer and better even if
    you never make that second output module.

    --
    sudo ergo sum
  35. Perl in bioinformatics by ewanb · · Score: 2, Interesting

    As someone who has both written and read _alot_ of perl, in particular in Bioperl and Ensembl, in bioinformatics I have a rather love/hate relationship with Perl.

    I love: the low learning curve for people coming from biology, with alot of forgiving behaviour (in particular I think the auto-creation of datastructures as you use notation to fill in complex anonymous - think pointer based - structures). This is probably the critical one which means we can hire a much broader group of people with a much better understanding of biology and for them to be productive far earlier

    I love: the large and robust libraries accessing nearly every sort of database, web-app and other things you need

    I love: the consistency of behaviour between systems (don't get me started on Java or porting C++ code between compilers/library systems. Ugh! unbelievable pain as one starts using those languages and move between high end systems. Its C for the fast stuff and Perl for anything else for portability in my book).

    I love/hate: The (huge) amount of robust existing Perl code that we have in Ensembl and that works day in, day out on multiple outings

    I hate: The lack of clean objects. Why, oh why, oh why?

    I hate: The inability to switch on strong typing and bigger checking optionally in libraries - I know you can do more these days, but it is still clunky.

    I hate: switching the word "continue" (in C) to "next" (it gets me every time)

    I hate: having to always brace if statements

    I hate: operators designed for one-liners that gets in the way of good readable code - grep and map in complex lines are pet hate of mine.

    I hate: the tortorous cross-language capabilities - compare python's jython and other C-level compilers. Soooo much better.

    Interestingly I coded in python for about 6 months in the late 90s - very early on python - and lots python appeals to me. But then Perl came along, and lots of bioinformaticians were using it, and systems people were installing it by default on systems...

    Roll on Parrot. I want Parrot to be able to run
    Perl5 syntax code, Perl6 and Python/Java syntax
    all together, with easy ways to load in C level or compiled down libraries. That's what Perl needs to save it.

  36. The Real Reason by jalefkowit · · Score: 2, Insightful

    ... is Perl6.

    "Corporates" hate investing in technology that appears to be on the verge of being made obsolete. Obsolescence means rewrites, and rewrites cost money. They would prefer to wait for the new version and just build with that.

    Usually this isn't a problem since the wait between announcement of a new version and release is a couple years at most. But Perl6 has been threatening to obsolete Perl 5 for nearly a decade now, without actually ever materializing. That's scary for "corporates" because they can't plan their Perl6 migration. All they know is that at some undefined point in the future, they're going to have to do it, or move to another language altogether -- and in the meantime, every line of Perl they pay for is just adding to the potential future liability.

    I know we'll hear from Perlistas that Perl6 is awesome, and for all I know it may turn out that way. But for years now all it has done is inject uncertainty into the case for using Perl, and uncertainty is something "corporates" try to minimize, for good reasons.

  37. No one's mentioned this old ESR article yet? by sgtrock · · Score: 2, Informative

    He describes quite succinctly why he moved away from Perl back around 2000:

    ...Writing these programs left me progressively less satisfied with Perl. Larger project size seemed to magnify some of Perl's annoyances into serious, continuing problems. The syntax that had seemed merely eccentric at a hundred lines began to seem like a nigh-impenetrable hedge of thorns at a thousand. "More than one way to do it" lent flavor and expressiveness at a small scale, but made it significantly harder to maintain consistent style across a wider code base. And many of the features that were later patched into Perl to address the complexity-control needs of bigger programs (objects, lexical scoping, "use strict", etc.) had a fragile, jerry-rigged feel about them.

    These problems combined to make large volumes of Perl code seem unreasonably difficult to read and grasp as a whole after only a few days' absence. Also, I found I was spending more and more time wrestling with artifacts of the language rather than my application problems. And, most damning of all, the resulting code was ugly--this matters. Ugly programs are like ugly suspension bridges: they're much more liable to collapse than pretty ones, because the way humans (especially engineer-humans) perceive beauty is intimately related to our ability to process and understand complexity. A language that makes it hard to write elegant code makes it hard to write good code.

    With a baseline of two dozen languages under my belt, I could detect all the telltale signs of a language design that had been pushed to the edge of its functional envelope. By mid-1997, I was thinking "there has to be a better way" and began casting about for a more elegant scripting language.

    The rest of the essay can be found here.

  38. I hope you're not doing that manually? by Medievalist · · Score: 2, Informative

    I use gawk (Gnu Awk) for that job. It's the best tool I've found for rapidly re-writing hundreds of source code files on a running production system.

    Arnold Robbins: "AWK is a language similar to PERL, only considerably more elegant."
    Larry Wall, from audience: "Hey!"

    find \corp\perl -type f -name \*.pl -exec fixbug.awk {} \;

    Better be sure you know what you're doing before you press the button, though! I recommend building a cloned test environment.

  39. Re:You are correct sir by Anonymous+Brave+Guy · · Score: 2, Interesting

    Perl has no mainstream, normal, people yelling and screaming for it. There's just the older, gruffer programmers and, more likely, sysadmins.

    Yeah, the same sorts of idiots who still use UNIX, Emacs, C and Usenet (with that whole snipping and bottom-posting weirdness). Some of them probably even grok Lisp and wasted their time learning prehistoric nonsense like assembly language. Don't even get them started on documentation, or designing code before writing it; if you even mention unit tests, they'll just mumble something about understanding how code works before changing it. What have people like that ever done for the world, anyway?

    You know, one day it would be really funny if these dinosaurs decided to take a sabbatical for a couple of months, all at the same time, and let the younger generation and their high-tech advances run the show for a while. Then management would see how much more effective you can be with a 3D GUI in your OS, a visual IDE, web application frameworks and wikis!

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  40. MOD UP by $RANDOMLUSER · · Score: 2, Interesting

    The parent post is genius.
    He only forgot the part about how when the bridge is halfway built, they come back and say:

    "We need the bridge to be at a different location on the river (enen though we didn't specify one in the first place)."
    OR
    "We see you're building a suspension bridge - we need it to be an arch bridge."

    "Oh, and by the way, your materials budget and deadline haven't changed."

    --
    No folly is more costly than the folly of intolerant idealism. - Winston Churchill
  41. Blame the coders, not the language by jjohn · · Score: 2, Insightful

    You can infer from the low UID of my account that I've seen one or two of these "perl sucks" kinds of articles. There's a flamewar. There's mention of python or ruby or C or java. There's the old saw "perl is too complex", "perl doesn't have an IDE", "perl is line noise". But it takes awhile before someone just calls it right: there's a lot of bad perl code because there's a lot of bad perl programmers.

    That's not a knock on Perl.

    Perl is powerful enough that even crappy programmers can do useful work. That's saying something positive about the design of Perl. That Perl allows bad code also says something positive about the design: it's not a fascist regime.

    Now, if you need your language design to prevent the creation of unmanageable code, you'll be looking for the language for a very long time.

    So next time we start this thread about Perl being bad, let's just skip to lambasting the crappy coders and leave Perl out of it please.

  42. 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.
  43. Perl Stagnated (aka Duke Nukem Perl 6 Forever) by Argon · · Score: 2, Interesting

    I think Perl blew it by the inordinate amount of time Perl 6 is taking. I am surprised nobody mentions this. Pythona and Ruby on the other hand have good roadmaps (especially Python). They make releases like clockwork, they're always in the news about new frameworks and some cool stuff. Perl usually is in the news for the wrong reasons, mainly about why Perl 6 is so delayed. Perl has simply lost mindshare. Oh, I know Perl has not really stagnated. Perl 5.x series has been making steady progress but that only appeals to people who're already using Perl. For newer people taking up a scripting language, Perl seems like it's past it's prime. Besides, let's admit it - the language is arcane; especially the OO stuff in Perl 5. I even find OO interfaces in perl modules unintuitive. If someone likes Perl and wants something more "clean", modern and shiny, I'd recommend Ruby though I personally prefer Python.

    Don't mistake me. I was (and still am) a big fan of Perl - mainly Perl 4 though. It's one of the most powerful languages that I've used. Even today, I usually start writing something in shell (because I am throwing together a bunch of programs to get my job done). Then I hit the limitations in shell and usually port the program to perl. That said, I have mostly switched to Python, especially when I am starting to write something from scratch.

  44. Cowboy Perl, Rise of Scripting and Fear of Brevity by pileated · · Score: 2, Insightful

    I'm primarily a Perl programmer, though I do some Java and Ruby.

    Someone mentioned Damian Conway's book 'Perl Best Practices' and all I can say is that if Perl had had that book 10 years ago it would have a better reputation than it does now. In my 15 or so years of experience with Perl I think that its worst problem is the Cowboy Coders, who often mistake obfuscation for genius. It sure seems like the early days of Perl were also the days of Cowboy Coders. Books like 'Perl Best Practices' try to salvage the best of Perl from the worst practices of the Cowboy Coders.

    On the other hand I have no sympathy with those who don't like what Perl looks like. I may be fearful of sharp knives too. But if they get the job done better than a blunt one then the thing to do is learn how to use them. Perl's brevity can lead to difficult to read and maintain code but it also makes it very powerful. Much can be done in a small space. Using Perl, along with the guidelines of Damian Conway, I think anyone can write very good, powerful, legible and maintainable code. It is not a bad language.

    However there are times when trying to hold in my mind exactly what some 4-5 level deep dereferencing variable in Perl really refers to that I prefer the more verbose but easier understood style of Java. Perl is full of shortcuts. They are very powerful, but sometimes do require a lot of concentration before their meaning can be understood. For someone who uses Perl everyday the shortcuts probably make perfect sense. For everyone else it can take a long amount of staring before any of it makes sense. Does this make it bad? I don't think so. It's just that it's not as immediately comprehensible as some languages. On the other hand imagine a Perl programmer faced with the verbiage of Java. The same type of blank look sometimes comes over my face when I switch from Perl to Java: I think, my God, there's a lot of verbiage here. Why does it have to be so big. Why do I need to declare the type of the variable not once but TWICE? What could be worse than that?

    The one thing I can say about Java is that rarely do I run across a surprise because something is in a scalar rather than a list context. Java is pretty straightforward. Perl has a lot of things, like context, that aren't straightforward.

    Finally I have to wonder about Groovy, Ruby and other popular scripting languages. Why in the world does Java need Groovy (about which I confess I know little)? From what I can see some people are seeing the virtues of scripting languages, especially dynamically typed languages. So it looks like Java users are a bit jealous of the ease of scripting languages of Perl, even with all of their possible problems.

    To me it's understandable: a scripting language can be great for getting something done quickly. It's just that if very good coding practices aren't followed the code can either have hidden bugs and/or be difficult to maintain.

    To conclude I think that the very presence of languages like Groovy show that there is always a demand for scripting languages. Perl is among the best. It's just got an awfully dirty history and a lot of bad habits that may need to be overcome to make it as popular as it should be.

  45. It's hard to maintain because Perl is. by blair1q · · Score: 2, Insightful

    Perl is just plain hard to maintain.

    Very few people know how not to use all the things that obfuscate a perl program.

    Even good perl programmers have trouble understanding perl code written by other good perl programmers who use different idiomatic constructs.

    And not many people are learning Perl as deeply as they did when it was newer, which makes it even worse as a maintenance problem, and a drag on developing your entry-level maintainers into good programmers.

  46. Perl is hated because it begets a putrid mess! by itsybitsy · · Score: 2, Interesting

    Have you actually seen the Perl syntax? It's a horrifying mess designed for people who like twisted grammar puzzles and cryptic codes (and cyptics like RMS who think that recursive acronyms are cool). To express anything clearly in Perl requires a frontal lobotomy and a C-section at the same time (yeah, even if you're male).

    It's such a freakish language that it's got syntax for syntax rather than a very clear simple syntactic idea like LISP or Smalltalk or Self or, fuck, even C is easier to comprehend than Perl.

    There's an article over here that covers some points why Perl sucks the big one and doesn't even suck well at it! When a language sucks at least I want a good blow job!
    http://smalltalk.org/articles/article_20040914_a1.html

    Basically Perl sucks because you need this to figure it out:
    http://www.ozonehouse.com/mark/blog/code/PeriodicTable.pdf

    Professional systems people want their systems to be clear and as easy to grasp as possible, Perl provides the opposite. We ONLY use it when the existing system is using it, and then we only do maintenance bug fixes (lots of those) and do not under any circumstances add new features to programs written in it!

    The above are a few reasons that Perl is ostracized from the corporate space and should be excised from your brain.

    If you want to hack your way through life, fine, be cryptic and use Perl. If you want excellent systems that perform and get results use a language that helps in that regard: Smalltalk, Lisp, C. Avoid Java, C++. Heck use Assembly Language before Perl!