Why I became a programmer

Yesterday was not a good day. The reasons (plural) aren’t really important for the sake of this discussion. But at 7pm, with the day behind me, and an hour and a half before my wife   was scheduled to get home from yoga, I switched over to my emacs window, and started going after a problem I’ve been poking at for 2 weeks.

The problem, which had nothing to do with my day job, was how to seemlessly add some javascript to date forms in Drupal to make them more magically. The date forms in Drupal are honestly quite dumb. You get presented with From and To, Date and Time. They are initialized to “now”. But they are 4 fields, unlinked by code. This was the easy way for the developer to write it, but absolutely frustrating for the user. Especially if you’ve used systems where the To dates move forward in time to match changes in the From dates. Set From to Jan 24th, and the To date shouldn’t still be Jan 11th. Making it also move to Jan 24th might not always be right, but it’s almost always more right than leaving it unchanged.

I had figured out how to do this with jquery, with these fields, and have a solution for one of my sites. But this is something that would make a great Drupal module. One that requires no configuration, and just makes your user’s experience better. How to get there, required banging my head a lot on internals, reading a lot of code that I thought might be examples, and not getting anywhere. Last night, frustrated with things that weren’t this problem, I went after it again, this time by brute force. After about 45 minutes of trial and error, I found a hook I could use to patch myself into the execution stream at the right point. Better yet, it seemed like this was probably the right way to do it, not some dodgey hack. By the time Susan got home, I had the shell of this module mostly working. Not releasable yet, but the minimum viable piece was now done, and the rest was about cleaning up for release.

I felt better.

There is a longer story here about how I entered College to be a PhD Physicist, and I exited to do web development for the Sydney Olympics. But the key take away was a realization, late in my Junior year, that when I wanted to relax, I went off and coded something. While I could never point to the day it started happening, I do vaguely remember realizing that my happy place, my retreat from the stress of the world, was deep inside an emacs session for hours at a time.

The fact that the thing that relaxes me, writing software, also happens to be a key piece of a quite profitable profession[1], made me a fortunate individual. Having gone to college and watched the modern internet emerge, which is an even longer story, made me doubly so.

The best piece of advice I ever got was from my friend and mentor, Eric, in college. “The key to happiness is to figure out what you’d do anyway; then find a way to get paid to do it.” Even if this wasn’t my job, I’d be writing software. It’s what relaxes me.

What relaxes you? What would you do if money was no object? Why did you become whatever you call your profession? Drop a comment below, because I’m actually quite interested.

[1] Yes, I’ve been long enough in the Software Engineering space to know programming is a small part of it (especially at a large company), but it’s still a very important part.

 

2 thoughts on “Why I became a programmer”

  1. I just wish I could always be writing software without deadlines… just let my mind take me wherever it may. From link to link, book to  book, repository to repository, without having that nagging feeling that I “should” be working on something else. I’m trying to get that as an independent developer, and after a few tough lessons, I’m getting better at controlling my workload and making a paycheck… But still, I wish it could always be so blissful.

    BTW, when I was faced with a similar date input form, I wrote my own JavaScript Date class. Instances of this date class could be compared to one another with .greaterThan and .lessThan methods, and also a .diff method which would return a custom TimeDelta class instance. Form inputs could then be coordinated much easier with a nice little DSL of sorts.

    Like

    1. My experiences have been that some times I just need to let myself write the code I want to write, because the quickest way to get my brain back on the tasks I should be doing, is often to let it dump out the code the idea that keeps distracting me.

      On the actual date parsing I’m now using datejs (http://www.datejs.com/), which has the added benefit of having more ninja than other approaches I’ve seen. The code, so far, is up here – https://github.com/sdague/smart_dates

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s