Slashdot Mirror


Damian Conway On Programming, Perl And More

Andrew writes: "My host pair.com has an interview with Damian Conway in which he talks a lot about his upcoming modules, and what skills a Perl programmer needs. I'm personally waiting on Parse::FastDescent." Conway talks about some interesting modules he's working on, Perl 6, and on programming in general, too.

185 comments

  1. Most interesting by Anonymous Coward · · Score: 1, Interesting

    Is that Damian dislikes C++ for the same reason he seems to support Perl 6. Both seem to have gone into comittee and emerged ugly, baroque monstrosities.

    At least this interview didn't try to sell me a book.

    1. Re:Most interesting by vax · · Score: 1

      hmm well I disagree. Perl is a great language and if you dont have the openmindedness to see it thats not my problem.

  2. Constant Updates by katana · · Score: 5, Interesting

    Although slashdot loves to post Damian Conway stories, those who still haven't had their fill can follow his online diary at yetanother.org.

  3. Software as Art? by Renraku · · Score: 1, Interesting

    "The single most important skill is programming itself." Based on the way I think, I could become a good programmer. People have told me all my life that I'd make a good programmer. But if I don't have a drive to program, all of it is in vain.

    --
    Job? I don't have time to get a job! Who will sit around and bitch about being broke and unemployed then?
    1. Re:Software as Art? by igorwawrzyniak · · Score: 1, Funny
      According to Larry Wall, it's quite easy to be a good programmer. Here is a quote from The Camel Book:
      We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris.
  4. Two clicks? I think not... by tunah · · Score: 1
    --
    Free Java games for your phone: Tontie, Sokoban
  5. Conway is a Madman, the proof... by thelen · · Score: 3, Funny

    Current projects:

    1. "Parse::Perl. Just as the name says, its goal will be to provide a pure Perl parser that parses Perl itself."

    2. "I'll soon be releasing the infamous Lingua::tlhInganHol::yIghun module, so that people will finally be able to program perl in the original Klingon!"

    3. "I often find myself developing right in my editor. In fact, I have a key permanently bound to ":!perl -w %" under vi for just that reason."

    Good God, vi?!

    1. Re:Conway is a Madman, the proof... by yatest5 · · Score: 3, Funny

      vi is the greatest thing on earth. nothing beats the fun factor of typing the 'replace the next 500 characters with' command and watching your fellow developer crap all over his code the next key they press and the ensuing panic. You'd think this would only work once - but ohhhh no.

      --
      • Mod parent up! [a] by Anonymous Coward (Score:5) Thurs, June 31, @13:37
    2. Re:Conway is a Madman, the proof... by jeremyp · · Score: 2, Informative

      vi is the greatest Unix tool ever invented.

      vi is the only remotely usable text editor that is guaranteed to be available on any Unix box. It's the lingua franca of Unix text editing.

      vi is a bit bizarre for anybody coming from a graphical environment, but once you get used to it, it is as efficient and powerful as any other text editor with the exception of emacs, but life's too short to learn the bits that emacs does that vi doesn't.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    3. Re:Conway is a Madman, the proof... by Detritus · · Score: 2
      vi is the only remotely usable text editor that is guaranteed to be available on any Unix box. It's the lingua franca of Unix text editing.

      That's funny, I didn't have vi on my PDP-11/23 based microprocessor development system that ran V7 UNIX. It just had ed and a vendor-supplied screen editor. I used that system up until a few years ago.

      --
      Mea navis aericumbens anguillis abundat
    4. Re:Conway is a Madman, the proof... by WWWWolf · · Score: 1
      vi is the only remotely usable text editor that is guaranteed to be available on any Unix box.

      And I have heard that ed is the only text editor that is guaranteed to be available on any Unix box (even on the relatively rare *NIXes that don't come with vi...)

      Of course, that's not "remotely usable", it's in fact pretty far from casual usability, so you are still correct =)

    5. Re:Conway is a Madman, the proof... by Anonymous Coward · · Score: 0

      Damian was my first ever lecturer at University. He taught us c. I can honestly say he was the best lecturer at the Uni - he had total control of the theatre and you understood what he meant.

      Did I mention that he knows how to juggle?

      Back on topic... Yes, I can remember walking past his office many time and he would have xsessions open to vi.

      Long live vi !!!

  6. Difficult climate by ArcSecond · · Score: 3, Insightful
    And it's the skills to do that -- analysis, design, coding, object orientation, structured programming, design patterns, unit testing, extreme programming, documentation, communication, teamwork, etc. etc. -- that makes someone marketable in today's difficult climate

    I suppose he's talking about the post-dot-bomb world we live in, but these are probably important at any time. Funny, though: a majority of programmers I've known--while intelligent and relentless--place less emphasis on the "documentation, communication, teamwork" skills. Of course, that's where technical writers and project managers come in handy... (heh heh)

    One thing I've noticed about Perl people is that they are often very open-minded about using other languages to solve a problem. Maybe it's because they are so used to losing the "let's develop in Perl" argument, maybe because they are more naturally inclined to use every tool available, or maybe it's because they want to figure out a way to parse every computer language known to humanity from within a Perl module...

    --

    I've got a bad attitude and karma to burn. Go ahead. Mod me down.

    1. Re:Difficult climate by Pathetic+Coward · · Score: 1

      Conway says:

      I'm a good example of that. If I have to stop working for Perl next year, and start working for pay, I'm fairly confident I'll be able to find a good job. And *not* because I have special skills in mod_perl, XML, data mining, biotech, desktop applications, or .NET (just between the few thousand of us, I have negligible skills in any of them!)

      Someone will hire me simply because I'm a very good, very experienced, very reliable programmer. And because I'll bring with me a deep understanding of algorithms, and of program design, and of efficient code structures, and of pure problem solving. I may have to learn about XML or RPC or DNA or some other TLA, but that's okay. They're hiring me for skills that *can't* be picked up from a book, nor to a deadline.


      It's obvious that he hasn't even tried to look for a job at anytime within the last year. He wouldn't even get in the door with that attitude. If you don't have exactly what a manager is looking for, you don't have a chance.

    2. Re:Difficult climate by jeremyp · · Score: 2, Interesting

      A good manager who knows about programming would hire him. The problem is they don't exist (or are very rare).

      One of the reasons for my irrational hatred of all things java is that a lot of people involved with it seem to think that java is a skill. It's not, it's knowledge. In my last company, we did a lot of programming with C and C++ and various technologies such as RPC, Corba, COM etc etc. and yet at least two people resigned because they couldn't put the magic j word on their resume. Careerwise at the time (pre dot bomb) they were right. You could have 10 years of C coding experience, a signed certificate from Donald Knuth that you were the top programmer of all time and you still couldn't get a job in a .com startup because you didn't know java yet.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    3. Re:Difficult climate by jaypifer · · Score: 1

      Of course, that's where technical writers and project managers come in handy... (heh heh)

      Hehehe, good one. =)

      One thing I've noticed about Perl people is that they are often very open-minded about using other languages to solve a problem.

      I only half agree here. Many Perl programmers have grown out of dynamically generating HTML to CGI to XML and whatever so they are used to working with other languages and have little aversion to doing so. Unfortunately, these open minded groups are interspersed with open source zealots who refuse to look at the problem first and then choose a tool (read: language).

      --
      Never go to sea with two chronometers; take one or three.
    4. Re:Difficult climate by Anonymous Coward · · Score: 0
      One thing I've noticed about Perl people is that they are often very open-minded about using other languages to solve a problem. Maybe it's because they are so used to losing the "let's develop in Perl" argument

      Or maybe it's because they've watched other people be bigots about their own favorite languages and don't find it a very positive personality trait.

    5. Re:Difficult climate by ethereal · · Score: 1

      That is so nuts, because Java was basically designed to be easy for C/C++ programmers to pick up. I went from nothing to fairly competent in Java in a month, just based on past C, C++, and OO experience.

      Not hiring a competent C/C++ programmer because they don't know java is like ... well, I couldn't even think of a good example here, but trust me, it's a poor hiring decision to not hire that person.

      --

      Your right to not believe: Americans United for Separation of Church and

    6. Re:Difficult climate by brsett · · Score: 1

      Maybe Java was designed to be easy for a C/C++ programmers to learn (I doubt that, but . . .), but it isn't. There are many different nuances and idioms that are quite different. The use finally and inner classes as closures are 2 examples. That is not to say that Java is hard to learn, just that Java mastery is a skill unto itself. Fortunately it is a skill I no longer need :-).

    7. Re:Difficult climate by ethereal · · Score: 1

      I didn't say I was a master yet :) It may take some time to master the details of Java, but the syntax is specifically C/C++ friendly so that it's easy for a C/C++ programmer to jump into Java and start changing things around, trying things out, etc. without having to start from the ground floor. Java may not be easy for C/C++ programmers to master, but it is easy for them to jump into and almost immediately be fairly productive. I just wouldn't make that programmer your system architect for another few months :)

      It's the same way that Perl was designed to be easy to pick up if you already knew sed, awk, grep, and sh. Sure, Perl has nuances that are way beyond those tools, but the Perl newbie can still dive right into Perl based on their past knowledge of those tools without too many problems.

      IIRC, it was easier for me to go from C/C++ to Java than it was to go from sed+awk+grep+sh to Perl, but I had a lot more time pressures at the time I was learning Perl.

      --

      Your right to not believe: Americans United for Separation of Church and

    8. Re:Difficult climate by Trejus · · Score: 1

      One thing I've noticed about Perl people is that they are often very open-minded about using other languages to solve a problem.

      Or it could be that we find it very funny to watch the people that beat us in the "let's develop in PERL" argument struggle for hours with some problem. And better yet, after they finish their exhausting work, we get to laugh with glee as we code up a script in 30 secs that does the exact same thing.

      --
      "To save the planet, I had to go to the worst spot on Earth, and that was Philadelphia." -- Sun Ra
  7. What's this guy on? by tunah · · Score: 4, Funny
    I want to teach it to ... convert adjectives (e.g. "happy" or "good") to adverbs ("happily", "well"), take an adjective (e.g. "happy" or "good") and generate comparative ("happier", "better") and superlative ("happiest", "best") forms, etc., etc.

    By which of course he means good, gooder or goodest. Damn intellectuals.

    --
    Free Java games for your phone: Tontie, Sokoban
    1. Re:What's this guy on? by stesch · · Score: 1
      Nothing's so worse it can't get worser.

      Except my English.

  8. language preference by Transient0 · · Score: 2, Interesting

    i found his choice of programming languages very interesting myself. he really seems to be a big fan of elegance. personally i've always found the idea of thinking of code as art to be rather offensive. i mean: i code and i appreciate art. i think to suggest that there is a crossover demeans both. not to mention that he praises the hypercard scripting language and i have something of a vendetta against it having spent several months once trying to update a massive piece of edu-software written entirely in uncommented hypercard script. blech.

    1. Re:language preference by dismayed · · Score: 2, Interesting
      I don't completely agree with you.
      i think to suggest that there is a crossover demeans both.


      Why does it demean both? I know there are very "strange" forms of art. I don't find calling code "art" to be demeaning as a coder, however, I think that there is elegance and style in code which definately resembles writing, which is artistic... right? After all, code should be written to be read by humans, not just the computer... Writing the story of how the program's (story's) variables (charachters) solve (defeat) the problem (the dragon/enemy/etc) is pretty artsy to me. Perhaps I'm just confused... it is nearly 3am.
    2. Re:language preference by jeremyp · · Score: 2

      No coding is a craft or maybe engineering, not an art. An artists's objective is to produce something that has an aesthetic quality. An engineer's or craftsman's objective is to produce something that performs a function. "Aesthetically pleasing" is secondary. e.g. the function of a bridge is to get people or things across a river without them getting their feet wet. It's no good designing a roadbridge which looks beautiful but collapses when the first car crosses it.

      --
      All I want is a secure system where it's easy to do anything I want. Is that too much to ask ~~ Randall Munroe
    3. Re:language preference by kubalaa · · Score: 2, Insightful
      Any definition of art based on what's "aesthetically pleasing" will be agreed upon by noone and fail to cover half the things most poeple agree are art anyways.

      Here's why coding is an art: it can't (yet) be done well by a computer. That is, we don't know all the rules that go into making a good program, we haven't codified them. This is in contrast to most real engineering disciplines, where it is very easy to quantify a superior solution; the only trick is to find it.

      What makes something art is how it is made, not what it is ultimately used for. As long as some part of writing good code remains locked in the coder's head it is as much a deep and mysterious art as writing a symphony or creating a painting.

      --

      "If you look 'round the table and can't tell who the sucker is, it's you." -- Quiz Show

    4. Re:language preference by layingMantis · · Score: 1

      I agree, virtually anything can be an art. You guys should see the elegant, clever, yet ever so functional layout of my Windows 98 desktop.
      I mean, icon placement is an underrated science - and the wallpaper? Sheer inspiration.

      -swerve D.

    5. Re:language preference by caranmir · · Score: 3, Insightful

      Oh, c'mon. You can code badly in any language.



      Given Damian's reputation, the fact that the Perl community is raising money to get him to focus on Perl, and the fact that he seems to know what he's doing, wouldn't you think that the fact he chooses to work with Perl says something potentially interesting about the language?



      When someone I respect praises (or consistently uses) a tool that I don't like, I try to question my opinion and find out what they know that I don't.

    6. Re:language preference by BinxBolling · · Score: 2, Insightful
      No coding is a craft or maybe engineering, not an art. An artists's objective is to produce something that has an aesthetic quality. An engineer's or craftsman's objective is to produce something that performs a function.

      Methinks you're confusing "art" with "fine art". Webster's entry for art doesn't mention aesthetics until the 4th definition, and even there, it doesn't make aesthetics a required component: "the conscious use of skill and creative imagination especially in the production of aesthetic objects". Note that it's 'especially', not 'only'. The skill and creative imagination appear to be much more central to the definition, and those things certainly play a role in programming.

      Even if you insist on including aesthetics in your definition of art, there's a good case to be made that once a basic set of functionality is achieved in a piece of software, improvements in aesthetics can be more valuable than further increases in raw functionality: Consider two pieces of software that serve a similar purpose, one with boatloads of bells and whistles, and one with a smaller, simpler set of functionality. The former is inaccessible and hard to use -- sure, it can do lots of neat stuff, but it's so hard to figure out how to do most things that most users touch only a fraction of that functionality, and spend a lot of time frustrated with it. The latter has less raw functionality, but because it's simpler and more elegant ("elegance" clearly being an aesthetic quality), it's far more useful to most users in practice.

      Your bridge example is misleading: The function of a bridge is far simpler in nature than the function of any reasonably complex software, and thus it's relatively easy to consider utility and aesthetics as distinct attributes of a bridge. It's not so easy to consider them as distinct attributes of software.

    7. Re:language preference by Anonymous Coward · · Score: 0
      Oh, c'mon. You can code badly in any language

      Yeah, but you can code REALLY badly in Perl. Just about every language feature seems designed to promote bad code. And, since perl c0derz are the linux equivalent of VB kiddi3z, it's pretty much a done deal. Use a real language like, well, anything else, really.

    8. Re:language preference by SnapShot · · Score: 1

      Agreed, I got a Bachelor's of Arts (apparently I am skilled at many different forms of art ;). Most of my friends also have a BA of some kind (business, psychology, sociology [works as a waiter], english literature [works as a programmer]). One friend, however, is a painter and sculptor and got a Bachelor's of Fine Arts. There must be a distinction between Art and Fine Art; if you can't trust our intitutes of higher education get the terms right then who can you trust?

      Anyway, I'm going to continue to call some of what I code "art" but I ain't gonna put on airs and call it "fine art" and I ain't gonna call myself an artist.

      --
      Waltz, nymph, for quick jigs vex Bud.
    9. Re:language preference by sketerpot · · Score: 1

      If you think that crossover between coding and art demeans both, take a look at The International Obfuscated C Code Contest. There are some quite artistic pieces of code there, for example the one that looks like an ASCII ball and calculates pi.

    10. Re:language preference by sketerpot · · Score: 1
      Not all of perls features make for bad code. The $variable and @array things make sense and prevent confusion, for instance.

      Not everyone who codes in perl is a c0D1r; most aren't. Perl is what you make of it. In my experience it is good for small programs.

      If you want a language where everything is made for bad code, try INTERCAL or Malbolge.

    11. Re:language preference by FrostedChaos · · Score: 1

      Oh, come on... that's nothing compared to the brilliant aesthetic of the recycling bin.

      --
      "Any connection between your reality and mine is purely coincidental." -Slashdot
    12. Re:language preference by caranmir · · Score: 1

      When you've had a chance to maintain bad C++ code, let me know. We might be able to have a civil conversation then.

      Until then, well, go off and enjoy your superiority. I've got work to do and I'll use whatever tool lets me get the job done quickly, reliably, and well.

      If that's Perl, so be it. If it's something else, fine. Not every VB person is a script kiddie and I think you do yourself a disservice in presuming so.

      If your mind is so closed that you cannot allow other to respectfully disagree, well, nothing I say is going to make a flit of difference.

      G'bye.

  9. Units by tunah · · Score: 2, Funny
    I'm also contemplating a module called Data::Units, which will allow programmers to specify the units for values and variables... So, if you divide a distance by a time, you'd better store the result in a variable whose unit is velocity, otherwise you'll get a run-time exception. That can be a very useful and natural way of error-checking numerical computations.

    And if you divide a sibling variable by a knife variable, perl will have none of that mess, you'll have to garbage collect the mess yourself.

    --
    Free Java games for your phone: Tontie, Sokoban
    1. Re:Units by radja · · Score: 3, Funny

      send it to NASA before they send the next sat to Mars...

      //rdj

      --

      No one can understand the truth until he drinks of coffee's frothy goodness.
      --Sheikh Abd-Al-Kadir, 1587
    2. Re:Units by Darby · · Score: 1

      And if you divide a sibling variable by a knife variable, perl will have none of that mess, you'll have to garbage collect the mess yourself.

      Which is, of course, the point.
      I'd rather try to parse "sibling by knife divide error in random.pl at line 1456"
      Than a completely random error.

      Hot tip:
      Don't use modules until you understand them.

    3. Re:Units by scrytch · · Score: 2

      So, if you divide a distance by a time, you'd better store the result in a variable whose unit is velocity, otherwise you'll get a run-time exception

      How quaint. In Haskell or Ocaml, you'll get a compile time error. Perl and python might be great for string munging, and since so much sysadmin and web work is strings, they're great for that, but if you want the rigor of typing, you're using the wrong languages...

      --
      I've finally had it: until slashdot gets article moderation, I am not coming back.
  10. Design Patterns in Perl by nwetters · · Score: 5, Interesting

    Damian mentioned design patterns as one of the skills necessary to become a better programmer. As very little has been written about implementing design patterns in Perl, I've started a project to produce Perl implementations (and explanations) of the Gang of Four's patterns. Later, I hope that Perl-specific patterns may emerge, but for the moment I'm just trying to create interest in this important area for OO-Perl programmers.

    1. Re:Design Patterns in Perl by Sharkeys-Day · · Score: 1

      I hope you include some advice about when NOT to use those patterns. I've seen so many badly implemented patterns that I think their only real use is to publish academic papers.

      Take singletons for instance. It is an admittedly non-trivial task to get the memory management right in traditional non-garbage-collecting languages, and the only thing you gain for that complexity is not having to store your global data in a global namespace. But the singleton class has to be in a global namespace in order to be globally accessible, so maybe you don't gain anything at all.

      I really think that people advocating design patterns need to include the old-fashioned, simple patterns in their list, such as global variables, subclassing, etc. Less experienced programmers learning about design patterns get the impression that they should use these complex, advanced patterns for _every_ problem, instead of using simple solutions for simple problems.

    2. Re:Design Patterns in Perl by FortKnox · · Score: 2

      Design Patterns are usually OOP. Perl's OO is a kludge fest and should have never been added. Don't get me wrong, perl is a great language, but when it comes to OOP, I think python is a better choice.

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
  11. TMTOWTDI for the acronymically challenged by Anonymous Coward · · Score: 0

    Damian mentions "TMTOWTDI" several times but forgot to explode($acronym). What he's saying is that There's More Than One Way To Do It.

    1. Re:TMTOWTDI for the acronymically challenged by Anonymous Coward · · Score: 0

      If they are challenged, they can look it up! http://www.google.com/search?q=TMTOWTDI&btnG=Googl e+Search

  12. An lesson in why Perl is bad for teams.... by MosesJones · · Score: 4, Interesting


    I read the article with an ever increasing sense of disbelief. Perl is definately a lanaguage for the individual rather than for groups or projects. One person on their own okay, but in a project....

    Perl lets me to program in a style that suits me, rather than enforcing a style that some language designer thought would be best for me.

    Now that is a quick way to bugger a project, everyone with their "own" style.

    Perl is multi-paradigm: I can write code that's procedural, or object-oriented, or functional, or declarative; whatever solves my problem best. I can even mix styles when the optimal solution calls for that.

    Leaving asside discussions on whether Perl is "mutli-paradigm" or indeed any language can be. This is another case of great for me, sucks on a project. You would never want to take this approach on a large project, it increases maintainance costs and learning costs for new people.

    And then of course the piece de la Resistance... the most important skill is...

    programming itself

    Let me get this straight, its CODING ? Not Design, not Engineering, requirements, risk analysis or whatever but banging the code out.

    I know this will probably get moded as "Flamebait" or whatever, but the reality is this is exactly the sort of language and approach that holds back software development and keeps us in the Dark Ages. Languages like Ada demonstrated clear advantages and had lower development and maintainance costs than C, so all new languages have their syntax based on.... C. Scripting languages have a history of producing huge amounts of unreadable and unmaintainable code.

    Why can't we just grow up and realise that this is an Engineering discipline that deserves the same respect and approach as structural, mechanical or whatever engineering. If someone said "well I like using bamboo to build bridges, I'm going to build a 6 lane highway with it" we'd laugh. This guy is talking about the same sorts of things and promoting a language that has none of the advantages of bamboo for bridge building.

    At least with people and languages like this, I'll never be unemployed, as there will always be buggered systems to fix or replace.

    Newton stood on the shoulders of giants, we fail even to build on the work of pygmies.

    --
    An Eye for an Eye will make the whole world blind - Gandhi
    1. Re:An lesson in why Perl is bad for teams.... by TheM0cktor · · Score: 1

      this isn't a troll!

      MosesJones makes a damn good point (upto the last couple of paragraphs, theyre just flamebait). Perl is a scripting language - remember? Its great for knocking up odd bits of code to do simple (or even not-so-simple) tasks but anything greater than 100 lines rapidly becomes a headache to maintain. I don't even want to think about a team-based project writing in perl.

    2. Re:An lesson in why Perl is bad for teams.... by TheEnglishman · · Score: 1

      Just because a language (in this case Perl) allows the programmer to program which ever way they like, it doesn't mean that they should.

      Ideally any large project, or better still any program should be planned and specified before one single line of code gets written.

      Standards and specifications are exactly what forces programmers to code in a manner that can be understood by the rest of the team, and in many cases will make life easier for the said programmer.

      In theory it should end up in a better final product - if the initial specification phase is done properly, then most problems should have already been thought of - all you've got to worry about now is the customer changing the goal posts for the third time this week :-)

    3. Re:An lesson in why Perl is bad for teams.... by Anonymous Coward · · Score: 0
      Now that is a quick way to bugger a project, everyone with their "own" style.

      Yes, which is why any large project in Perl by a professional team of coders would use a style guide to ensure that people can read each other's code. In case you hadn't noticed, people's styles vary a lot in Java too unless they agree on a style guide.

    4. Re:An lesson in why Perl is bad for teams.... by J.+J.+Ramsey · · Score: 1
      And then of course the piece de la Resistance... the most important skill is...
      programming itself
      Let me get this straight, its CODING ? Not Design, not Engineering, requirements, risk analysis or whatever but banging the code out.

      You obviously misunderstood the article. After Conway says that programming itself is the most important skill, he goes on to say,

      Of course, to land a particular job it can be a huge advantage to have specific expertise inthe right area. But without a deep and solid grounding in basic software design and construction, all the .NET or data mining knowledge in the world isn't going to help you keep that job once you've landed it. [emphasis mine]
      He obviously includes design and a deep understanding of how software works as part of the discipline of programming. He is not talking about just "banging out code."
    5. Re:An lesson in why Perl is bad for teams.... by spencerogden · · Score: 1

      First off, 100 lines is rediculously small. I'll give some credence to the point that perl programs over 500 lines are hard to understand, if you are undisciplined. Also, python is scripted, should we discount that right of the bat as well? What is inherent in scripted languages that make them unsuitable for larger projects?

    6. Re:An lesson in why Perl is bad for teams.... by spencerogden · · Score: 1

      As per you comments on coding style. C would b unreadable if you took out line breaks and used bad variable names. Use a language which enforces format? You still variable name problems, and some people hate programs breaking because of bad indentation.

      Not to mention that all languages have features which yeild hard to understand code IF over used, i.e. templates+overloading in C++, automagical variables in perl, lambda notation in a functional language(Haskell), pointers in C, etc. I'd pick one from Java but I haven't programed in it enough to know, but I refuse to believe it is impossible to write obfuscated code in any language.

    7. Re:An lesson in why Perl is bad for teams.... by Anonymous Coward · · Score: 1, Insightful

      Totally agree - what planet are some of you folks on?

      Like any other language, you modularise when things start to get out of hand - too many of folks here have clearly never used perl in big projects and just assume we're all writing vast clones of bash scripts - that's just plain wrong. You also clearly define a house coding style at the outset of a project, and review regularly to ensure that style is enforced - perl can be as clean as you want it to be IMHO.

      At my last company we used the usual suspects of apache, mod_perl, emb_perl with an Oracle backend to drive a big UK financial web site. We made heavy use of HTML components and modules, would use CPAN for existing solutions to problems, or write our own re-usable, modular code just like anyone would do in any other language. There is NO inherent limitation in perl preventing folks from doing that.

      It was also interesting that we had the usual suspects complaining about site performance and how everything would be better with IIS/ASP or JSP - in virtually every case I was involved in we profiled the code and found it was caused by sub optimal database queries or database/network performance limitations, not perl itself.

      Us poor misguided fools using perl on big projects are fully aware of how much perl can really do - equally we're aware of its few but definite limitations - OO is currently not a strength - but perl 6 should overcome this, and there is an impressive number of talented programmers out there working to deliver it.

      Why not rejoice in the fact that we have such a wonderful variety of excellent programming languages - or would you all really prefer to be coding in C++?

    8. Re:An lesson in why Perl is bad for teams.... by spencerogden · · Score: 1

      One thing I never understood was the dislike of perl's OO. Sure it is a kludge, but it seems like a pretty good one. I mean I can import CGI and DBI and create objects and be happy what is so bad about that?

    9. Re:An lesson in why Perl is bad for teams.... by Anonymous Coward · · Score: 0

      Well, I wouldn't claim to be an OO guru, and I would agree with you that it's a brilliant kludge, but:

      Object creation in perl is very expensive compared to many other languages built with OO from the ground up. Method calling is also more expensive IIRC.

      Also, for simple objects that just encapsulate data - perl works fine - but when you start using inheritance things can get hairy unless you take care. This bit from the perldocs kind of sums it up:

      Perl classes do method inheritance only.
      Data inheritance is left up to the class itself.
      By and large, this is not a problem in Perl,
      because most classes model the attributes of
      their object using an anonymous hash, which
      serves as its own little namespace to be carved
      up by the various classes that might want to do
      something with the object.


      Attributes could be modelled with anonymous hashes, arrays, typeglobs... this is not a sensible way to handle stuff, as having choices when it come to object modelling causes far more problems than it solves IMHO - there again, as I stated at the top, a guru I ain't ;->.

      Have a look at Damian Conways OO Perl book for an in depth discussion - my head was spinning after that one - but I think that does reinforce the need for the rethink that will be perl 6.

      However back in the real world, as I said in the other posting, we had a heavyweight web site running without having to worry about perl OO limitations, and in my job previous to that (data processing for city financial institutions) perl was always our "secret weapon" of choice that got the job done with the minimum of fuss!

  13. or just maturity? by TheM0cktor · · Score: 4, Interesting

    > One thing I've noticed about Perl people is that > they are often very open-minded about using other > languages to solve a problem. I think its a result of hackishness: a common trait amongst perl programmers is to want to solve a problem in the fastest, simplest way possible and most are mature enough to admit their favourite language isn't always the right tool for the job.

    1. Re:or just maturity? by TheM0cktor · · Score: 1

      the author of the above post would like to apologise for his complete inability to format posts. You can pick up your e-apology card from www.myflyjusthadpuppies.com

  14. Not a troll by pubjames · · Score: 1, Troll

    Why has this been modded as a troll? What he's saying makes absolute sense.

    The fact of the matter is that anyone who is involved in professional web site development will know that Perl is becoming less and less important as a scripting language, I believe precisely because of its design and philosophy.

    Unfortuately, "Perl gurus" like to write programs which are as short and "clever" as possible. That type of programming is not compatible with large, professional software development projects.

    Of course this opinion will probably be modded as a troll as well by those very same "perl gurus".

    1. Re:Not a troll by krs-one · · Score: 1

      I must protest. I don't think that Perl is losing any popularity as a scripting language. Maybe for a CGI language, but that was not its original intention either. Back in 1998, a study was done and it showed 1,000,000+ people used Perl on a daily basis or had P+++$ in their Geekcode (ok, I made that last part up). Thats a lot of people. It's undoubtedly gone up by now, especially with the release of Perl 6 around the corner.

      Also, what do you mean they like to write short and clever programs? Doesn't everyone? Cut down on the lines of code, up the efficiency, its every programmers dream. Many large professional programs have been written in Perl. If you've ever read the Oreily DBI Perl book, the first few pages have several Perl programmers talking about how Perl and the DBI have worked with databases for companies like AT&T.

      Perl can very much be used for large projects.

      And thus, I leave you with:
      "A well written Perl program will run faster than a horribly written C program." (I think Christiansen said that one, but I'm not sure :))

      -Vic

    2. Re:Not a troll by pubjames · · Score: 1, Offtopic

      Also, what do you mean they like to write short and clever programs? Doesn't everyone?

      On a personal level, anyone who enjoys computer programming enjoys 'short and clever' programs.

      On a personal level I appreciate that this is short and clever:

      @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
      @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*= 2) +=$f=!fork;map{$P=$P[$f^ord
      ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&&
      close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print

      However, I think you will understand that no serious professional programmer would use this type of programming in a professional context.

      Of course, the above example is extreme, but it has to be said that many "perl gurus" enjoy this type of cleverness and cannot stop themselves even in situations where it is inappropriate.

      Most professional programmers understand that "short and clever" is very often bad in a large software project. Read, for instance, Code complete by McConnel.

    3. Re:Not a troll by Alpha600 · · Score: 1

      On a personal level I appreciate that this is short and clever:
      @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{ @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*=2) +=$f=!fork;map{$P=$P[$f^ord ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&& close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print



      Why do people love perl? Maybe I'm a fool but I can't unterstand it. I've uses many languages and IMHO the way C does it (syntax) is still one of the easiest (if you mean programming - not Vbasic things ;). Perl is very hard to read and I don't think it's the same with writing code in perl.
      IMHO php is the best programming language, if you follow some rules.

      b4n

      --
      why are newer posts modded up, while older with same content are classified as redundant?
    4. Re:Not a troll by PoiBoy · · Score: 1
      #!/usr/bin/perl -w


      @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
      @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*= 2) +=$f=!fork;map{$P=$P[$f^ord
      ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&&
      close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];sleep rand(2)if/\S/;print


      [bpoi@beast]$ ./shit.pl
      Reversed /= operator at ./shit.pl line 5.
      syntax error at ./shit.pl line 6, near "&&}"
      Execution of ./shit.pl aborted due to compilation errors.


      Nice try, but it doesn't work.

      --
      Sig (appended to the end of comments you post, 120 chars)
    5. Re:Not a troll by pubjames · · Score: 2

      Execution of ./shit.pl aborted due to compilation errors.

      Nice try, but it doesn't work.


      But isn't it obvious why it doesn't work? No?

      Know you know what it feels like trying to edit a "Perl Guru's" code.

    6. Re:Not a troll by Anonymous Coward · · Score: 0

      The mess above is known as japh.pl. Here's an explanation of it.

    7. Re:Not a troll by Anonymous Coward · · Score: 0


      By the way.. his version screwed up the angle brackets.. here's a working version of it.

      @P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";sub p{
      @p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*= 2) +=$f=!fork;map{$P=$P[$f|ord
      ($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;map{$p{$_}=~/^[ P.]/&&
      close$_}%p;wait until$?;map{/^r/&&<$_>}%p;$_=$d[$q];sleep rand(2)if/\S/;print

    8. Re:Not a troll by archen · · Score: 2, Insightful

      "if you follow some rules. "

      Well if you follow some rules it shouldn't matter what language you use :) Really though, difficulty reading a language is usually due to

      1) lack of commenting (duh!)

      2) being unfamiliar with a language

      3) lack of organization (formatting code blocks)

      Perl programmers tend to be bad on the third point, but it's not the fault of the language. Personally I find it easier to read a program where my variables are easily marked with a $ in front, but that's probably a sign I've done Perl to long.

    9. Re:Not a troll by Anonymous Coward · · Score: 0

      Well, I know I'm impressed.



      Modification of a read-only value attempted at pipey.pl line 2.
      Modification of a read-only value attempted at pipey.pl line 2.
      Modification of a read-only value attempted at pipey.pl line 2.
      Modification of a read-only value attempted at pipey.pl line 2.
      Modification of a read-only value attempted at pipey.pl line 2.
    10. Re:Not a troll by kin_korn_karn · · Score: 1


      Know you know what it feels like trying to edit a "Perl Guru's" code.

      You have three options:

      1) Learn Perl better
      2) Write the same thing in another language that you like better
      3) Do not program

      All of the above include implicitly the requirement to quit bitching that you can't understand it. You think that'll get you anywhere with intelligent people?

    11. Re:Not a troll by spencerogden · · Score: 1

      I think it is pretty obvious from the context that this is VERY obfuscated perl which no one should be able to understand without intense study and usually reformatting. Check out the obfuscated C contest to see how you can do the same thing in C, or in any language. As for PHP, I am just starting to use it, but it seems like a toy to me, I'd rather use embedded perl.

    12. Re:Not a troll by scrutty · · Score: 4, Interesting
      But isn't it obvious why it doesn't work? No?


      yes - obvious as soon as I tried running it - lets see



      perl -e '@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";
      sub p{@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*= 2) +=$f=!fork;
      map{$P=$P[$f^ord($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;
      map{$p{$_}=~/^[ P.]/&& close$_}%p;wait until$?;map{/^r/&&}%p;$_=$d[$q];
      sleep rand(2)if/\S/;print '

      syntax error at -e line 4, near "&&}"

      Line 4 , near "&&}" ,eh? - well "&&}" looks plain wrong anyway - grepping the code for this clause points me to the map{/^r/&&} fragment . Now && is the C-style "short-circuit" logical "and" operator - so there should be a right hand side there - lets try just losing the && altogether




      perl -e '@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";
      sub p{@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*= 2) +=$f=!fork;
      map{$P=$P[$f^ord($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;
      map{$p{$_}=~/^[ P.]/&& close$_}%p;wait until$?;map{/^r/}%p;$_=$d[$q];
      sleep rand(2)if/\S/;print '



      tl hnU ei hPkaecJua/ sterrnoxr

      Ok - I get it its a JAPH - and this guy has obviously cut and pasted
      it from somewhere and something has munged his code - presumably the
      slashdot form - hmmm -if he's posting HTML and there was to be a line
      input operator pair there &lt &gt then they wouldn't display
      properly in the browser. Wonder what the filehandle name could be - well
      the only thing in scope inside that map { } block is the implicit $_
      coming from the %p elements on the RHS of the map statement - lets try
      that


      perl -e '@P=split//,".URRUU\c8R";@d=split//,"\nrekcah xinU / lreP rehtona tsuJ";
      sub p{@p{"r$p","u$p"}=(P,P);pipe"r$p","u$p";++$p;($q*= 2) +=$f=!fork;
      map{$P=$P[$f^ord($p{$_})&6];$p{$_}=/ ^$P/ix?$P:close$_}keys%p}p;p;p;p;p;
      map{$p{$_}=~/^[ P.]/&& close$_}%p;wait until$?;map{/^r/&& &lt$_&gt}%p;$_=$d[$q];
      sleep rand(2)if/\S/;print '


      Just another Perl / Unix hacker

      Each letter appearing after a certain delay - hey , thats quite cute !
      This took me lest than a minute to run debug and fix - without even
      analysing the core algorithm there - just responding to the helpful
      diagnostic messages emitted by the perl interpreter and fixing the
      obvious syntax error ( with a little lateral guesswork ). Bear in mind
      that (i)I am no perl guru , by any means and (ii) this
      is a JAPH - its supposed to be a cute obfuscated bit of code
      for people to have fun decoding and figuring out. So no, I don't
      accept your point at all - would you judge the quality of the C
      programming language based on the entries from the annual Obfuscated C
      contest. No ? I'd also wager it would take you (or me) a damn sight
      longer than two minutes to debug one of those beauties based
      on someone elses poor transcription.

      --
      -- Oh Well
    13. Re:Not a troll by MidnightLog · · Score: 1

      I just have to comment on this.

      On a personal level, anyone who enjoys computer programming enjoys 'short and clever' programs.
      I disagree. I program for a living and for fun, but I think "clever and understandable" beats "short and clever" every time. Plus, "short and understandable" beats "short and clever" fairly often.
      On a personal level I appreciate that this is short and clever:

      @P=split//...
      obfuscated garbage
      ...print
      Yikes! I know some people think obfuscated code is clever. I'm not one of them. If that's clever then Earnest was right - cleverness is overrated.
      --

      To understand what's right and wrong, the lawyers work in shifts ...

    14. Re:Not a troll by Art_XIV · · Score: 3, Informative

      Well if you follow some rules it shouldn't matter what language you use :) Really though, difficulty reading a language is usually due to

      1) lack of commenting (duh!)

      2) being unfamiliar with a language

      3) lack of organization (formatting code blocks)



      I'd add a 4th, though it's related to the first:

      4) Meaningless variable names.



      I rue the times that I've maintained other people's code that was load with code like this:

      temp = foo;

      if (temp > = g) {

      for (int x = 1; x > rst.length; x++ )
      {

      if (rst[x] &lt noid) temp -= .05;

      }

      }

      What the????? What is temp? Clearly not the temperature, since this is a financial application. Is it really that freakin' much harder to write something like:



      newInterestRate = STANDARD_RATE;

      if (interestRate > = cutoffRate) {

      for (int x = 1; x < possibleRates.length; x++ )

      {

      if (possibleRates[x] < THRESHHOLD) newInterestRate -= .05;

      }

      }

      BTW, sorry for using pseudo-java as a ferinstance.

      --
      The only thing that we learn from history is that nobody learns anything from history.
    15. Re:Not a troll by Anonymous Coward · · Score: 0

      Yes, it will, that's the whole point in a commercial situation... someone writes crap that nobody can understand, then you bitch about having to deal with all that crap (and spread put-downs around the office with coworkers) until someone gives you either get more money or more time in which to fix it. Or worst case you have to work overtime and they end up paying for it anyway.

      Because 1) companies never want to pay for training, 2) they don't have the time or money to do the whole thing from scratch and 3) they don't want to lose whatever training they've already given and you're not gonna quit.

    16. Re:Not a troll by kin_korn_karn · · Score: 1

      all of which is.. reality. deal with it. it sucks so take what you can from them and be happy in your spare time.

  15. If only more would see . . . by LRNG_LNX · · Score: 1

    After all, I'm not hiring them to replace my domain expertise; I'm hiring them to get a job done -- a programming job. So I'm going to hire someone I can explain my problems to quickly (that's where the "minimal understanding" comes in handy), and then unleash them to develop a solution that's correct, efficient, robust, maintainable, under-budget, and on-time.

    That's a great piece of insight that a lot of managers/employers/HR people need to keep in their hip pocket. It seems too many can be dazzled by the knowledge, but miss the lack of ability to perform their intended task quickly and efficiently!

    --
    If you don't like this . . . MOD someone else up.
  16. scary code? hope you're not open sourcing by mattr · · Score: 3, Insightful

    You can be artistic or even create artworks with anything.. although I once found visual basic to be a big impediment.

    If you have ever heard of an elegant mathematical proof or an elegant bit of code, this is something like what "artistic" is. It also could mean efficient, clear, etc.

    I think you need to differentiate between
    - traditional artworks like maybe oil paintings
    - artworks which use digital media in some way
    - making a statement with/through art
    - craftsmanship
    - intellectual and visual elegance i.e. of design

    Hypercard? Yes, blech. But I hope you think about elegance or craftsmanship at least if you are turning your code out to the public.

    We need more elegance in open source code because it tends to 1) make work fun/creative 2) make it run efficiently 3) reduces bugs 4) strong metaphor makes paradigm more powerful/extensible.

  17. direct link / karma whore by Mr.+Quick · · Score: 0, Redundant

    Here

    a web hosting company... hmmm, maybe it will handle the /. effect...

    1. Re:direct link / karma whore by Anonymous Coward · · Score: 0

      No problems there :)

  18. What a bunch of mindless crap by autopr0n · · Score: 3

    No coding is a craft or maybe engineering, not an art. An artist's objective is to produce something that has an aesthetic quality. An engineer's or craftsman's objective is to produce something that performs a function. "Aesthetically pleasing" is secondary. e.g. the function of a bridge is to get people or things across a river without them getting their feet wet

    Craftsmen are artists, a lot of the time. Certainly you wouldn't say things like for example a table to always consider function over form. You might prefer a table that has been designed to be useful over it's appearance, but others might not.

    Similarly, you might write code with esthetics a secondary concern, but others may not, witch would make their code art.

    Certainly, not all code is art. And certainly some is.

    --
    autopr0n is like, down and stuff.
    1. Re:What a bunch of mindless crap by Anonymous Coward · · Score: 0

      Certainly, not all code is art. And certainly some is.

      Please post the link to code -- not a running application -- that is art. NOTA BENE: the obfuscated C contest consists of clever puzzles, not art.

  19. parse::perl not that bad of an idea by autopr0n · · Score: 2

    "Parse::Perl. Just as the name says, its goal will be to provide a pure Perl parser that parses Perl itself."

    This could actually be useful for things like self-modifying code and the sort.

    Of course, writing anything in Perl in the first place is a bad idea, but beyond that, self parsing could actually be useful.

    now, if the had had a self-interpreter...

    --
    autopr0n is like, down and stuff.
    1. Re:parse::perl not that bad of an idea by Xner · · Score: 0

      now, if the had had a self-interpreter...

      I guess that would be eval() or not?

      --
      Pathman, Free (as in GPL) 3D Pac Man
    2. Re:parse::perl not that bad of an idea by JabberWokky · · Score: 2
      things like self-modifying code

      Isn't self modifying perl code listed in Revelations as one of the signs of the apcolypse?

      --
      Evan

      --
      "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
    3. Re:parse::perl not that bad of an idea by Anonymous Coward · · Score: 0
      You can already write self-modifying perl code with eval. Unfortunately, you're not dealing with a nice lispish parse-tree representation, but I think this still qualifies.

      Oh, and apocalypse? We've already had a few...

  20. Method redispatch by MeanGene · · Score: 1

    Good grief - why not simply write a Perl syntax parser for Common Lisp?

    This project would also require

    1) a mechanism to redefine class representations and instances on the fly - similar to

    (defmethod update-instance-for-redefined class ...)


    2) a mechanism to "save core" under Perl (does this one exist yet?)

    1. Re:Method redispatch by Caelum · · Score: 0
      1) a mechanism to redefine class representations and instances on the fly - similar to

      (defmethod update-instance-for-redefined class ...)

      You can easily add/redefine methods in a class. Since a class is a package, say Foo::Bar, with a method "someMethod", you can have some code that does this:

      no strict 'refs'; # we're gonna use symbolic refs here...
      *{Foo::Bar::someMethod} = sub {
      # do something else here instead....
      };

      Packages can also have a special "AUTOLOAD" method that gets called on method names that aren't define. This special method can then do something like create a new method on the fly, attach it to the package for faster use later and call it..

      People have used this to make things like a shell module, eg.:

      my $shell = new Shell("/bin/sh");
      $shell->ls("-1", "/somewhere");
      #...

      I think someone wrote a CLISP syntax for perl...I'm not sure what you mean by "save core", not very familiar with LISP :) If you mean saving the compiled byte code, I haven't seen anything unfortunately, besides the perl compiler efforts...

  21. Discipline in art is independant of the medium by Crag · · Score: 5, Insightful

    It's true that individualistic programing styles can slow down a project, and it's true that perl allows almost infinite programming style, or lack of same. However, the two issues are orthogonal, and Perl itself is not bad for cooperation. Just ask the CPAN developers.

    Next, 'programming' is not the same as 'coding'. Programming has come to mean all the terms the author of the above post used: Design, Engineering, Requirements, Documentation.

    The author of this post is half-right, but missing the big picture. There are folks who develop with maturity and discipline with Perl, and there are folks who write garbage in every language. The freedom to screw ourselves over is necessary for us to learn how not to screw ourselves over.

    So no, Perl isn't bad for teams, self-centered programers are bad for teams. I should know, I've been that programmer.

    (If I felt like invoking flame-mode, I'd suggest that perhaps the poster is coming from an academic or corporate background where individualism is bad for the hierarchy... :)

    1. Re:Discipline in art is independant of the medium by jallen02 · · Score: 2, Interesting

      You know, your entirely right. Your post echos a sentiment that is said and thought of quite often. The frustrating part is that the grandparent post reflects the majority of people's attitudes.

      People can write obfuscated C yet you don't see (as many) people running around crying murder, mayhem, and the end of the world at C. It is just annoying to see people trash a language like that, for any reason.

      I can write code that is completely unlike anyone else in my project in *ANY* language you can give me. It is the job of a good project manager to ensure that peer reviews are conducted in an orderly and sufficient manner. It is a good project managers job to come up with the programming standards for a project.

      With standards on the style of how a language should be used and a disciplined team, your code is coherent. With an team that has less discipline you will see things are a bit more chaotic.

      Notice, the language simply does not matter. Perl infact should be better in MORE projects if you can change the style and form of the code and the way you write it, simply because it suits more needs and projects that way.

      All of this said, I don't use Perl as a personal choice. I never buy the argument Perl is hard to read or write just because it is Perl, I just don't use it.

  22. Re:Perl is Dying by Anonymous Coward · · Score: 0

    You forgot to s/OpenBSD/Perl/g in the middle of your pathetic troll attempt.

    Anyway: MS is losing market share in the embedded space. Is wince dead? No, unfortunately. So the whole argument is pants.

  23. Perl Programmers, Change the World With AI! by Mentifex · · Score: 0, Offtopic

    Just as the -- what is it? Program Extraction & Report Language (P.E.R.L.?) -- language grew from one-time Seattleite Larry Wall's kludgey geek code into the major glue that holds the entire World Wide Web together, so also the Mentifex Call to AI has stormed the far reaches of the 'Net and now needs Perl programmers everywhere to take up the once-in-a-species-lifetime Herculean task of creating Open Source Artificial Intelligence.

    But Perl's just a scripting language... you may say dubiously and faith-lackingly. Fear ye not, for from the tiny acorn of Perl shall grow the mighty oak of Technological Singularity.

    The original 26nov1994 Amiga Mind.Rexx AI used an IBM scripting language (REXX), whose ardent promoters are still licking their wounds from having lost the Web battle to Perl.

    Although the AI Mind moved into old-fashioned Forth for robots, it quickly moved back into the scripting language of JavaScript, so Perl will hold its own against Visual Basic Mind.vb and against the object-oriented Mind.Java AI.

    Perl programmers, do not be a dim bulb about whom people will say:
    - "He is not the brightest crayon in the box."
    - "His brain-waves do not reach the shore."
    - "Er hat nicht alle Tassen im Schrank."
    - "If you gave him half a brain, he'd have half a brain."
    - "He's not playing with a full deck."
    - "He suffers from weapons-grade stupidity -- it's dangerous to go near him."

    Think different! Use your Perl skills to join in the last great intellectual Gotterdammerung of the human species.

  24. Design Patterns don't live in a language by Anonymous Coward · · Score: 1, Insightful

    My guess is that a design pattern
    is a recognizable form of software architecture
    that we see recur and thus it is cateloged.

    If you use a specific language to implement a
    design pattern what you have is a
    'module' or a 'class'.

    One uses a language to IMPLEMENT a design pattern. The pattern exists without the language.

    In the same way one can make a screw driver out of tin or out of hardened steel. One uses the steel if one doesn't want the screw driver to break.

    The analogy in software is using a steel OS like LINUX or UNIX verses using a toy tin OS like Windoze.

    The folks who use Windoze use it because they want to addict their users (victums) to upgrades because the Tin OS stuff always breaks.

    As far as PERL goes, whatever. It is cute but not the one and only show in town.

    If you are going to talk about design patterns you aren't a 'coder' but an archtitect or software carpenter.

    PERL is a cute language suited for WWW work. For other things it doesn't work so well.

    I like PERL, but it creates a huge footprint and you have to include the world to get a very large object that runs in an interpreter.

    NOT GOOD for a lot of things, pervect for others. Design patterns don't live in a specific language. One uses a language to implement and the pattern itself is something that lives in the programmer/architects mind.

    The code becomes a module or an object. It is never the design pattern itself.

    1. Re:Design Patterns don't live in a language by nwetters · · Score: 1

      blockquoth:

      If you use a specific language to implement a design pattern what you have is a 'module' or a 'class'. One uses a language to IMPLEMENT a design pattern. The pattern exists without the language.

      I sort of agree. The design patterns shown in the Gang of Four (GOF) book are about class hierarchies, not their implementation in any particular language. However, they have provided implementations of these patterns in Smalltalk and C++. Later books have converted these implementations to Java, COBOL, and several other languages. It's fair enough that Perl programmers get a look in!

      Again, although the patterns in GOF are fairly non-specific as to target language, later publications have emphasized language-dependent patterns. I'm sure that many of these patterns may prove to be directly transferable to mod_perl, but some will not. Likewise, I'm sure that some patterns will be found that are suitable for Perl but which are not transferable to Java.

    2. Re:Design Patterns don't live in a language by Cryptnotic · · Score: 1

      It's too bad Perl's OO support is so kludgy.

      --
      My other first post is car post.
    3. Re:Design Patterns don't live in a language by Anonymous Coward · · Score: 0

      come on. It's not *that* bad.

    4. Re:Design Patterns don't live in a language by nosferatu-man · · Score: 1

      Yes it is. It's horrible.

      (jfb)

      --
      To spur "enterprise Linux," Big Bang, the distributed two-phase commit.
  25. Ach du Lieber by jkujawa · · Score: 1, Troll

    * For me, Perl syntax hits the sweet spot between too much order (e.g. Pascal, Ada, Python) and too much chaos (e.g. Lisp, APL, Forth). It "fits my brain" better than any other language I've used.
    * Perl's TMTOWTDI philosophy extends past its syntax and into its semantics, and that allows me to craft the precise compromise I want between code size, maintainability, efficiency, and complexity.
    * Perl lets me to program in a style that suits me, rather than enforcing a style that some language designer thought would be best for me.
    * It's an "instant gratification" language. Because Perl provides acceptable execution speed with no separate compilation step, I often find myself developing right in my editor. In fact, I have a key permanently bound to ":!perl -w %" under vi for just that reason.
    * It can be quick-and-dirty when I feel the need for speed, but it can also be clean-and-careful when I need robustness. And it can be both in the same program, which lets me prototype new features quickly without compromising the integrity of the existing code.
    * Perl is multi-paradigm: I can write code that's procedural, or object-oriented, or functional, or declarative; whatever solves my problem best. I can even mix styles when the optimal solution calls for that.
    * Perl's built-in types (i.e. nestable arrays and hashes) cover the vast majority of my needs without requiring me to drag in libraries or jump through memory management hoops.


    None of these are good reasons to use Perl. None! These are all reasons that Perl is a maintenance nightmare, and not at all suitable for programs in excess of five hundred lines, or programs that will ever have to be modified.
    Even good Perl is some of the worst code I've ever seen.
    Just say no.
    1. Re:Ach du Lieber by dmeiz · · Score: 0

      But there are so many good programs that are less than 500 lines.

      -Dan

    2. Re:Ach du Lieber by Anonymous Coward · · Score: 0
      Correct, those aren't great reasons. But...


      In the real world the implementation of basic data structures are often the maintenance disaster. Using just a few of Perl's built in data structures allows Perl programs to be very simple, while getting on with complex tasks.


      Not just data structures, but powerfull operators as well:

      string operations, regular expressions, hashes, array slices, array push and pop, sorting.

    3. Re:Ach du Lieber by msouth · · Score: 2

      any not only that, but if you do in in Perl you have a much better chance of being done in less than 500. Many have been the pages of C code I've seen go by that could be replaced wtih a few lines of Perl.

      --
      Liberty uber alles.
  26. You haven't thought this velocity issue through by Anonymous Coward · · Score: 1, Interesting

    Utterly rediculous.

    You give one velocity. Actually a moving object under acceleration will have a changing velocity. Thus do we need to then worry about:

    1. sampling rate for this variable
    2. precision of the variable

    In programming there is always a different way toedo things. The folks who say "have to" produce kludges like Windoze or Digital UNIX where everything is a non-deterministic messaging stack.

    It works for small and trivial things but quickly becomes a mess.

    In the case of doing PERL to track velocities I feel that this is an exercise in futility. Here is why:

    There is no general case of utilizing velocities for solving a problem. The problem is always specific for whatever is needing to be solved. Imagine a situation where you are tracking all of the airplane traffic around a city. Do you think that a silly rule like "a distance and a time need to have a velocity variable" makes any sense at all?

    I can imagine N planes each with varied degrees of sampling position and time.

    In any case in order to determin velocity from position and time we need at least two samples of position and time. And then the velocity we get is not real anyway, but an approximation.

    And so we see your little therom is incorrect. There will always be FEWER velocity measurements than position and time samples.

    Thus do we then nessecitate an further variable that tells us the acuracy of the velocity prediction?

    So . . .

    those hard rules that you make need to be just put away.

    As someone who has done velocity measurements from time and position data I submit that your heart is in the right place thinking about this as a pattern. It is just that you shouldn't be thinking in terms of PERL, but in concept space.

    One thing further: for real-time velocity and position measuring of real-world systems with N components, PERL just ain't going to cut it, dude.

    Yes, PERL is good for somethings, but don't waste your time writing PERL modules that provide a bad solution for a non-exisitant problem.

    ;)

    1. Re:You haven't thought this velocity issue through by shag_and_scooby_too · · Score: 1

      It still would have is applications for scientific work. Just because you can't use it in your example application, does not make it useless. You just need to be more openminded in how you could apply a system like this. For scientific work, where you have equations and abstractions it would be great.

    2. Re:You haven't thought this velocity issue through by spencerogden · · Score: 1

      It sounds like you are trying to solve a much larger problem than the module is. I think the module is on the level of intro to physics, where you so a bunch of calculations, cancel out your units and get the units of your answer, as in velocity + accel.*time equlas another velocity. I don't see the problem here.

    3. Re:You haven't thought this velocity issue through by Anonymous Coward · · Score: 0

      The way I read that was that his velocity analogy was just that, an analogy. The idea of Data Units is more abstract and useful for runtime checking of variables.

      He said nothing about using this for real-time velocity measurements, nor did I get the impression that it was implied.

      Seems like you just jumped at the chance to take a lot of words to say:

      Velocity Measurements = (position and time samples) - 1;

      Bravo.

  27. what skills a Perl programmer needs by fetto · · Score: 1

    When doing advanced perl programming I figure being autistic (Rain man) would help figuring out the syntax.

  28. Perls Idiom NOT Perl Specific Pattern by Anonymous Coward · · Score: 3, Insightful

    "Perl Specific Patterns"

    I would call that a "Perl Idiom"

    It is not a pattern.

    Patterns are CONCEPTS not IMPLEMENTATIONS

  29. I really don't get it by Christianfreak · · Score: 5, Insightful

    I make my living as a perl programmer

    I do not understand why a majority of people on /. are so quick to flame Perl. If you don't like it don't use it but don't flame people who do. I love Perl. As far is being hard to read or understand well I think that's people who have never tried. When I started coding Perl I was a complete newbie. I'd done a little C and a bit of Basic and I wanted to learn how to right CGI scripts. Someone showed me Perl and inside a week I was writting (badly but still writting) a message board. It took me weeks, it was horrid but it worked. I know very few people who can do that in any other language. In fact it was Perl that got me to move away from the darkside of Windows (this was before ActiveState made Perl on Windows a more manageable beast).

    Try it before you knock it. Give it a chance. If you don't like it then use the tool you like but don't keep spreading flames and lies about it. Saying its only good for 500 line programs or that its always unmaintainable or it can't be used by teams simply isn't true. And ANY language can have all of those attributes.

    Perl also has a great community that I've not seen in other languages. Don't know how to do something, ask Perlmonks. Those guys are even one of the few places where newbies can come. Very rarely do I even see someone screaming RTFM at them. Most of the time you just get your question answered and answered fast. There are other places that aren't so kind.

    Perl is great. Long live Perl

    1. Re:I really don't get it by Andy · · Score: 0

      Perl is a useful language for managing text. As such it is an improvement on languages such as awk. But extending its use to OO development, patterns and such is absurd. There are many other languages far more suited to the task. The fact is Perl programming is for bottom-rung, quick and dirty scripting. Making it do much more is a waste of time.

    2. Re:I really don't get it by Anonymous Coward · · Score: 0

      > I love Perl. As far is being hard to read or
      > understand well I think that's people who have
      > never tried. When I started coding Perl I was a
      > complete newbie. I'd done a little C and a bit
      > of Basic and I wanted to learn how to right CGI
      > scripts.

      Just to let you know, I stopped reading your
      comment at this point...

    3. Re:I really don't get it by Anonymous Coward · · Score: 0

      Translation:

      I hear Perl stands for "practical extraction and reporting language" and that it's good for string manipulation. I think that makes it an extension of awk, but since I haven't used awk I can't say for sure. By virtue of it's name, I conclude that it isn't a suitable language for much else besides string munging. Oh, and Perl programmers are filthy, grubby, garbage programmers and their work is substandard. By the way, I don't know perl but I once saw some and it looked WAY too confusing for my superior mind. Therefore, nobody should use it unless they have to do a quick duct tape job on some code written in Java or another proper language. Also, I suck cock.

    4. Re:I really don't get it by Blind+Lemon · · Score: 1
      When I started coding Perl I was a complete newbie. I'd done a little C and a bit of Basic and I wanted to learn how to right CGI scripts.

      Perhaps part of the reason why you don't agree with other people's assessment of Perl is that you aren't very experienced in the alternatives.

      I think Perl is a fine replacement for /bin/sh scripts. But, I have seen people write applications in Perl, and it wasn't pretty.

    5. Re:I really don't get it by kaisyain · · Score: 2

      And ANY language can have all of those attributes.

      Of course any program in any language can have those attributes. But are you seriously arguing that all programming languages are equally maintainable or equally usable by teams? Are False or Intercal really just as easy to maintain as Perl or Python? Is csh just as easy to write a 500,000 line program in as C++?

      Obviously anyone saying that you can't write a maintainable or large program in perl is overstating the case. What more reasonable people are saying is that perl makes it easy to hang yourself, probably too easy. We can all sit around and say only other programmers make mistakes and thus we don't need a bondage and discipline language but when you look at the state of the average code base that argument is hard to take seriously.

    6. Re:I really don't get it by Phillip2 · · Score: 2

      "If you don't like it don't use it but don't flame people who do."

      I think that you are making a big assumption here. I suspect that a lot of people who dislike perl are those who have to use it. I'm writing in perl at the moment because I need some libraries written in it. It would take too long to recode these in a language that I like, so I am using perl.

      "Try it before you knock it. "

      Same assumption here I think. Many who knock perl have already tried it.

      I'm not particularly religous about perl. I would just rather avoid when I can. Every computing langauge is of course a compromise, but for me many of the compromises that perl makes are in the wrong place. In particular I would say the syntax is horrible, or at least very complex. The "more than one way" philosphopy I find annoying. My experience is that perl code from different authors tends to be highly idiomatic. Its object orientation appears to me to be rather poor. You can't for instance define a interface contract (I'm sorry but "read the documentation" just doesn't cut the mustard for me). And finally its poorly typed. So its not openly declared what types a method or function takes, nor what types they return. At least not without reading either the documentation (if that exists, and its correct), or the implementation (which is not reliable if you are trying to address a common interface.

      Now of course perl has its strengths. Its text processing is powerful (I've done a lot of text processing in Java for instance. Bad trip). It can be very quick to write (although I find this becomes less true as code gets more complex). CPAN is a fantastic resource (and a curse! Its why I writing perl at the moment).

      Personally I wouldn't get attached too much to any language. You can write long programs in it, you can maintain it, and you can use it in teams. But to my mind this is indeed where perl is weak.

      You will note that this is not a flame...

      Phil

    7. Re:I really don't get it by FortKnox · · Score: 1

      To add onto your point, he did state that he learned perl in a couple weeks without much programming background. Most of slashdot has a heavy programming background, therefore we've all dabled in perl here and there (I used it during my college co-op).

      So, yes, you're correct. He is making some big assumptions. My only beef with perl is the kludgy OO components (I'm a big OOP fan).

      --
      Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
    8. Re:I really don't get it by Mtgman · · Score: 3, Funny

      Someone showed me Perl and inside a week I was writting (badly but still writting) a message board. It took me weeks, it was horrid but it worked

      CmdrTaco? Is that you?

      Steven

      --
      -- I have marked myself unwilling to moderate-- I don't have other accounts to artificially inflate the karma of
    9. Re:I really don't get it by Phillip2 · · Score: 2

      "he did state that he learned perl in a couple weeks without much programming background. "

      Well I'm a self taught programmer as well, even though I work in a CS dept!

      Its one of the reasons that I don't like Perl. I haven't grown up being to remember all the obscure syntatic elements, and whether I am using an array, or a scalar reference to an array, or whatever. I like the compiler to know this stuff, and check that I have it right!

      Call me a wimp if you like!

      Phil

  30. HEIDI WALL by Anonymous Coward · · Score: 0

    who cares about damian conway, check out Heidi Wall

    1. Re:HEIDI WALL by Anonymous Coward · · Score: 0

      dude, she looks kinda skanky.

    2. Re:HEIDI WALL by Anonymous Coward · · Score: 0

      By the time I got to her, her asshole was too loose to be worth much of anything, and I wasn't going anywhere NEAR her pussy after the dogs had been there. "But isn't her asshole near her pussy?" On any normal human female, the answer would be "yes," but the Wall family has a genetic disorder which results in oddly placed anatomy.

  31. rubbish by Anonymous Coward · · Score: 0

    Here's why coding is an art: it can't (yet) be done well by a computer.


    Why would that be a criterion for art? A computer cannot invent delicious receipes; a computer cannot discover interesting physics or mathematics; a computer cannot summon sophisticated legal arguments; if you put your mind to it, you will quickly realize how little can be done well by a computer and how many of those things it cannot do are not art.

  32. this is why geeks are so boring by Anonymous Coward · · Score: 0

    ... virtually anything can be art. You guys should see the elegant, clever, yet ever so functional layout of my Windows 98 desktop.

    No, virtually every geek is overcome with the artifacts and evidence of their mere existence and calls them art out of their profound ignorance. I realize "art" is a convenient word, but it doesnt actually mean "everything".

  33. I disagree. by Anonymous Coward · · Score: 3, Insightful

    I work for a Major Automotive Manufacturer's ITM department, and Perl has saved our lives.

    We have a large number of very large and complicated projects done in Perl, plus literally thousands of minor, single-use programs. There have been no maintainence issues to speak of.

    Perl, like any other language, can be written in such a way as to only be comprehensible by the authour. But if you optimise the code for *LEGIBILITY* - ie, no use of "$_" or the "implied $_" then Perl has spectacular legibility. Much better than C, C++, or (especially) Java.

    In fact, the projects that meet or beat deadlines are usually written in Perl. Those that miss deadlines, drag on for ages, and prove impossible to maintain once complete are written in Java.

    That's the real beauty of Perl, from a large-project-maintainence point of view. Perl's "there's more than one way to do it" idiom means you can write code such that it is much easier to maintain than a "bondage and discipline" language that only has One True Way to code in. Java's syntax is optimised for the language designer's preferences and tastes, where Perl allows you to optimise for the needs of the project.

    Y'know, the anti-Perl sentiment that runs through a sub-population of Slashdot reminds me very much of Medival England, back when French was the language of the Royal Court. French was considered the language of nobility, and English was the language of commoners. English was gauche, ugly, and messy.

    But (and I'm a fluent French speaker, so I know whereof I speak here) English is a far more flexible and adaptable language than French is. You can write some really horrible, incomprehensible stuff in English, if you want to. But you can also write Shakespere. French - even the French of Voltaire and Hugo - is still pretty much French.

    In the Darwinism of languages, French (once the lingua franca of the world - note the irony in the term?) has been relegated to second-fiddle status and is on the decline, where English is now the closest thing to a global language we've got, and is on the incline.

    So too is Perl.

    1. Re:I disagree. by EvlG · · Score: 2

      I agree with you 100%.

      People seem to think that if they use Perl, they can ignore solid software engineering principles like code reviews, documentation, etc.

      Poorly written code with too much use of $_ shouldn't pass a code review -- it should be rewritten to follow the organization's standards.

      Perl is a fantastic tool, but it's not a panacea. You still have to back it up with a strong foundtion of software engineering.

    2. Re:I disagree. by spencerogden · · Score: 1

      This is a good point. I think the flexibility of perl gives the coder the ability to write code that reads like english, very easy to understand.

      Of course it also give the prgrammer the ability to write in klingon, which can be harder to understand for some people. :)

    3. Re:I disagree. by renoX · · Score: 2

      I don't see your points.

      > I work for a Major Automotive Manufacturer's ITM department, and Perl has saved our lives.

      Yes, Perl is a usefull tool, but it isn't the only one..
      Why couldn't have you used Python instead?

      Being more readable than C/C++ is not an impresive feat!

      I hate Java myself: too much bugs in the standard library, the design of Swing is nice but its implementation is buggy and slow.

      > s. You can write some really horrible, incomprehensible stuff in English, if you want to. But you can also write Shakespere. French - even the French of Voltaire and Hugo - is still pretty much French.

      Mmm, the French slang (l'argot) can be quite hard to understand too and I'm French!

      But frankly the fact that now English rules and that French is less and less spoken has NOTHING to do about which language is the more flexible!

      It is a consequence of the economic domination of the USA..
      If in the future China rule the world (economicaly speaking) then people would more and more use Chinese..

    4. Re:I disagree. by Anonymous Coward · · Score: 0
      Perl, like any other language, can be written in such a way as to only be comprehensible by the authour. But if you optimise the code for *LEGIBILITY* - ie, no use of "$_" or the "implied $_" then Perl has spectacular legibility. Much better than C, C++, or (especially) Java.

      [...]

      Y'know, the anti-Perl sentiment that runs through a sub-population of Slashdot reminds me very much of Medival England, back when French was the language of the Royal Court. French was considered the language of nobility, and English was the language of commoners. English was gauche, ugly, and messy.

      No. It all boils to the fact that Perl is very badly designed. It is useful only for CPAN. And before you start to yell "NO BUT", I must tell you that I know to Tcl/Tk, Python, Ruby, Pike, Lua, Smalltalk (Eiffel/Sather, Common Lisp, Scheme, ML, Dylan,....), and except for Tcl/Tk (too simplistic), the design of Perl is by far the worse. It can still be perfectly used, it's not a problem, but Perl is crap.

      I'm extremely tired of the old apologies "you just have to had good comments", "there is no bad programming language only bad coders", etc... The awful truth, is that there are languages better designed than others... Perl is simply the worse.

  34. You don't have to be limited: CPAN by pdqlamb · · Score: 3, Interesting

    You don't have to be limited to what your compiler vendor supplies, or the extra libraries you (or your company) can afford. CPAN provides an enormous repository of useful (and usually well-written and well-tested) tools that no other language approaches.

    But of course, you need to use perl.

    Netlib may be the closest thing I know of for numerical analysis. While CPAN doesn't have the depth of numerical analysis the netlib does, it has much more breadth. I can usually find something that makes a new project much more quickly than I can code it up myself. CPAN is one of the big reasons I use perl

    Keep you credit card in your wallet, leave the purchase requisitions in the file folder; keep your money and your sanity. Just check out CPAN!

  35. Because Perl can be tough for teams by jabbo · · Score: 3, Insightful

    I write Perl too. I write Perl professionally and I do a professional job of it -- my code is organized into object-oriented modules that could pass for Java if it wasn't for the pointies and easier string manipulation. The documentation is Javadoc-style POD and it's kept up to date. Same thing goes for my PHP code, my C code, etc... I don't write Java code professionally anymore but that's where I picked up some of my documentation and OO habits, since I learned C++ as a scientific (computational) language. Anyways, discipline will see you through if you want it to. It's always more productive to just design and write the damn code than to hold meetings over which language to do it in.

    However, Perl is really a language that I find more suited to "glue" than use on a continuing basis by teams of programmers. The vast majority of Perl (and a LOT of C++ for that matter) code I have seen used by teams was phased out MUCH faster than the equivalent PHP+C, Java, or Python code. Now with Inline.pm perhaps the horrible problems of using XS or Swig for wrapping "real" code are gone, but the fact remains, without a LOT of discipline and some bitter years of experience, Perl offers more chances for a programmer to take shortcuts. Again, great for quick glue jobs, but bad for long-lived projects. For what it's worth, the C++ code that got shitcanned was big on templates, gratuitous operator overloading, and all the other Perl-like shit that I hate in C++... if there's one good thing I can say about Java it's that it isn't C++.

    But I *hate* the current Java platform with a seething passion. I don't really like C, and I can't hire a bunch of Common Lisp or Python programmers off the street. Ada? Probably, but who wants to deal with DoD curmudgeons? So every approach that I can see is a compromise in some respect or another. All the "good" ways to write code have their problems. Perl's problem is that it offers lazy programmers (oops, that was redundant) many, many ways to churn out spaghetti that "works"... for a while.

    As un-fond as I am of fuddy-duddy computer scientists, their focus on formal correctness, proofs, and mathematical solutions to problems is really where it's at when you are solving a problem that hasn't been attacked before. If you're just re-inventing the wheel, Perl (or any other language) is fine, but if you need to parallelize development of some fast, bug-free innards code, it isn't what you want to release in.

    I use Perl on a daily basis for configuration, scripts, etc. because it's the best tool for those jobs. Right now I am the only programmer on my team. When that changes again, I'm going to have to go back to a more easily maintained solution, which looks like it'll be PHP+C for most of my tasks. (did I mention that I hate Java with a seething passion? Too much work for too little payoff) This isn't too tough since PHP and Perl have equivalent means of using extension classes, etc. and PHP is actually easier than Perl to integrate directly with C (across-the-board, not just using Inline.pm, which I admit rules). Work with a large team doing development with some custom extension code, etc. and I'll bet dollars to donuts that you, too, will one day shrug your shoulders and admit that Perl is not right for all types of work. It's also a bit baroque and the syntax can be frustrating for people who aren't from a Unix background. I started out sharing your perspective years ago because Perl is SO very wonderful when you're working all by yourself. But it isn't so great when you're with a team. Especially if you are working on code that is inter-dependent with other programmers, it's important to be using the same or similar approaches to solving problems, and this is anathema to the TMTOWTDI credo at the heart of Perl. I'm not going to hedge on this claim -- I, too, make a LOT of money writing Perl and other code, I've done so for years, I appreciate the CPAN and Perl community, and I try to give back -- but I refuse to be a simp and just crow about how great Perl is for EVERY situation, when I have seen so much evidence to the contrary.

    (It is still the greatest string manipulation and glue language known to mankind, though. And many of the one-offs I wrote in Perl have made my company tens of thousands of dollars. So the fundamental truth, "Use the right tool for the job" still holds!)

    --
    Remember that what's inside of you doesn't matter because nobody can see it.
    1. Re:Because Perl can be tough for teams by EvlG · · Score: 5, Funny

      The problem I see with Perl is a management problem. Everyone complains that Perl produces bad code, but in reality, programmers produce bad code. By our very nature as human beings, we all think differently.

      I agree Perl provides a lot of freedom to solve problems in the way most suitable to you. However, to use Perl successfully, you still need to set standards for acceptable algorithms, approaches, and documentation. This is exactly what you would do in Java, and exactly what you would do in C++ (i.e., by saying no templates/operator overloading).

      I'd argue that such standards are necessary for any significant development effort - its just the nature of the beast, when trying to get multiple people to work together to tackle a problem.

      So how do you use Perl effectively in a structured environment with teams of programmers working together? Here's a few ideas:

      1) Code reviews. All code written for a team msut be reviewed by the team. This is absolutely essential to keeping the system functioning. If the team rejects it, the code must be fixed.

      2) Documentation. Perl provides POD, a simple and standardized way to document the code you write. Enforce a standard that code without *meaningful* POD is not acceptable.

      Note that documentation also means you need to document more than the code - you need to document the design decisions, the requirements the code tries to satisfy, and the assumptions made for the system as a whole. Without proper system/process documentation, a development project will fail.

      3) Create standards for acceptable approaches to solve the problem. For example, Perl provides eval for exception handling - you could mandate that all external error handling code make use of eval to keep error detection orthogonal to error handling. You could (and should) require team members encapsulate code in modules, and provide documented interfaces to those modules. Code not encapsulated in a module will not be accepted into the tree.

      There are only a few examples to illustrate ways to make development in Perl successful for your organization. These are the same problems you tackle in developing a sizeable project in any language with a team of programmers - Perl is no different, and is not a panacea for those problems. However, if standard management and structured development techniques are applied, developing in Perl can (and will) work for large organizations.

      Perl is no different from any other technology in this regard. that for a large project, it is essential to set standards

    2. Re:Because Perl can be tough for teams by msouth · · Score: 2
      Perl is no different from any other technology in this regard. that for a large project, it is essential to set standards

      Yes on 2, no on 1. What you said earlier:

      Perl provides a lot of freedom to solve problems in the way most suitable to you.

      is true, and it it more true about Perl than it is about many other languages. I have often asked myself, "Why do I love Perl so much? Why is it that every time I come back to this language it's like falling in love again?". And a big part of the answer is that it is so expressive (Larry designed it this way, being a lover of spoken language). I don't feel forced into coding things in a particular way. Also, as I grow in my understanding of the language I find that I can express myself more efficiently and concisely.

      I really love Perl. But as an honest observer I have to admit that there are consequences to this freedom, which, again, I think undeniably exceeds that of other languages. If you need to iterate over every line of an array, for example, how are you going to do it? In many languages there is only one way that the average person would think of coding it.

      In Perl, you might do a for (or foreach), with a named dummy variable (or you could take advantage of the fact that $_ is automatically assigned), followed by a brace-delimited block. Or, maybe you will be able to do the guts of the block in one line and you can just tack the "for" on the end as a statement modifier. Maybe you think "map" is the way to go. Maybe you're trying to learn about map and want to see if it works in this situation.

      I love Perl precisely because it allows all of this--freedom, in my opinion, is a wonderful thing. But the existence of freedom and the extent of that freedom guarantee that there is going to be more variability in the way things are coded.

      I'm not saying that you can't use it in groups or anything like that, but I think it is incorrect to say that it is no different from any other language in that respect. When people are free, they are going to wander further from each other than they would if they were not free to. I still think freedom is good. And I think that we should be responsible with our freedom. But that doesn't change the fact that Perl gives you more freedom, and that this fact has implications.

      --
      Liberty uber alles.
  36. Loves to toot his horn, but he can't add by Jethro73 · · Score: 0, Flamebait

    > Writing a book is a full-time job. Unfortunately, I already have a full-time job
    > writing new Perl modules. And a second full-time job maintaining all my existing modules.
    > And a third full-time job helping with the design and explanation of Perl 6. And a fourth
    > full-time job traveling around the world speaking at conferences and Perl Mongers
    > meetings.
    > So taking on a fifth full-time job seemed a little...ambitious.

    Isn't a full-time job one that you spend 40+ hours per week on? Since there are 168 hours in a week, even having FOUR full-time jobs would leave a mere eight hours PER WEEK for sleeping, eating, commuting, etc. And 40 hours is the bare minimum around here. I code Perl 50 hours plus per week for actual uses in the credit card industry, not making kooky new modules.

    Give me a break, buddy. You aren't the only one who has to work for a living, and your job seems pretty cush... Quit it with the martyr syndrome, and write the damn book.

    JM2C...

    Jethro73

    --
    Quidquid latine dictum sit, altum viditur.
    1. Re:Loves to toot his horn, but he can't add by Anonymous Coward · · Score: 0

      How the fuck is that flamebait? Morons. They give EVERYONE moderator access these days.

  37. Baroque?? by paul_the_nomad · · Score: 1

    I used to do a huge amount of C++ programming too, and enjoyed it. But that was back before the committees got hold of it and turned it into a baroque monstrosity.

    And there I was thinking Perl was pure baroque with all that weird syntax. The clarity of C on the other hand is Enlightenment. Which makes Pascal Renaissance.

    So what would Leonardo da Vinci programmed in?

    Oh, dear, there does the little karma I had

  38. Identification is not necessarily exclusionary. by dgou · · Score: 1
    Re: the previous rants/trolls about Art and Programming soiling each other...
    check out Playing both against neither (pdf format) which gets into the fallacy of the "exclusive or" mentality which seems to be apparent in many of the messages post here (so far).

    The world is much too interesting, even the parts, like programming languages, which we've created, to be so easily pigeoned into such small compartments.

  39. Re:Is Programming Art or Science by Anonymous Coward · · Score: 1

    Well, this is a very old and relatively stupid debate (I think the first time I participated in it was when I was 13 or so on FidoNet, luckily i've learned since then.)

    But it comes to mind that that most venerable CS author Knuth called his highly regarded series of books (or bibles depending on who you talk to)
    "The Art of Computer Programming"

    So maybe those that argue there is no Art in computer programming should take it up with him?

    demerphq -> http://www.perlmonks.org

  40. "Evangelists" by Anonymous Coward · · Score: 0

    People who shove their backwards-ass supersition down other peoples' throats deserve a good beating. Christians especially.

    1. Re:"Evangelists" by Anonymous Coward · · Score: 0

      pot calling kettle black

  41. Perl vrs. Python by phlurg · · Score: 3, Offtopic

    Printing an array of hashes in Perl (lifted from O'Reilly book):

    # print the whole thing one at a time
    for $i ( 0 .. $#LoH ) {
    for $role ( keys %{ $LoH[$i] } ) {
    print "$i: $role is $LoH[$i]{$role}\n";
    }
    }
    in Python:

    for i in range(len(list)):
    for key in list[i].keys():
    print i, ": " + key + " is " + list[i][key]

    Consider line 2 of both examples. Perl's contains 11 non-alphanumeric typographical symbols. Python's contains 6. On a purely visual level alone, I can't imagine anyone preferring to maintain the former over the latter. Furthermore, Perl requires the explicit "% { }" foo so that it knows it's dealing with a hash, an issue Python doesn't face. (Orthogonality... now _there's_ a concept!)

    Now take the above Perl example and imagine if you're using a _reference_ to an array of hashes, as in:

    foo = \@LoH;
    for $i ( 0 .. $#$foo ) {
    for $role ( keys %{ $$foo[$i] } ) {
    print "$i: $role is $$foo[$i]{$role} \n";
    }
    }

    Sweet Jesus, my eyes are hurting! I started using Python 6 months ago and for general purpose scripting, I swear I'll never go back to Perl if I'm not forced to.

    1. Re:Perl vrs. Python by Caelum · · Score: 0

      You simply don't know Perl well enough. Your last example will not even compile. Here's how to print a reference to an array of hashes:

      my $i = 0;
      for my $el (@$list) {
      for my $key (keys %$el) {
      print $i++, ": $key is $el->{$key}\n";
      }
      }

      Now, what's so hard about that?

    2. Re:Perl vrs. Python by phlurg · · Score: 1

      Actually, I compiled/ran the last example before posting it... Works for me using cygwin's perl5.

    3. Re:Perl vrs. Python by Anonymous Coward · · Score: 0

      >
      >
      > in Python:
      >
      > for i in range(len(list)):
      > for key in list[i].keys():
      > print i, ": " + key + " is " + list[i][key]
      >
      > Consider line 2 of both examples. Perl's contains 11 non-alphanumeric
      > typographical symbols. Python's contains 6. On a purely visual level alone, I
      > can't imagine anyone preferring to maintain the former over the latter.
      > Furthermore, Perl requires the explicit "% { }" foo so that it knows it's
      > dealing with a hash, an issue Python doesn't face. (Orthogonality... now
      > _there's_ a concept!)
      >

      Really? I count 34 for Perl and 23 for Python... not much to brag about...

      But hey, if you want to count symbols as your measuring stick, how about something more like:

      my $i=0;
      foreach my $h_ref (@list)
      {
      print "$i : $key is $value\n" while ($key, $value) = each %$h_ref ;
      $i++
      }

      It has 26!

      Arguably a lack non alpha-numeric symbols is not an indication of code clarity. Each of those symbols tells you something important about the code, that to an experienced perl programmer, helps to reduce errors. I'm guessing you weren't a fan of math or physics if symbols throw you off....

    4. Re:Perl vrs. Python by kurt1992 · · Score: 1

      So, you know why perl sucks, but you don't know enough to have any samples handy other than one you say is from an O'Rielly book: as others have noted, it won't compile, but that's not even the point.

      Perl has more than its share of haters, but look at what is built in perl: banking systems, systems used in genomics, on Wall Street, those automated Amazon warehouses, this discussion board where those who don't know Perl declare boldly that it is useless.

      The language is widely used by engineers in various industries to solve all sorts of problems that have nothing to do with CGI or servlets and which have no need for the do-it-yourself memory management of C or the strict object structure of Java.

      The Homer Simpson reaction is commonplace, wherein newbies look at a section of perl code and declare it to be "hard to read" or whatnot. Perl is extremely easy to read if coded by someone who cares about such things. Perl is difficult to learn, but learning it unlocks the real power.

      C is never easy to read. And as for Python, its a cool language, but where is the CPAN? the vaults of parnyssus is much less organized and mature than CPAN, and there's way too much 0.01 releases. Python is perl with better object structure, no CPAN and no curly brackets. Its biggest problem is that Perl was first, and many of us will continue to use perl.

      The CPAN note is an especially important one here in the real world: You can get a CPAN module that will assist in pretty much any IT-related task you could think of.

      In the real world, there are other things you must deal with also: getting automated reports to higher-level management, based on god knows what source of data, development time, processing various data in various situations, generating weekly graphs without pointing-and-clicking your way through Excel every friday. Those of us who use Perl have programs doing our jobs for us, doing all these things, and anything you can imagine pertaining to unix administration.

      Perl can also be used to develop big projects, rapidly, and cheaply. Programming Perl is said to be one of the most popular books in the semiconductor industry. If you use linux or use the internet, you're using Perl at one point or another, i could go on, but won't.

    5. Re:Perl vrs. Python by phlurg · · Score: 1
      Symbols do not "throw me off," and while admittedly a lack of non-alpha-numeric symbols doesn't insure code clarity, a language's design can certainly impede or assist in achieving that goal. If one enjoys mentally parsing stuff like $#$foo, @{ $foo[$bar] }, etc... that's all well and good, but why should one have to? The notion that these symbols provide meaningful information about the code is only valid when the language itself is as non-orthogonal, and overly flexible as Perl, IMHO. (Eg, in which a given symbol can represent an array or scalar depending upon context, for example.) I've never found the lack of @,$,%, etc... a serious issue in Python or any other language; certainly, my own experience with Perl is that it's no _less_ error prone than any other reasonable language.

      I guess all I can say is that personally, I found Python incredibly easy to learn and use as a language, and generally much more maintainable and easier to read than Perl. Some others have come to the same conclusion, and go into more exhaustive detail than I have... for example:

      http://www.linuxjournal.com/article.php?sid=3882

      http://www.garshol.priv.no/download/text/perl.html

    6. Re:Perl vrs. Python by m_ilya · · Score: 1
      No need to hurt your eyes. You can print an array of hashes in Perl with just

      use Data::Dumper;
      print Dumper(\@LoH);

      :)

      --

      --
      Ilya Martynov (http://martynov.org/)

    7. Re:Perl vrs. Python by Anonymous Coward · · Score: 0
      Now, what's so hard about that?

      This is not very good program style: what happens when you decide "ok, my program is now debugged, now just remove all those print by commenting them with just adding a '#' before them ". But initial Python code is also less than perfect as idiomatic python would use:
      "for key,value in list[i].items():".

    8. Re:Perl vrs. Python by Anonymous Coward · · Score: 0
      Arguably a lack non alpha-numeric symbols is not an indication of code clarity. Each of those symbols tells you something important about the code, that to an experienced perl programmer, helps to reduce errors. I'm guessing you weren't a fan of math or physics if symbols throw you off....

      Symbols are good if there are useful. They are bad when they are useless or redundant. Is this the case in Perl ? Well, maybe they are helping preventing errors. Is this the case in Python ? Much much less, since in Python you can't add a list or a string to a number for instance. Conclude for yourself.

    9. Re:Perl vrs. Python by Anonymous Coward · · Score: 0

      > Symbols do not "throw me off," and while admittedly a lack of non-alpha-numeric
      > symbols doesn't insure code clarity, a language's design can certainly impede or
      > assist in achieving that goal. If one enjoys mentally parsing stuff like $#$foo,
      > @{ $foo[$bar] }, etc... that's all well and good, but why should one have to?

      You don't. That's the point.

    10. Re:Perl vrs. Python by phlurg · · Score: 1

      No argument that Perl is good for a lot of stuff. CPAN is great, and if there's something I can't do in Python that is provided by CPAN, obviously I would use it. However, the existence of a large code base implies little about the inherent quality of the language itself. There are a lot of great FORTRAN libraries out there too, yet few people would laud FORTRAN on its merits as a language. Although I think one can make a strong argument to the superior elegance of Python over Perl, no doubt at some level this sort of debate simply boils down to an intractable personal preference of the vi vrs. emacs sort. I'm merely suggesting to those out there who might have found Perl annoying and kludgy for one reason or other to give Python a shot and draw your own conclusions. P.S. The example does compile. I compiled/ran it before posting it.

  42. What I dislike about Perl... by cr0sh · · Score: 1

    Don't get me wrong - currently I am learning Perl by coding a somewhat complex (at least for a "first" project) CGI bookmark management system. I have yet to stray into the OO syntax of Perl yet, sticking with a functional approach for now. I am having fun, and enjoy coding in it. With that said, though...

    I understand the sentiment of some when they equate Perl with "line noise" - we have all seen the lovely "one-line" Perl scripts which seem to "be all that and a bag of chips" - scripts that seem to do the impossible, sometimes.

    I am sure we have all seen instances of this same type of coding within larger Perl systems, as well. I know I have looked inside some modules I have download, some code I have picked up in places, and nearly gagged at some of the stuff I have seen...!

    Sure, it worked great - but unless you are a master regex wizard (regex is something I am still trying to grasp the complexities of - whoever came up with the system should be beat - I mean, if you want to do something complex, that is what coding is for - not everything should be done on the command line!) you can't understand it. Regex, unfortunately, seems like a "must-to-know" to do certain things in Perl, it seems. I don't want to really come across as knocking regex too much - I attribute that more to my lack of understanding. I am sure one day I will come to "love it".

    I think what upsets me the most is that many of these "wizards" assume that because they wrote the regex code for a certain function, that others can easily read it. However, it is apparent by the number of people who refer to Perl as "line noise" that others find those expressions hard to read!

    I think it would be better if those expressions were broken out/down into seperate lines, with comments explaining what each section is doing (why is commenting so hard for most programmers to do? You want fun? Wade through the Descent I code - this from a pro game house - hahahaha! - non-commented C code at its finest - but I digress). If they must, because of performance reasons (I don't honestly know for sure), provide the single line version as well, and put the multi-line version in comments or something.

    Nothing makes me loath Perl more than trying to figure out the bits (that should be "huge bits") of regex almost invariably scattered throughout...

    --
    Reason is the Path to God - Anon
    1. Re:What I dislike about Perl... by Caelum · · Score: 0
      Yes, you will eventually come to learn and love regular expressions. Even Microsoft is introducing them into VB/VBScript and Dev Studio (though I don't know much about those) -- this is when they noticed people were becoming very happy using ActiveState ASP/Perl instead of vbscript :)

      Once you learn regular expressions, you aren't limited to just Perl. Suddenly you can do things in vi or emacs, or shell scripts/one-liners with grep/sed/awk (yes, you still use those even when you know Perl!) that you never imagined were possible...

      And you can comment and break out regular expressions in Perl, for example:

      /^(\w+) # put word at beginning of line in $1
      \s*--\s* # if followed by --, etc...
      /x

      see the 'x' modifier in man perlre.

      Go get and read "Mastering Regular Expressions" by Jeffrey Friedl. Your life will change, your sex life will improve...err maybe not, anyway have fun :)

    2. Re:What I dislike about Perl... by Anonymous Coward · · Score: 0

      Learning regular expressions will be well worth your while. The "wizards" who write them aren't writing them to impress or confuse people (usually!). They write them to pack an incredible amount of power into a very terse syntax. At first I guess you could find it pretty daunting, but here's a tip:

      Look at each part (metacharacter or character) of a regex separately and translate it into english in your head. Don't look at the line as a whole. Just take a little bite at a time. Really! That's the whole key to regular expressions.

      For example,

      print "wookie" if $sound =~ /yarrr/;

      You shouldn't read the regex like "matches yarrr", you should think "matches a 'y' followed by an 'a' followed by an 'r' followed by an 'r' followed by an 'r'".

      If you do that consistently as a beginner you won't have any problems disecting slightly more complex bits like:

      print "wookie" if $sound =~ /^y?a+r{3,5}/i;

      Just think "Match the beginning of a line, followed by a 'y' (optionally) followed by at least one 'a' followed by between 3 and 5 r's... Oh yeah, and do that all case insensitively."

      The main learning curve you'll experience with that approach is based solely on memorizing the meaning of a handful (literally!) of metacharacters. There's nothing magical to them at all, and the syntax is extremely simple compared to a full featured programming language. As far as stuff like \w \d \s etc are concerned, they're just syntactic sugar to simplify common patterns. Just about everything has a nice mnemonic associated with it too, so you shouldn't have too much trouble.

      Cheers.

    3. Re:What I dislike about Perl... by Pinball+Wizard · · Score: 1
      I think what upsets me the most is that many of these "wizards" assume that because they wrote the regex code for a certain function, that others can easily read it.


      I had a guy working for me for a couple of months who knew regexes better than me. I made him clearly comment his code above each regular expression he did so I wouldn't have to pore through Programming Perl to figure out what he did.


      If Perl is clearly commented its not that bad of a language to work with, but otherwise his program would have looked like line noise.


      If you are using Perl in a team project, extensive comments are a must.

      --

      No, Thursday's out. How about never - is never good for you?

  43. Docs, communications and teamwork by Anonymous+Brave+Guy · · Score: 2
    Funny, though: a majority of programmers I've known--while intelligent and relentless--place less emphasis on the "documentation, communication, teamwork" skills.

    A majority of programmers I've known are the same; not many of the good ones, though. Almost no serious programs can be written properly by a single developer these days. I'd rather have a team of 5 competent but unexceptional programmers who understand the value of communication, than a team of 5 ueberhackers who can't or won't communicate with one another. The former will typically get the job done much better.

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  44. An artist's art != an artisan's by Artichoke · · Score: 1


    Or, to put it another way: the category of the process is not of neccessity related to the category of the product.

    You appear to be suffering from homonymic category confusion :)

    An art, as in artist, is to do specifically with aesthetically purposed construction.

    An art, as in artifice or artisan, is to do with any skillful process requiring good judgement and expertise. Hence:

    The process of generating science is an art.

    The product, i.e. science, however aesthetically pleasing it may be to the scientist, is neither art nor its subcategory Art.

    [Science, and code, may be aesthetically pleasing, but for the most part this is not their primary purpose - obfuscation competitions et cetera notwithstanding.]

    As for the legal profession's antics, I guess a well written, superbly delivered oration could even be classified as a work of art. But to construct a good legal case is still more of an art than a science.

    So, what of engineering and, more to the point, software engineering? Well, to me it is simple. One sense of art applies (artifice) and the other (aesthetic purpose) does not.

    Sloppy coding and coding practices are neither.

    Okay, I've stopped gibbering (for now). So flame me :)

    [FWIW: I code and I daub]

    --
    __
    Arse
    1. Re:An artist's art != an artisan's by arkanes · · Score: 1

      Lets contrast something else: Swordmaking, or weaponsmithing in general. A sword (or program) can be dull, unembellished and brutally functional. It also can be highly ornamented, with gems and gold and what have you, and be of no practical use at all. Or, it can be elegent and strong and flexible, a work of the swordmakers art, and also be an excellent and highly functional weapon. Just because something is practical doesn't mean that it's creation isn't an art.

    2. Re:An artist's art != an artisan's by kubalaa · · Score: 1
      "Or, to put it another way: the category of the process is not of neccessity related to the category of the product."

      Ah, I did not confuse the two although you put it much more clearly than I did. My point can now be simply stated as: "art" is always a process and never a product.

      I say that simply because I can think of no reasonable, universal way of defining "art" for a product. So while I agree that a painting and a computer program may not both be artistic products, to elucidate the difference will require more than a simple one-word categorization.

      --

      "If you look 'round the table and can't tell who the sucker is, it's you." -- Quiz Show

  45. Regular Expressions by Laplace · · Score: 3, Informative
    I think that you don't really understand the roots of regular expressions. However, you might be familiar with something called a finite state machine.

    A finite state machine is essentially a set of rules that operates on a string. Given the current state and the input one travels to a new current state. The theory of finite state machines is integral to the development of computer science and has a very strong mathematical foundation. A computer language that can be represented by a finite state machine is called a regular language.

    This is where regular expressions come in. They are essentially user constructed finite state machines. The input is the text, and the state is the curent symbol (or symbol set). If you match the current symbol, you move to the next. If you don't you go back to the beginning. If you reach the end of the symbol set, you have a match.

    Regular expressions weren't made up to confound you, they were the implementation of a sound mathematical method that is very useful for text processing. However, regular expressions by themselves are not enough to form a Turing Machine, or even an approximation of a Turing Maching (which is what the computer sitting on your desk is).

    Moving to more practical matters; regular expressions are not easy to read. You're working on raw characters, and you have to have lots of escaped to handle everything. They become easier with practice, and are very useful. The biggest problem with them is that every application (Perl, vi, emacs, grep, etc) use their own syntax for them, which means you have to shift gears every time you try to use them in a different application. But that is a problem with the implementation, and not the tool itself.

    --
    The middle mind speaks!
  46. Re:Perl vrs. Python [More than one way...] by jjn1056 · · Score: 1

    Well, if you don't like the O'Reilly Example, there are several other ways to do this. Maybe you think the following is more clear?

    Try

    ##>>> Build an Array of Hashes...

    our @array_list = (
    { aaa => 111, bbb => 222, ccc => 333},
    { aaa => 111, bbb => 222, ccc => 333},
    { aaa => 111, bbb => 222, ccc => 333},
    { aaa => 111, bbb => 222, ccc => 333},
    );

    ##>>> Loop d' loop...

    foreach my $array_item (@array_list)
    {
    print "New Row! \n";

    while( my ($key, $value) = each %$array_item )
    {
    print " Key: $key, Value: $value \n";
    }

    }

    if the variable @array was a scalar ref this would be basically the same:

    our $array_list = [
    { aaa => 111, bbb => 222, ccc => 333},
    { aaa => 111, bbb => 222, ccc => 333},
    { aaa => 111, bbb => 222, ccc => 333},
    { aaa => 111, bbb => 222, ccc => 333},
    ];

    foreach my $array_item (@$array_list)
    {
    print "New Row! \n";

    while( my ($key, $value) = each %$array_item )
    {
    print " Key: $key, Value: $value \n";
    }

    }

    Both give the following:
    New Row!
    Key: ccc, Value: 333
    Key: bbb, Value: 222
    Key: aaa, Value: 111
    New Row!
    Key: ccc, Value: 333
    Key: bbb, Value: 222
    Key: aaa, Value: 111
    New Row!
    Key: ccc, Value: 333
    Key: bbb, Value: 222
    Key: aaa, Value: 111
    New Row!
    Key: ccc, Value: 333
    Key: bbb, Value: 222
    Key: aaa, Value: 111

    I can think of several other ways to handle this, although I seldom need to write out code to parse though complex structures, since I can use data::dumper.

    Of course, adding some documenation is always good for clarity.

    Not that I have a problem with the python way. Looks cool to me. But I don't understand how it's really more self documenting than perl.

    Peace.

    --
    Peace, or Not?
  47. He's a letcherer by Anonymous Coward · · Score: 0
    Feel sorry for the first year under grads who have to try to learn C from him at Monash Uni. The guy has no real world experience, and that was seven years ago when I studied. I wonder if he realises that their is a world outside of acadamia.

    P.D.

    -----------

    I'd post as my self but I can't be bothered logging in

  48. Oh yes they do, behind you etc. by alext · · Score: 1

    Most of the GOF patterns are specific to a class of languages, in fact they go further and embody implementation assumptions such as local vs. distributed, transient vs. persistent etc.

    Take a look at how the estimable Peter Norvig achieves the aims of many of the patterns in LISP: Design Patterns in Dynamic Programming. Are these LISP implementations of the DP examples?

  49. while I agree... by Preposterous+Coward · · Score: 2
    ...that Perl is much more useful than it's often credited for, I'd dispute the claim that programmers "like to write short and clever programs...it's every programmers dream." OK, maybe that's what I'd like to do, but my real dream is to produce code that (a) works as intended and (b) is maintainable. Short and clever may be fun but they are essentially self-indulgences, and performance (for most applications) is not all that critical except in a handful of hotspots.

    All in all, I don't really care about lines of code and efficiency (of execution). CPU time is absurdly cheap. Human time is extremely expensive. So I care about time to develop and maintain -- if that means a slightly longer, less clever, and easier-to-read approach to solving a problem, that's likely the one I'll choose.

    --

    "Biped! Good cranial development. Evidently considerable human ancestry."
  50. great point by Preposterous+Coward · · Score: 3, Informative
    I find this especially baffling given that most prolific programmers are also pretty decent typists, so I don't understand why it's so hard to use variable and function names that are a bit longer and more descriptive.

    My guess is that many programmers haven't had enough painful experience maintaining crappily-written code. Maybe the first thing that should be taught in CS 101 is not how to write "hello, world", but how to take a poorly documented and convoluted program written by somebody else and fix the bugs. (No flames about how CS is about computer science not programming; you know what I mean here.)

    For me personally, the incentive to write more self-documenting code was having to maintain stuff I'd written and deployed in commercial environments for a period of years. I don't care how well you knew the code when you wrote it, when your customer unearths some obscure bug in five years' time you're not going to remember a damn thing. And that is a miserable experience. It taught me to take the time up front to save myself the agony down the line.

    --

    "Biped! Good cranial development. Evidently considerable human ancestry."
  51. Perl vs. PHP by nalfeshnee · · Score: 1

    actually this post isn't about what u think at all. i just thought it amusing to note that an announcement about a major update to PHP gets a measly 20 comments, whilst a more general and waffly piece about Perl (interesting as it is tho') gets nearly ten times as many.

    do i take it from this that /. readers are Perl hackers rather than PHP scripters? thought so.

    nalfy.

    --

    -- Despair is an operating system that ANY human being can run, sort of a psychological JAVA --