Friday, August 20, 2004

Optional Laziness

Yesterday, I took out a temporary membership in the Bad, but not that Bad Parents club. In addition to watching the kids, running the household, and working a part-time service-sector job, I also dabble in web development. Usually I do this after the kids are in bed, or during those few precious days when I have child care but am not scheduled to work at my job, but yesterday, the scent of having a project almost finished (and being able to send a bill for over $800 when I finished it) kept drawing me towards the computer.

These are the times when I am glad to have two little ones. It makes it easier to rationalize making them entertain themselves. "After all," I say to myself, "they really need to learn the skills of interacting with other children, not the skills of hanging out with an adult." I tell myself, "you're their parent, not their friend," and try to make myself believe that the things I did do yesterday — making them healthy and nutritious meals, laundering all their clothes, and so forth — are what is really important for their development. And, of course, the lazy parent's mantra, "human beings are resilient."

Unlike the messiness of human development, the languages and codes used in web development are elegant and clean. Recently, I've been studying the sublime mysteries of regular expressions, or "regex." My head was so far into web-land yesterday than when a friend wrote me an email with "?" as the subject, I wrote a reply explaining that in the mysterious world of regular expressions, the ? symbol makes whatever come before it optional. If you want to match either "cat" or its plural, the regex is /cats?/ (the ? makes the s optional). It is also a symbol for "laziness" if it follows a special command character. If you try to match the phrase "pain in the ass" with the regex /as+/ (a followed by one or more s's), it will be "greedy" and match ass, but if you use /as+?/ the ? makes the + lazy, so it just matches as.

My friend replied, asking if I was subtly implying that she was a lazy, questionable pain in the ass. In web-land, there are no subtle implications — though things that you write often don't mean what you intend them to mean, they do so in a big, bold, obvious way (your program crashes). And a program doesn't worry about how many mistakes you've made in developing it. This is probably why I find this work so distracting from my family responsibilities, where words have subtle emotional meanings that are often unintentional and where it is the process of raising the kids, making the marriage work that is important, rather than the end result.