20 Sep 11

Half Marathon Training diary - Story So Far

I’ll be running the Cardiff Half Marathon on 16 October, which is scarily already less than a month away. This reckless enterprise is in support of the Neonatal Unit at University Hospital of Wales, Cardiff, who cared for our son for the first three weeks of his life. It’s a good cause and you should seriously consider <a href=”http://www.justgiving.com/smugpie/”>donating</a>.

I started training in July. That first run - if you can call it that - was quite dispiriting. A 4k run out of the village and back. The slight incline out of the village proved too much, and I partly walked it with disappointment in every step.

But that was an easy hurdle to overcome, and I’ve been gradually increasing my distance and speed. Last Sunday I ran the Cardiff 10k in a personal best time of 1:02:29 and I was overjoyed.

I’ve now lost 9lbs in the last month and hope to lose a few more pounds in the coming weeks.

Now that Autumn has arrived with a vengeance it’s harder to step out of the front door, but the lure of faster times is quite addictive. I’ll be out for a 12k run tonight - a reasonably flat run to Barry and back - so this will be the biggest test so far.

25 Nov 10

Oh dear.

I have a lot of respect for those of you who work full time, have a young child AND can blog in their spare time. As you can see, my last entry was a very long time ago. Life has changed so much in the intervening time, undoubtedly for the better.

However I did manage to eke out just enough time to write an iPhone app. Look out for NumberRace in the App Store soon!

17 Jun 09

The time is nearly upon us.

Our first child is due to arrive in less than a week.  It’s a very scary but exciting prospect, knowing that our routines and our lives will alter significantly, but not quite knowing the exact moment when.

I hope that I won’t have “embarrassing dad” syndrome.  I just have a mental image of myself in ten years’ time complaining of my child’s taste in music, forcing them to sit down while I put on the CD of Jeff Wayne’s Musical Version of War of the Worlds.

16 May 09

When software becomes mainstream.

I’ve taken the plunge and decided to install WordPress for a personal project. I was hoping to use some of the blog-esque plugins found in ModX, but it quickly became apparent that the limited functionality and clunky implementation couldn’t hold a candle to WordPress.

When exploring blog options, WordPress was the one that came instantly to mind. It’s always interesting to see how one piece of software or website achieves critical mass, breaks through from its competitors and becomes mainstream. It happened recently with the jQuery JavaScript framework; suddenly ColdFusion developers started waxing lyrical about jQuery in their blogs.

I suspect the real driver towards mainstream usage is what might be termed “deceptive simplicity” - giving users the bare minimum of features to start with, hiding the complicated stuff under the hood. jQuery will let you do cool stuff with some pretty easy syntax. WordPress will get you up and running in five minutes, but start exploring and you’ll find a wealth of features. And look at iTunes - a clear interface that somehow does all you need it to. User experience, then, may be thought of as a lower priority than functionality, but it may prove to be the difference between a runaway success and another also-ran piece of software.

06 Mar 09

Hope you like our new direction.

andrewgraham.co.uk has a shiny new look. The front page is collated from several social networking sites, thus giving the impression of being updated frequently without having to lift a finger on my part.

There’ll be some general tidying up over the next few weeks - be patient while everything is rehoused.

11 Feb 09

In common with much of the blogosphere, I’ve started to dislike Internet Explorer 6 enormously.

Well, ‘hate’ is such a strong word.  In work I’ve been developing a web-based system of collating Fire Risk Assessments for NHS Wales, and I’ve suddenly found myself more than ever coming across the limitations of IE6.  We can’t ditch support for it - some of our corporate applications still rely on IE6 - so don’t even think about exhorting us to update our browsers.  We simply can’t.

Anyway I wondered why IE6 was causing me grief this time around.  And then it hit me.  Firebug.  The Firefox extension makes developing such a breeze, especially for Ajax applications, that I barely take a look at IE during the development process.  And then instantly regret it when my carefully crafted web page becomes a garbled mess.

So, Firebug, I reckon you can take much of the credit for the clamour to ditch IE6.

30 Oct 08
‘Me and my grandad are both really happy because it could have damaged our reputation permanently,’ said the 23-year-old Satanic Sluts dancer.
— Metro article on the Brand/Ross controversy, 30 October 2008
16 Oct 08

Object Oriented Programming is starting to make sense.

Don’t get me wrong, I’ve been familiar with the principles of OOP for a while, through initial forays into the world of Java as well as working briefly on ASP.NET projects. I’ve read so many times those simplistic examples of inheritance, where a Dog is a subclass of an Animal and a Car is a subclass of a Vehicle, and it all seems logical enough. 

All these nicely defined object oriented principles seemed to be irrelevant, however, when I decided to apply them to a pet project of mine at work: the rewrite of the collection of NHS Wales’s generic sites.

I thought that using OOP in a language I’m familiar with, ColdFusion, would help to consolidate my knowledge, but thanks to my ad hoc way of working, and hampered by my procedural programming habits, the code soon turned into a weird mess of interrelated connections. Objects were passed back and forth willy-nilly and copies of the same variable were being stored in a number of scopes and objects.

It just didn’t “feel” right.  It may be strange for the non-programmer to talk of “elegant”, or “ugly” code, but ugly is what grew in front of me as I tapped away at the keyboard.  What’s more, I was beginning to think that a simple website, delivering one database-driven page at a time, wasn’t really a prime candidate for the object oriented approach.  Hello Mr Sledgehammer, meet Mr Nut.

I’d originally built a Page object, which generates and stores the constituent elements of a page (the navigation, search box, sidebars and the like) for later rendering.  The Page object also invoked a component in a cfc somewhere to build the main content of a page.  The component depended on the page type - a news item would get content from news.cfc, a sitemap from sitemap.cfc, and so on.  However, to access the methods and properties of the Page object, I needed to pass the entire Page object as an argument to the component - pretty nasty!

Then, an epiphany. A news item is a particular type of page. So is a sitemap. It’s inheritance!  I knew all about it, I’ve read about it so many times, why didn’t it occur to me before that I should use it?  A NewsPage is a subclass of a Page in exactly the same way as a Dog is a subclass of an Animal. A short time rewriting made everything more elegant.

For me, then, it was all very well learning about OOP but it’s hard to shake the habits of procedural programming.  I knew about it, but didn’t quite “get” how to apply it.  That knowledge begins to coalesce with practical experience, like trying the pieces of a jigsaw in various configurations before they start to fit.

I can now even see how interfaces, another initial stumbling block for me, can be useful in ensuring that new page types conform to a certain set of standards.  It’s a strange feeling - finally it all makes some kind of sense.

03 Oct 08

I am now a registered iPhone developer.

I’ve already got my first application up and running. It displays “hello, world” on a green background. I think it’s going to set the world on fire!

24 Sep 08

Paradoxically, new technology has helped me discover classic literature.

My iPhone and I are pretty inseperable much of the time.  Its sleek, simple interface just compels you to pick it up and waste time exploring its various functions.  Perhaps that explains the App Store’s popularity - that, and the fact that people are willing to buy applications when the price is right.

Two applications in particular, have enriched my life in the short time they’ve been installed. The first is Air Sharing, which turns a iPhone into a wireless drive for storing and viewing documents. The second is Stanza, a free e-book reader with access to a wealth of older titles.  Up until now my choice of literature was limited to books whose age is less than mine, but I’ve just started reading The Picture of Dorian Gray and have become hooked; Wilde’s prose reveals more universal truths in its first few pages than you’ll find in a million blogs.