Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^3: Perl is dying

by webfiend (Vicar)
on Jul 14, 2006 at 21:40 UTC ( #561339=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl is dying
in thread Perl is dying

Ruby is good at text manipulation. So is Python, even if it does look a little different. The thing is that text manipulation is an innate part of what Perl is. It's so tightly ingrained into the language that Perl is often a first choice for such tasks even if other, prettier languages are available.


Comment on Re^3: Perl is dying
Re^4: Perl is dying
by tilly (Archbishop) on Jul 14, 2006 at 21:56 UTC
    If you're familiar with both Ruby and Perl, you'd know that text manipulation is as much an innate part of what Ruby is at it is an innate part of what Perl is.

    Perl beats Ruby for such tasks for the following three reasons: people already know Perl, there are more (and better) libraries for Perl, and Perl is somewhat faster on benchmarks. Those are listed in what I believe to be decreasing order of how commonly they come up.

    Note that I did not include in the list that Perl is better for text manipulation. That is because I believe it isn't. Ruby can generally express the same concepts as concisely or more concisely than Perl. Ruby has several nice features that Perl does not, for instance I like the fact that Ruby natively lets you iterate over the lines in the string. And Ruby avoids some gotchas that Perl has, for instance using $& somewhere in your program doesn't slow down every other regular expression like it does in Perl.

      True enough. I fall firmly into that first camp. I already know Perl, so it's often my first choice. This is in spite of the fact that I've been using Ruby for various sundry projects for about 5 years now. Plus colleagues in my colorful employment history get all jittery if I mention a language other than Perl or Java in the context of "say, couldn't we do this in X?"
      I think there is one thing where Perl have some advantage in text processing over Ruby - it is handling Unicode. Granted this is only second hand - but I've heard Ruby has some deficiencies here.

      for instance using $& somewhere in your program doesn't slow down every other regular expression like it does in Perl.

      In perl5.10 there is a new way to do this that doesnt come with a generalized performance penalty. In fact, Perl 5.10 expands the regex syntax greatly and offers some nice new optimisations.

      ---
      $world=~s/war/peace/g

Re^4: Perl is dying
by Jenda (Abbot) on Jul 15, 2006 at 21:13 UTC

    Beauty is in the eyes of the beholder. Or was it ... beerholder? ;-) I'm one of the few Czechs that don't drink beer, so I don't know for sure. In either case I find Perl pretty enough. And even though I'm all for simplicity in dressing, I do like the sigils and other ornamentation of Perl. OTOH, eg. Visual Basic is simply ghastly. Like a row of dull, concrete block of flats. No ornaments, no room for fantasy, no room for living.

Re^4: Perl is dying
by apotheon (Deacon) on Jul 19, 2006 at 07:12 UTC

    My experience is that Perl's regex syntax is slightly slicker than Ruby's, though the difference is so slim as to be negligible for most purposes. Python's, meanwhile, is an ass sandwich -- it's almost as bad as PHP's regex syntax, and in some ways is even worse.

    For text manipulation requiring nontrivial regexen, I'll stick to Perl (first choice) or Ruby (a very close second), thanks. For something simple enough, I'll go ahead and do something with PHP. I'm likely to stab myself in the leg, intentionally, repeatedly, before choosing Python for regexen under any noncoercive circumstances.

    print substr("Just another Perl hacker", 0, -2);
    - apotheon
    CopyWrite Chad Perrin

      Funny, that's how I feel about PHP's regex handling. Python's regex libraries are a distant third to Perl and Ruby, but PHP makes me itch. Perhaps that's the issue for me in the first place: PHP makes me itch, so their regex library is just going to be more itchiness for me :)

        I'm not really sure which regex syntax I dislike more, truth be told -- PHP's or Python's. I think I dislike PHP's more. I actually have occasional need to use regular expressions for stuff I essentially am forced to do with PHP, though, so I've resigned myself to it. The same circumstance doesn't exist for Python, in part because I've managed to avoid having to become competent in Python (I don't actually like Python at all and don't care to learn it if I can avoid it, because the more I like it the more I'll find myself being asked to use it).

        Python's a great language, of course. I can look at it somewhat objectively and realize that. It just makes my eyes bleed and lacks some capabilities that are pretty much essential to my enjoyment of programming.

        print substr("Just another Perl hacker", 0, -2);
        - apotheon
        CopyWrite Chad Perrin

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (21)
As of 2014-09-18 14:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (116 votes), past polls