Rohit's Realm

// rohitsrealm.com / archive / 2008 / 02 / 13 / a-programmers-achilles-heel

February 13, 2008

A Programmer's Achilles' Heel

With all this recent talk about politics and social welfare, complacent readers may have been lulled into believing that the sun had (finally) set on mind-numbingly arcane entries laden with techno-babble that only my equally geeky homies from my days at Cal could enjoy (or understand)—and which pervaded this blog in its earlier years. Yet, nothing could be further from the truth: I am, first and foremost, a colossal computer nerd. And consistent with this blog's theme of highlighting its author's soul-crushing failures (both with women, and in life in general), today I will discuss my greatest failing as a programmer, or in other words, my proverbial Achilles' heel.

As any programmer worth her salt could tell you, every code monkey on this planet, no matter how good (or how bad) suffers from at least one weak point—one topic or concept which, no matter how hard she tries, she cannot master and likewise cannot avoid. Achilles had his heel, Duryodhana (of Mahabharata fame) his thigh, and Superman his kryptonite; programmers of all stripes and colors have their own personal demons as well. For many, the Achilles' heel tends to manifest itself in errors in pointer arithmetic (leading to crippling buffer overflows, and the like); for many others, it is memory leaks (i.e., forgetting to deallocate memory) that leads to massive hits in performance. As for me, pointers never caused me grief, and my obsessive nature ensured I rarely forgot to deallocate memory; instead, date arithmetic (specifically with respect to time zones) is where I fall from grace.

This weakness was on ready display over the past few months, when without much thought, I flipped the time zone on the server hosting my site to Central Daylight/Standard (CST6CDT). Unbeknownst to me, however, this action also caused all the publishing times for every entry to jump forward two hours (instead of carrying a -0700 or -0800 offset, they now had -0500 or -0600 offsets). Anyone see the problem yet?

No? Well, let me tell you: the upshot of this was that any entry that was written between 22:00 and 00:00 Pacific Daylight/Standard time was suddenly propelled forward a day. And when your permalink archives are based on date—specifically day—a jump like that can wreak havoc.

I first noticed this problem when I wrote my last entry. In that case, I had copied the URL of an old entry from another old entry, but when I clicked on it, I got an error. I dismissed this as perhaps just a broken link in the entry I copied it from and thought no further of it. However, when I went today to read my manifestos about Valentine's Day, I realized that this was no normal error. The entry from 2005 did not work; it was now appearing on February 15th (and thus a different URL), having been originally published at 22:29 PST (i.e., 00:29 CST). After some research, I realized that this bug was affecting a nontrivial number of my entries (I guess I enjoy posting between 10 p.m. and midnight), and there was no quick fix.

So, it is with a heavy heart and my head hung slightly in shame, that I must announce that though I now reside in Chicago (what what Midwest!), Rohit's Realm has returned to, and will remain in, the (glorious) Pacific time zone. Guess what they say is true: you can take a Californian out of California, but you cannot take the California out of his blog.1

^ 1 Actually, no one says this. But people should, because it's very true.

Comments

Computers again? Why?

This is pathetic, you're citing "date arithmetic" as your programming weakness? That's just like saying your major flaw is that you work too hard. You might as well say your major programming weakness is that you don't touch type.

Hey! You forgot Jim's awesome blag!

PS. Your "uri detector" doesn't consider "http://linkstew.org/" a valid URI. Hint: don't get me started on wwwsumptions. ;-)

Katie, it's because computers are awesome (and you are not).

Winston, date arithmetic is a big deal! Many a program has failed catastrophically because of errors in date arithmetic. Y2K! Y2K!

Benjy, I didn't even know Jim had a blag, let alone an awesome one. Entry has been so updated.

And goddammit, I just cannot seem to get the URI regex to work right. Why it would take http://rohitsrealm.com/ but not http://linkstew.org/ is mystifying. Guess I have more than one Achilles' heel when it comes to programming . . .

Don't forget about Y2K38 (though most systems should no longer be affected).

The Achilles' heel I've been fighting recently is my assumption that hardware is always correct. I work with embedded systems, and I hate debugging hardware. So I love to pretend that hardware is always correct, which has bitten me hard several times.

Welcome back to the West Coast, also known as the best coast. Also, I got a new TLD. My site's now at http://chrisstreeter.com/

Rohit, I discovered your blog via the interweb, and I have to tell you... I love your writing! Your posts on Valentine's Day were so refreshing!

Hopefully you stayed true to your pledge in '07, and didn't end up spending crazy amounts of money tonight to prove your love to your girlfriend.

Keep up the good work!

~ Ashley

"You can check in any time you like, but you can never leave!"
- The Eagles, Hotel California

You should have known Rohit, you should have known.

Add Comment


 


 


 


 


* required field

E-mail addresses will never be displayed. The following HTML tags are allowed:
a abbr acronym address big blockquote br cite del em li ol p pre q small strong sub sup ul