Saturday, September 26, 2009

Make a Difference?

I hardly ever believe that one person can make a difference in the world... but when enough people get together...

I've written Harper, Ignatieff, Clement, and my local MP and signed this petition: http://www.competitivebroadband.com/make-a-difference.aspx

If, like me, you want to see the continued presence of competitive services in the ISP market, I suggest you consider doing the same.

Saturday, September 5, 2009

TDD vs ADD

So first off let me be very clear. I don't actually have ADD or ADHD (as far as I know). But sometimes I feel like I do have the attention span of a chipmunk. God knows that between email/teh interwbs/chat/multiple projects/client requests/friends/family/hardware issues/politics/natural disasters and upcoming weather it's pretty easy to get distracted these days.

For a programmer, getting distracted is bad, bad like "that's baaa-aaaad umkay?", bad like crossing the streams bad, bad, bad, and bad. Distraction == mistakes. Distraction means lost time. Distraction means doing things over because you did something subtly stupid that looked okay on the first glance but contained a really boneheaded bug buried deep inside it. I hate getting distracted. I would really rather work in focused, multi-hour blocks. A block for work, a small block for lunch and exercise, another block of work, a block of family time, and a double block of sleep. Of course, it rarely works that way.

A big part of the reason that I left my last job was distraction. I had six to eight meetings a week, I was getting 20 to 40 emails requiring a response every day (outside of spam and automated messages), and I had to investigate and respond to a couple of customer inquiries every day, all while being expected to design and implement fairly complex software. After the nth month of little progress and lots of frustration I realized it wasn't working out and moved on. I need to feel effective to be comfortable with my work, and to be effective, I need to be able to concentrate on a task for more than 5 minutes without interruption.

One of my favourite techniques is to fight distraction with distraction, that is, I find that while I'm working on something, particularly code, my mind sometimes wanders and sometimes the wandering track takes over. The best way to keep on track is to control the wandering, and for me, what works is music. Particularly music with a regular repetitive beat and few to no lyrics. Helllllloooooooo techno. DnB works too. Trance can get distracting, depends on the set.

Anyways... music doesn't always work. Sometimes you just have to get up. That trip to the bathroom can only wait so long, it doesn't matter how close to fixing that bug in your stream class you are, sometimes you have to get up. Or the phone rings. Or the client wants a status update. Or whatever. When that inevitable interruption does happens, the key to getting back into the groove (for me) is to have a clear entry point, and that's what I love about Test Driven Development (TDD). When I get back to my desk, whether I've been away for five minutes or a week, the first thing I do is run my test suite. Whatever test fails is what I'm going to look at first.

If I'm going to be away for a longer period, like overnight or more, I make sure to craft my next test before I depart, that way, the feature I should be working on is right there waiting for me to finish it when I get back. It's repeatable, it's reliable, and it draws me in mentally, even when I'm tired, frustrated and under-caffeinated. I know this isn't really the goal of TDD, it's just a fringe benefit and it really works for me.

Saturday, August 15, 2009

Off Topic: Political Double-speak

Look, I expect politicians to lie. And I expect them to contradict themselves. And quite frankly, I consider the abilities to change your mind, recognize mistakes, and consider contradictory notions to be signs of intelligence. But I have very little respect for people who contradict themselves from one sentance to the next.

Regarding the Canadian woman detained in Kenya and charged (and subesquently cleared) of identity fraud, Liberal leader Michael Ignatieff is being quoted saying: "Canadian citizenship is indivisible. [She] is a citizen in good standing and she should never have to prove her citizenship with a DNA test."

Iggy, Iggy, Iggy... if citizenship is indivisible, then how are you distinguishing between citizens in "good standing" and otherwise? I'm sure what you meant to say was "Canadian citizenship is indivisible, she should never have to prove her citizenship with a DNA test." ... because we certainly wouldn't want to raise questions about what makes a "citizen in good standing", eh? Maybe "bad citizens" could write books about their true patriot love to gain "citizenship points" and become "good citizens" again? Okay... I took it too far.

This story gave me a chill. I once travelled overseas for eight months, when I left I had a passport photo which showed my shaved head, a goatee, very pale skin, and made it pretty clear that my weight was hovering just under 240 lbs. When I came back I was clean shaven on my face, sported a "normal" 3 or 4 inches of hair, was tanned, and had dropped to a much healthier 180 lbs. I was pulled out of line at Charles de Gaulle airport in Paris and grilled by... well, I don't know who. They had maple leaf lapel pins and their accent was more Quebecois than Parisienne. They never identified themselves, but they let me board the flight and come home after some questions and pouring over every piece of ID in my wallet. I have to wonder, if under the same circumstances I, a white male with an anglo-saxon name, would have had the same treatment as Ms. Suaad Hagi Mohamud got from Canadian consular officials.

Dang... did I take it too far again?