Oh sunny day

I couldn’t help but notice what a nice day today has been – both on the way to work this morning and on my way home now.

In all seriousness, I can’t remember the last time I cared to even look out the windows on my daily commutes. Either because the weather has been spectacularly unspectacular, or I’ve just been too distracted to notice.

Work has cleared up quite a bit thanks to the rockstar of a team that I have the privilege of tagging along with. The past two weeks have a shit storm of block-out-the-sun proportions,  but we fought hard and we fought on in the shade.

While there is still carnage to be mopped up, the fight is over for now.

It will work till infinity

It was friday evening. I was on the train back from work. My phone rang – colleague.

“Dude, is your migration script supposed to run?”

“Er, yes…”

“What were you trying to.. mumble mumble.. cryptic.. mumble.. infinite loop.. mumble.. never going to stop running”

“Erm, okay…”

“I’m putting this on thedailywtf.com

In programming, loops are used to make a computer perform a tasks over and over again. Usually it is something straightforward like:

“Perform this series of instructions 5 times”

Sometimes it has slightly more dynamic conditionals such as:

“As long as there are words in the list, pop a word off and email it to John”

In the second example, if someone or something else is constantly adding words onto the list, or if for some erroneous reason the program puts the word back into the list after emailling it to John, the program will never stop running. That’s an infinite loop.

Infinite loops have their uses, but it’s more commonly the case where an infinite loop shows up as a result of a mediocre programmer’s incompetance, or a competant programmer’s attempting to code while fatigued, intoxicated or stoned.

I was in neither category at the time of coding – perhaps I was seeped a concoction of hurry and a mild lack of sleep. I even tested it on my machine and it ran just  fine.

Still on the train, I pulled up the code from our code repository and started going through each line – just to make sure – before I responded. I wasn’t offended that he’d called me out on my work. If you’ve done bad, you’ve done bad – everyone has a good laugh at how ridiculous it is, and we move on – lesson learned. I was more concerned that something like that had slipped through.

The code looked fine. The only thing that looked remotely alarming was the fact that I was terminating the script early – a typical diagnostic step that I had forgotten to remove before checking the code in. So, thinking that I’d picked the issue, I texted back:

“shit, it looks stupid. but does it work?”

“it will work till infinity”

“but the doodads will run out and the loop will terminate, no?”

“no because the count does not run out”

“nah there is more wtf there. show you monday. have a good weekend”

Good weekend my bleep.

Late that evening, I pulled up the code on my phone to check it before going to bed.

Saturday morning, I checked.

Sunday, I couldn’t help pulling up the code once more just to see if I could figure out how an infinite loop could possibly materialize.

Monday, I rocked up at the office, fully prepared for a public ridicule.

Nothing. It wasn’t there.

The code was cryptic, I give them that, but there was no infinite loop. They were wading deep through stinking warm shit trying to get a live data migration going so fatigue ensued. The fact that my script terminated early without doing anything coupled with my less than palatable coding style set off a cascade of misjudgements that prevented them from actually running the script.

Not their fault. Migrating live data is a high-risk, time consuming and it saps every ounce of attention out of you for an extended period of time. The last thing you’d want to do is to risk running a cryptic infinite-loop-esque function that may cause the system to blow up.

So there. No thedailywtf.com for me this time, but all fun and games all around.

Throwing one out pt. 2

Serendipitously enough, the first Throwing one out was written the morning before the following incident.

We’d reached a point on the project at work where it felt like we were wading through thick mud and our architecture choice in SOA was biting us in the behind in every way possible. We were on the brink of implementing some serious monkey-patching to the system which smelled like a very significant design compromise.

Just after lunch, Dev Lead had an eureka moment – we were doing it all wrong. Data and computation were place much further apart than they needed to be! Which basically implicated a “throwing one out” event, and a complete rewrite.

Sure, it’s a lot of effort flushed down the drain, but one can’t overlook the fact that a rewrite with the benefit of a first implementation makes for a far more robust and well-designed end product. At least I’m feeling a lot more confident building it the second time round.

Cycling buddy of mine offered some sage words of advise with regards to bicycle ownership when I was first getting into cycling.

