Wednesday, July 7, 2010

hidden history

In software, we learn that many things that now look like horrible choices actually started as the reasonable solution to a problem. I don't want to give too much benefit of the doubt here: most programmers are idiots, and a lot of the time it's actually a bad choice. Those of us who do horrible things to software on purpose salve our wounded consciences by adding a useful comment with a bug number, so future generations can look up the story and not hate us. Then we drink until the pain goes away.

One of my favorite code stories is the Hardest Bug Of My Career, which of course happened at Danger. It took me about 2 months to figure out, spending 2-3 days a week on it. For those of you not in the trade, that's an absurd amount of time. Most bugs yield their secrets much more quickly, but this was important. A critical step in our Sidekick-data service communication, called the "Dropbox," would periodically fail with an out-of-memory error as my server tried to store it in the database. Fair enough, it was a 3MB XML document...but the server had 2GB of memory. Finally I traced it to how the XML parser would accumulate a block of text, which used a totally simple and reasonable approach, which given a 3MB block of text would use up all the memory and bring the machine to a screeching halt. The problem was with blocks of text in what's called Base64, which are defined to have newlines every 72 characters; in order to fix the problem, I had to remove those newlines, which is a crazy, screwy-looking thing to do. And then a few weeks later that broke our email delivery, and the email guy had to restore those newlines, which is also a crazy, screwy-looking thing to do. We commented our changes, a courtesy not often extended by our predecessors.

On a vaster scale, you can read Joel Spolsky's excellent classic, Why are the Microsoft Office file formats so complicated?.

I was reminded of all this because the professional soccer team, based in Valparaíso, in a Spanish-speaking country, is the "Santiago Wanderers." This makes absolutely no sense to me. The supposed history in Wikipedia tells me:
Despite its place of origin, the founders decided to name it Santiago to distinguish the club from another team in the city that existed at that time, the Valparaíso Wanderers. On several occasions, attempts were made to replace Santiago with Valparaíso as a way to ratify the link with the city. However, the idea has been highly rejected by the fans.
Okay, fair enough. Does that actually help? Now I want to know:
  1. Why didn't they call it "Puerto Wanderers" or something else still related to Valparaíso?
  2. Why is it "Wanderers"? In English? For multiple teams?
There's always just more questions.

1 comment:

  1. I am scared that I will someday have to deal with a bug like that Dropbox one, and that I will be totally and completely not up to the task.

    I hope I still have your phone number then.