Good Theory

There’s a quote from a Ross Cox blog post (about regular expression theory) that I quite like:

Historically, regular expressions are one of computer science’s shining examples of how using good theory leads to good programs…. Today, regular expressions have also become a shining example of how ignoring good theory leads to bad programs. The regular expression implementations used by today’s popular tools are significantly slower than the ones used in many of those thirty-year-old Unix tools.

Ross Cox

This idea of good theory -> good programs can be applied almost universally. It’s common practice to think about theory only after brute force fails. The theory takes the back seat, and is an afterthought.

The consensus of a large part of the industry is that you don’t need a computer science degree to be a developer1. And you don’t. But depending on your line of work, you may eventually need theory.

The thing about brute force is it works until it doesn’t. And when brute force fails, you’re might end up needing some theory.

It’s not all about theory though, and too much won’t help either. It’s about balance. I’ll step off my soapbox, and yield my time to Donald Knuth:

If you find that you’re spending almost all your time on theory, start turning some attention to practical things; it will improve your theories. If you find that you’re spending almost all your time on practice, start turning some attention to theoretical things; it will improve your practice.

Donald Knuth

  1. Note: I’ve seen this anecdotally, but have been unable to find hard evidence to back this up. The general wisdom is that a degree gives you a leg up, but isn’t necessarily required. [return]