in reply to Possessive Quantifiers

...I'm not sure what led you to the conclusion that Java does RE matching better than Perl. (I thought for a while you were just baiting us.)

But I will say that regular expression support in Java is fairly brand new, and for many of us IT Unitarians, regex support in Java is here AFT if you know what I mean.

If the possessive quantfier is all you can point to in support of the premise that "Java does it better than Perl," I'd have to differ with your conclusion. Benchmarks, I would consider as some mild evidence. Examples of nasty regexes that are simplified in Java somehow, I'd consider.

But in the end, why the heck do we have to have a "this one better than that one" metality all the time? Why isn't it good enough that programmers who want to use Java can count on regex matching, and programmers who want to use Perl can do regex matching. I really don't care who was first. I really don't care about which one is incrementally faster, and I really don't care about which one has a more concise way to accomplish some arcane backwater operation.

Wanna talk about Real Life(tm)? Here's something about it. I don't choose the implementation language on the basis of something as marginal as minor differences in regular expression support. (In fact, even that absence of regex support in a language (as was the case with Java until very recently) will not sway my decision most times.)

It breaks down like this. If I have one smart guy (or gal) to do the implementation, I may very well choose Perl. If I have a team which must coordinate in the implementation, I want a more strongly typed language like Java. (Even if I have a very smart team of hotshot developers, I may still go with Java just to cut down on integration headaches and intra-team communications overhead.) If I want the most rapid prototype possible, I'll probably choose to do it in Perl. If I plan to distribute to a widespread audience, I may choose Java. If I have to consider portability and provide a GUI, I'll probably choose Java (although I may regret it later).

It's all good people! There doesn't have to be a "weener and still champeeon!" When are we going to stop watching Highlander and believing that "there can only be one." That's a Redmond mentality. You can use either langauge; they're both free with your purchase of an Internet connection. (Remember what polyamorists say: "AND, NOT OR.")

Okay, so consider me to have officially been baited. And I promised my family I'd stop. :-)

...All the world looks like -well- all the world, when your hammer is Perl.
---v

Replies are listed 'Best First'.
Re: Re: Possessive Quantifiers
by Ferret (Scribe) on Aug 18, 2002 at 23:25 UTC

    I'm sorry to have confused you, but I was definitely not intending to imply that Java did better RE matching than Perl - I am certain, particularly after reading Mastering REs, that the opposite is true.

    What I was trying to say (badly, apparently) was that the possessive quantifier + was a feature in the java RE engine which I liked better than its (?>) counterpart in Perl.

    I hope that clears up any confusion you may have had. Thank you for your input, though, since I always like to see language comparisons (and find myself often treating Perl as the god of all languages).

    update: Looking at this later, I realize that I have yet again said something other than what I mean, for which I feel greatly foolish.

    The possessive quantifier +, is a feature which I see as potentially very convenient. The (?>) construct, for some simple cases, is less readable, IMHO, but cannot be ignored for more complex cases or the must-match-exactly-once case.

    Didn't mean to imply any mine's-bigger-than-yours stuff, just a hey-lookit-this-nifty-feature thing.