[oak perl] Most Annoying thread about regexes?

David Fetter david at fetter.org
Tue Apr 6 17:05:42 CDT 2004


On Tue, Apr 06, 2004 at 02:11:46PM -0700, Belden Lyman wrote:
> On Tue, 2004-04-06 at 12:22, George Woolley wrote:
> > On Tuesday 06 April 2004 10:06 am, David Fetter wrote:
> > > On Mon, Apr 05, 2004 at 10:59:13PM -0700, George Woolley wrote:
> > > > On Monday 05 April 2004 3:09 pm, David Fetter wrote:
> > > > > On Mon, Apr 05, 2004 at 03:13:12PM -0700, George Woolley wrote:
> > > > > > What's the most annoying regex you've encountered?
> > > > >
> > > > > Anything that doesn't fit on one line.   After that, they're all
> > > > > equally annoying, and don't belong in production code. :)
> > > > >
> > > > > Cheers,
> > > > > D
> > > >
> > > > David,
> > > > Thanks for the provocative response.
> > > >
> > > > Based on your response, my understanding is that your position is
> > > > that there are no production environments in which which it is ever
> > > > appropriate to use regular expressions in production code.
> > > > Is that your view?
> > >
> > > I don't know how you managed to get that out of what I said.  In my
> > > experience, *complicated* regexes don't belong in production code.
> > > Multiple simple ones are a lot easier to code, debug, &c.
> > >
> > David,
> > 
> > Oh, good. 
> > I'm glad that your position isn't
> > that no regexes belong in production code.
> > 
> > You seem uncertain how I managed to understand you to be saying
> > that no regexes belong in production code.
> > Here's how:
> > * Because of the context I interpreted "they're all"
> > to be referring to "all regexes".
> > * I thought you were continuing with the same topic
> > in the second half of that sentence
> > (which has no explicit subject).
> > * That led me to interpret it as something like
> > "all regexes don't belong in production code"
> > or an unqualified "No regexes belong in production code".
> > Hope that clarifies how I managed to get that out of what you said.
> > 
> > I haven't so far come up with an alternate interpretation.
> > Hence I would be most interested in your interpretation
> > of your own words.
> > 
> 
> How about how someone else interpreted David's words?
> 
> Here's what was written:
> 
>    George: What's the most annoying regex you've encountered?
> 
>    David: Anything that doesn't fit on one line.   After that, they're 
>           all equally annoying, and don't belong in production code. :)
> 
> I took David to mean:
> 
> "The most annoying regex I've encountered is anything that doesn't fit 
> on one line. The set of regular expressions which is longer than a
> line's length is an annoying set, none of whose members belong in
> production code."

Yes.

> Perhaps missed by other readers, David further implies the existence
> of a single regular expression which proves that the aforementioned
> set is finite.

I didn't bother to imply that it was finite, as we live in a universe
pretty well established to be finite, which naturally limits the
length of strings.

I did imply that the set was non-empty, although I did not provide an
example.

I did not specifically state that the set of regular expressions that
don't belong in production code was a *proper* subset of regular
expressions, although a retarded monkey would have been able to infer
it trivially, as I have posted regular expressions in the past that
were part of routines I specifically said were suitable for production
code, and have not posted retractions of same.

> But lacking the space in his margin to scribble the tantalizing
> regex, we are simply left with Fetter's Enigma.

LOL!

> > Anyway, I do now understand that you do not take the position that
> > no regexes belong in production code.
> 
> There is a certain school of thought which contends that only
> production code belongs in production code.  Superfluous drapery-
> error messages, regular expressions, SQL statements, HTML templates,
> javascript, and so on should all be removed from production code.

ROTFLMAO!

Cheers,
D
-- 
David Fetter david at fetter.org http://fetter.org/
phone: +1 510 893 6100   mobile: +1 415 235 3778

Remember to vote!



More information about the Oakland mailing list