Archive for May, 2006

The “strangely compelling” pile

Monday, May 29th, 2006

I let things pile up in my study. The piles usually have themes, but sometimes one pile is more miscellaneous than others. After many years of doing a periodic stop, cull, discard, file cycle, stuff in some piles would remain, forming sedimentary layers of future piles. Certain things never seemed to end up discarded or filed.

As I was going through another round of culling, I starting pondering one particular pile. The things in it–an old Demotivators calendar, several articles, some newspaper clippings, a few pictures–had survived several rounds of culling. They didn’t seem to fall into existing categories, and resisted attempts to figure out new categories. I was about to punt, and pass on to the next pile.

Then it hit me. The stuff in this pile, and the stuff at the bottom of a few other piles, was “strangely compelling”. That was it. No need to classify the stuff any further, no need to psychoanalyze. I labeled a clear plastic container “Strangely Compelling” and voila!, a bunch of random stuff had a home, and I could stop beating myself up about being unable to file everything in an orderly way. And with the “strangely compelling” filter, the non-compelling stuff that was mixed in fell right out.

Things you don’t expect to see in airports

Saturday, May 20th, 2006

When you see flames inside an airport, the normal reaction is to run like hell. You might even have a moment of rational thought, such as, “Oh well, I guess I won’t be making that flight. Perhaps I’d better call ahead and let them know, then see about rescheduling, now RUUUUUUN!”

So, I’m sitting at the gate waiting for a flight, and I look up from the newspaper and see flames.

There follows a brief moment of incongruity, as I notice both flames and the people walking by paying no attention to them. Life in the airport goes on as normal. It takes a second to realize that I’m looking across the concourse into the open oven at the California Pizza Kitchen. Where, for whatever reason, they’re cooking pizzas at 10 AM.

Hiding among the ThinkPads

Tuesday, May 16th, 2006

Show of hands. Who else looked at pictures of Apple’s new 13″ MacBook and thought “ThinkPad”?

When it’s time to replace the current laptop, I’m seriously considering making the switch to a MacBook. It comes down to startup time. When inspiration strikes, I want to be able to type within seconds. With the current laptop, a Dell 600m that is othewise reliable, startup time from sleep is between 15 and two minutes, depending on whether the bloody thing decides to wake up. The frustration of waiting for a reboot to start writing or coding is a killer.

I’m using a PowerBook at work. Open the lid, wait a moment, and type. That’s what I like.

Date bloat

Friday, May 12th, 2006

If you want to find performance hot-spots in a legacy codebase, a good place to look is where time is being manipulated. Converting a string representation of a date into a number (say, of epoch days or seconds) is surprisingly expensive. I once profiled a system and found that 30% of runtime went to pulling dates out of a database, converting them to strings, then to numbers, and then back to strings for display. Some judicious caching and a smarter conversion shaved that down to less than 5%. The time hit can be worse if the system uses some general purpose date conversion package that supports a number of formats. You may be using a single format, but you’re paying a performance hit for generality. After all, customer might want to type “next friday at 5pm” instead of having to reach for a calendar.

If performance isn’t an issue, there may still be a refactoring opportunity (i.e., code bloat). There’s something about time that seems to deaden the senses, causing otherwise thoughtful developers to write a “how many minutes ago was midnight” calculation without noticing that it’s already done in four other places. In the Java world, the problem was compounded when the Calendar class arrived, giving developers an even bigger bag of tools for determining how many hours until 8 AM next Monday.

Arguing with Authors

Thursday, May 4th, 2006

If you find yourself in a heated, public argument with an author, pointing out that they’re now contradicting what they once wrote (right there! on page 147!) might feel temporarily satisfying, but it’s not the way to win an argument, especially if they’re not basing their current argument on that piece of writing. Bringing it up now makes you both look bad, and doesn’t exactly do wonders for your working relationship.

I did it when I was much younger. Seeing someone use the same tactic the other day touched some scar tissue that I’d forgetten about.

Stick to the here-and-now when arguing with authors, unless they bring a piece of past work into the argument. Then they’re fair game. But if they don’t, and if you must, sending a tactful, private email pointing out how they’re contradicting what they wrote is a way of protecting whatever relationship you have with them.