[oak perl] Most Annoying thread about regexes?

George Woolley george at metaart.org
Tue Apr 6 18:06:06 CDT 2004


On Tuesday 06 April 2004 2:11 pm, 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.
> > >
> > > Cheers,
> > > D
> >
> > 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."
>
> Perhaps missed by other readers, David further implies the existence of
> a single regular expression which proves that the aforementioned set is
> finite. But lacking the space in his margin to scribble the tantalizing
> regex, we are simply left with Fetter's Enigma.
>
> > 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. See Class::Phrasebook,
> Parse::RecDescent, and your templating module of choice. If you want to
> remove production code from your production code, see also Acme::Bleach.
>
> Belden
>
> > George
> >
> > P.S. Thanks for not deleting the earlier parts of the thread
> > in your post.
> > It makes discussion much easier.

===
Belden,
Thanks. 
Yours is definitely an alternate interpretation.

Oh, kool, we now have Fetter's Enigma to add to our lore.

I've encountered something like 
the point of view you describe.
Do you hold a varient of that view?

I just finished doing some maintenance
on some code that uses several templates.
That made some of the maintenance much easier.

" Superfluous drapery" is an interesting phrase.
If something is superfluous,
why not simply dispense with it entirely?
I suppose it depends on context,
but I would think in many contexts 
if error messages are superfluous
then so are people and user interfaces.
Actually, I've encountered
those points of view.

Thanks for the reminder of the Acme modules.
Weird, I don't see any of them in my SuSE distribution.
I guess I'll need to download
whatever I need.
Anyway, eliminating production code
from production code
sounds optimal. 
Production should go really fast.
And no need for 
specifications and testing!  (^_^)

Skoal,
George




More information about the Oakland mailing list