Got more questions? Find advice on: ASP | SQL | XML | Windows
in Search
Welcome to RegexAdvice Sign in | Join | Help

Regex According to Jeff

The right tool for the right job

If it doesn't fit, get a bigger hammer.

I'll try to avoid the obligatory “first post” scene and instead describe--what I hope will be--the overall theme for my blogging here; “the right tool for the right job”.

I've seen this happen in other places, but most often I see it in software development.  You read about “the next best thing” and suddenly get all religious about how sure you are that if you could only use “the next best thing” your life would be:

  • 100 times more rewarding,
  • 100 times easier, and
  • your hardest decision would be which of the women thrown at your feet would you choose first.

Unfortunately that never happens (as I look back at the countless virgins in my wake).  What is more likely to happen is that you spend hours trying to force a square peg into a round hole.  If you're lucky, you're only frustrated, burnt out and minus a few hours of your life when it's all said and done.  If you're not lucky you're all those things, not done, and very close to throwing “the next best thing“ out the window because it didn't help at all.

Don't get me wrong, regular expressions (regex) are a great tool to add to your toolbox.  I just don't think it should be your only tool.  So as you read my posts let that be your grain of salt.  When I say (and I will) that coming up with a 7 line regex to validate dates is a bad idea, I'm not saying regex's are a bad idea, but that they're the wrong tool for that particular job.

Sponsor
Published Monday, November 10, 2003 2:33 PM by jeffrey
Filed under:

Comments

 

jeffrey said:

I look forward to our blogs. Your programming advice, code and UserGroup speeches is life changing stuff. My hope from your reading your blog is to absorb some of your programming skill by osmosis. If I absorb some fraction of your coding skills and mind over the years I might be able to overcome some of this "incompetence" on my part Bill is so quick to point out at the AspRockville.org meetings. :)
November 11, 2003 6:49 AM
 

jeffrey said:

Jeff, I second Charles M. Carroll's comment! The most valuable programming advice leads one to learn new ways of thinking --- new tools for the mental toolbox, in your metaphor. Regexps are one such ... as, perhaps, are some aspects of logic programming (PROLOG etc.). See for instance Jon Bentley's "Programming Pearls" series (some aphorisms are quoted in http://zhurnal.net/ww/zw?ProgrammingProverbs (4 Dec 2001)) ... and Richard O'Keefe's remarks in "The Craft of Prolog" (quoted in http://zhurnal.net/ww/zw?StrandsOfTruth (2 Nov 2000)), etc.

- ^z -
November 23, 2003 10:49 AM
Anonymous comments are disabled