Little Black Boxes

The refactoring of Ficlatte has begun. I don’t expect this to mean anything to any of you, not even the ones who frequent the site on a regular basis. The work I’m doing right now is 100% completely behind the scenes, hidden by the large curtains that lead to the cold and drafty back rooms of the castle. Let me just put it this way — if I do my job correctly, no one will notice that I’ve even done a thing.

And that’s as it should be. But despite the fact that no one will see the changes, they are necessary ones to make. Right now, it’s a fair comparison to say that all the code that runs Ficlatte, if it was poured into a large, black box, would look like a messy tangle of colored wires looping in and around each other, making snarls here and there, and generally just looking like an entire troop of monkeys got in there and started mucking around with things.

And it gets worse every time one of us on the development team adds a new feature or tweaks a little bit of code. We just keep adding new wires to the box that link existing things together in new and interesting ways and other wires that do new things they’ve never done before. Looking at it right now, for example, you’d probably see a bunch of blue wires in there. Those go to all the authors and users who come to the site. The white wires link to all the stories and interconnect a fair few of them together in long chains of storytelling logic. The green wires are the prompts, there to spark new and creative ideas. And the red wires — well, those are the dangerous ones. You don’t want to go playing with those. No, sir. They lead to the challenges, where some of the heaviest lifting gets done. And somewhere in that tangled mess are these little copper wires. They looks haphazard and random, but they’re really not. They connect some of the most important bits of logic together that keep the site running smoothly. Pull any one of them, and the whole thing comes to a screeching halt. Probably with flames. And smoke.

All that to say, someone has to sort this mess out. The more things we add, the worse the mess gets and the harder it is to maintain. So I’m working on a little project called refactoring, where I take this large, black box of tangled wires and carefully pull it apart — without breaking anything, mind you — and tear it down into several smaller black boxes that are all connected together. The blue wires go into their own box, and I write something like ‘Authors’ or ‘Profiles’ in white Sharpie on the lid. The white wires go into a different box, which gets its own appropriate label. The same goes for the green wires and the red wires. And when I’m all done I should have a separate box for each modular function where the wires inside are all neatly patched together and organized and easy to see where they go and what they do. The copper wires stay in the central box, of course. That’s the beating heart of the whole thing. And all these newer, smaller boxes have new wires that lead back to the primary box, as well, because everything still has to be able to talk to each other. But what that leaves me with is a system that’s clean, neat, and tidy, easier to maintain if something does break, and even easier to add on to as we develop new features for the site.

Fortunately, it’s not overly difficult work. It’s just a matter of doing it, and as I said earlier, I’ve already started on it. In a day or two, the whole refactoring process will be complete and no one but myself and the other two developers on the team will even know I’ve been in here working. But I’m excited about it, because we have some really neat new things planned for Ficlatte, and this refactoring process is going to make it so much easier to implement those features. Some of them are even done already; they just haven’t quite made it down the pipe to the site yet. (And frankly they’re part of the reason why this whole refactoring is even necessary in the first place; we kinda made a little bit of a mess back in these cold, drafty rooms, so now we have to clean up after ourselves a little).

Stay tuned, folks. I love the work we’ve done already for Ficlatte, and I’m excited about what else we have planned. And if you haven’t checked out Ficlatte yet, this is a great time to do so. It looks a little drab and grey around the castle yet, but the interior decorators have already been hard at work to give the place a little more color, I assure you. And it’s a great place to meet some great folks who love words and for you to practice your use of words, as well.

Have anything to add to the conversation?