A few people asked why XWord Info was “Down for Maintenance” recently. Feel free to skip this post if you’re not interested in how software works, but I promise I will not get technical.
I first started programming XWord Info to research topics for my crossword blog. I imagined that someday my database might have as many as one or two hundred crosswords in it. So, I did what all hackers do, I threw something together that worked fine and didn’t worry about having to scale it up. Now that I’m approaching 30,000 puzzles, things were falling apart at the seams.
A database holds information about things – crosswords, constructors, clues, answers, etc. – and the database schema declares what those things look like, what their constraints are, and their relationships with other things. A crossword might have one or more authors. An author might have many crosswords. Answers and clues might have many different connections. Puzzles might be crosswords or they might be variety puzzles. And so on.
I’ve known for a long time that my schema had to be modernized but since the code always “worked”, I kept patching things together whenever problems cropped up. This is lazy coding, but I may not be the first programmer in history to fall into that trap.
I finally bit the legendary bullet and designed a new schema that I knew would be faster, more robust, easier to understand, easier to code against in the future, and able to handle much more data. I also knew that it would break almost all my previous code and would require a couple of long downtime stretches as I made the switch.
Starting from a clean data organizational slate also allowed me to clean up several other earlier design decisions I had come to regret. Here’s just one example: I used to separate lists of clues with a tilde or a vertical bar delimiter. But then I started to encounter some clues with vertical bars, and even more with tildes. (Typography nerds will point out that the ~ symbol is actually a “similar to” symbol, not a tilde, but it’s close enough for crosswords.) I kept having to special-case those and other characters, and the added complexity slowed down the code and invited bugs in.
It all turned out to be a huge change affecting nearly every source file in the project, and I spent a couple of weeks tracking down fixes for everything I broke along the way. Well, everything I found that I broke – you’ll likely discover more problems. Please let me know when you do!
Photography
In other news, I’m proud of the photography on this site, and today’s featured image is one of my favorites.
It’s official, Jim–you are nominated for Crossword sainthood!