“Start with a cheap bike. Make every mistake possible on it, then upgrade.”

It’s nice, because of the emphasis on learning rather than getting it right the very first time. And it probably is relevant to far more than just bicycling.

The bigger you are

It had been a long week at work. End of sprint, we’d somehow managed to graft our contraption onto business’ operations without causing too much damage. It wasn’t without its hiccups but I’m led to believe that it was an overall win.

So I was looking forward to my usual 2.5km ride to the station, and my 40 odd minute journey in a metal can. Metro had other plans for me.

The train was stopped at the station – all the doors were opened, and people were emptying out the carriages and making their way to the bus stop.

There had been a train/car accident at Cheltenham station. The staff at the bus stop suggested I rode to the Moorabbin station since taking the bike on the bus would be a bit of a stretch. “You look like a good rider”, he said, probably referring to my very manly looking cycling tights.

So I tried to mirror the severe disappointment around me at Metro. Secretly, I was delighted at the opportunity to do something out of the norm. I powered up the GPS tracker on my phone and was on my way.

This, I had to capture – all 11km’s of it. It would make good conversation fodder for the weekend compared to my usual nerdy contributions.

Along the way, the road blocks set up by the police nearer to the scene of the accident hinted at the seriousness of the matter, but nothing prepared me for the swell at Moorabbin station.

Lots of other less fortunate people having a less than ideal start to their weekends. At that point, any sense of mine being predicament quickly vanished – I was having a ball by comparison.

These photos are a stark reminder of the fire that I play with on a daily basis. I engineer information systems for an high volume online retailer. Not quite the scale of a metropolitan train network, but analogous enough.

The fundamental goal of any large scale system is to harness the economics of scale to reduce waste and increase efficiency. But what many fail to understand is with any large-scale monolithic system, the stakes increase exponentially with the gains. Potential points of failure proliferate with every corner cut, and it only takes a few minute defects before the whole thing crumbles in a sorry heap.

Scale is a gallant champion, but makes for a horrendous and putrid failure.

Make Commodity Beautiful

I’ve noticed something perculiar in the way I’ve begun to use email ever since I switched to Fastmail in my recent mini IT infrastructure shakeup. Previously, I was quite content with Thunderbird hitting up an IMAP account off a cheap web hosting account, and didn’t think much about it.

The big switch came about when I was spending far more time on a work machine than my trusty Thinkpad. I wasn’t comfortable setting up a desktop email client at work, the web email interfaces on my hosting account was downright horrendous, and I wasn’t about to rely on the big G’s ad-funded service for my primary email needs.

So I decided to bite the bullet and pay for a Fastmail account. I’d used Fastmail way back when generous was 16mb’s of email storage, and fast was building your web interface with no images – just straight-up HTML. This was a second coming of sorts.

Every since I’ve started using Fastmail, I’ve even begun to prefer it over firing up Thunderbird on my desktop. Upon further reflection, I’ve been able to narrow it down to one reason – the interface.

The Fastmail web interface is not particularly exciting to look at. I’d say it’s even a little spartan compared to most post-web 2.0 outfits. But where it really sings is the way the whole interface is designed with the power user in mind. The clincher for me was the VIM-like key bindings. I could quickly navigate through my email, report spam, mark, delete and file emails all from my keyboard – no mouse required.

~snips nerdy gush-fest~

The point I’m trying to get at, is that email has largely become a commodified service. Although, I had the the pick of any desktop app, and a choice of 4 different webmail interfaces, I decided instead to paid good money for Fastmail’s web interface.

The more I look, the more I see commodities being bolstered and somewhat “resold” with a coat of thoughtfully applied interface. Programmers all over the world swear by GitHub. Mac OS X coats a BSD Mach kernel with a gratituous gobs of lickability. And, more recently, Sparrow and Fluent are in the market to repackage what is essentially a 26 year old protocol.

If you’re looking for a startup idea, pick a commodity software and make it beautiful. It is a significant, fixable unmet need that is just waiting pay out.

Open source software is particularly suited for this for two reasons. Firstly, you have full access to the source code, and secondly, they usually have a lot of room for improvement as far as UX goes.

Show this article some love on Hacker News.