Or: Slow Down to Speed Up
When it comes to programming languages, I haven’t lived in the same place for more than a few years. This is good, fun, and keeps me sharp. But I means I’ve never *really* mastered any particular language.
So, when I code, I tend to write it like an author writing prose. That is, I rewrite my draft a couple of times. After the code (including tests, though not usually 100% TDD) is written, I go over it, looking at the `git diff` and looking at the entire files with an understanding of the full program in my head. I’m generally doing two things as I go over it:
One: Critical Analysis
Does the code do what it should, and do my tests fully express the purpose of the code? They don’t have to test every line and detail, but one should be able to re-write my code from scratch by looking at just the tests.
Can the code be more verbose, less verbose, faster, easier to read or more consistent? There are only three tough problems in computer science (naming variables and off by one errors); I check for those, too.
Two: What Can I Learn?
I can generally accomplish everything I need with techniques I already know. But that’s no fun and it doesn’t make me a better engineer/hacker/person. So I try to find code (either the stuff I’ve just written or stuff related to it) that can be implemented with a new technique.
Maybe I can learn more of Ruby’s meta-programming and create an extension (that will probably help me in the future). Maybe I want to learn how to drop some C code into my Ruby and make this critical path super quick. Whatever it is, it should be something I haven’t done before that challenges my knowledge of the language (ps. open source is a great place to find inspiration). Sometimes I just question the status quo.
—
It’s easy to solve a problem, crank out some good code, and call it. But that’s sub-optimal. The moral/trick is that efficiency is not always about solving problems quickly and correctly. Over the long haul, you need to be continuously improving to reach maximum efficiency. Hopefully I can remember that.

We’ve built Shelby with a distributed architecture (the subject of another post) with a highly parallelized social stream processing infrastructure (another post as well). To accomplish this we’re using the 



