Yet another infrequently-updated blog, this one about the daily excitement of working in the software industry.

Thursday, August 10, 2006

Now they have two problems...

Today, I'm going to write a bit about programming. But first, a short detour into the wonderful world of USENET, and the adaptability of certain quotes to any situation...

There's a fairly well known quote (among programmers, at least), that goes like this:

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

-- Jamie Zawinski

Jamie posted this to USENET back in 1997, and people have been quoting it ever since. I did some more searching, and I found an earlier variation, with citations going back as far 1988. Yes, Google Groups does have (some) USENET postings going back nearly 20 years. The older version is this:

Whenever faced with a problem, some people say `Lets use AWK.'Now, they have two problems."

-- D. Tilbrook

Cool, so this is apparently one of those all-purpose jokes, much like any ethnic joke. Actually, that could be pretty interesting:

Whenever faced with a problem, some people say "Lets have the American do it." Now, they have two problems.

-- M. Bessey

Wow, that's comedy gold! Okay, maybe not. But it leads nicely into the topic I actually wanted to talk about:

presenting...

Mark's list of the Top Four programming technologies that fit into the "now they have two problems" template:(in no particular order)

The common theme here is that these are all useful techniques, but are often misused by well-meaning programmers. I've seen more grief caused by misapplication of these technologies than anything else in my career. I'm going to write up a couple of quick rants on each of these subjects. This will be good for two reasons:

1. It gives me something to write about for the next couple of days.2. I can vent a little about some particularly irritating instances of these things that I've seen.

7 comments:

Zawinsky is also the source of one of my favorite comments, that all software tends to expand until it can read mail.

His comment is also similar to the old joke, "First prize is two tickets to [bad show or lousy sports team here]. Second prize is four tickets."

I guess I have no fear of using regular expressions to do ad-hoc data parsing, since it strikes me as being simpler than using an actual parser generator (which have always seemed opaque and difficult to use to me, although I haven't looked at any recent ones). Of course, the data I'm usually parsing is itself pretty ad-hoc, so it's a match made in... somewhere.

I don't tend to fear using XML, although for small amounts of data (for "internal" projects, if you will) any structured text format that is actually agreed-upon and documented will work fine. I have encountered the "use-XML-since-it-will-solve-all-our-problems" approach that fits this template. People don't seem to remember that while XML solves several problems, it's not a panacea ...