Fled the nest

This post is somewhat overdue since I’ve never been so busy. I don’t post much in the way of personal happenings on here but it’s not every month you move out of home.

It’s been a long time coming, and for years I swore to myself I’d always buy and never rent a property, but since no one really has any idea if house prices will keep going up or crash, I bit the bullet and moved into rented accommodation with a friend on March 1st!

It’s a nice feeling to have your own place, even if I don’t actually own it. Right now I can’t actually envisage getting the free time I had back. Hopefully in a month or two I’ll have sorted things out and got into some kind of routine.

I write this sitting on the floor at the end of my mattress while I wait for my new desk and bed to arrive (several weeks away, sigh).

I do have a couple of posts saved in drafts but I’ve spent more time washing up in recent weeks than I have on my PC. What time I do have I’m trying to spend revising for my Zend Certification which I’ve got to get around to taking, seeing as I paid for it last August!

Groovy is what it says on the tin

I can’t believe I never stumbled across this before; I’ve seen a few posts about Groovy on dzone.com previously and just ignored them. A couple of weeks ago however I bother to investigate this language - how I wish I’d done this earlier!

I recently bought the second edition of Agile Web Development with Rails, which is good and all but when I scour the net to see where Ruby is on the job front, it’s pretty bleak (at least in the UK if you don’t live in London).

Back to Groovy though; the first time I stumbled across some of the source I smiled - this is what I’ve been waiting for… I can see how the reduction in syntax could make purists turn red faced but from a productivity standpoint, not having to write such overly verbose code that is Java really appeals to me! (probably my nasty PHP habits)

It’s made Java fun again, dare I say it, it’s made Java groovy :) (please put down those tomatoes).

I think stumbling across Groovy now is no co-incidence, what with version 1.0 just out the door and numerous books making it to the shelves. Things went from good to great when I Googled around for some Grails tutorials - the amount that can be achieved in such a succinct amount of code was a breath of fresh air.

Working with PHP all day (not exactly a verbose language), Grails looked like a significant improvement in productivity. Perhaps it’s the pedigree of the developers that have forged Groovy and Grails - PHP has always suffered from it’s low barrier to entry - Grails looks well designed and time will confirm this for me.

I’ve ordered Groovy in Action, and PHP in Action just for the hell of it (I saw Marcus Baker (who ran the PHP London user group until Mar 2007) in the authors list and thought this has to be a decent read since I’ve seen him speak nothing but sense on SitePoint’s PHP Application Design forum).

I’m not the only one who’s enthused… hopefully given Groovy’s heritage and the volume of Java programmers that can make an easy switch; commercial acceptance may be faster than that of Ruby, or at least taken more seriously/readily by big(ger) business.

Prototype’s Array Extensions

I had cause to use script.aculo.us at work today, which depends on the Prototype framework. I’ve used Prototype previously (in fact on this very blog!). However, when I dropped script.aculo.us in on the site I was working on, all hell broke loose with my JavaScript breadcrumbs.

I was dynamically populating two arrays via PHP, one for the page captions and the other for the page URLs, JavaScript was then used to combine these arrays by way of Array.push() and Array.join(). After a few minutes debugging I realised Prototype was the culprit, spewing out a wad of JavaScript source all over the page header (innuendo not intended!).

A few more minutes Googling and I’d discovered it was Prototype’s Array extensions at work that had broken things. As explained by David Bergman iterating over an Array using a for (i in array) reveals the extensions added to Array class.

The author of Prototype (being a “Rubyan”) added these extension to bring JavaScript a little closer to home for the rest of the Ruby community. Converting my for to Array.each() remedied the problem - worth noting for future reference and hopefully this will save someone else 10 - 15 minutes head scratching. Thanks to David for his fine explanation and solution to the problem!

No wonder…

Celebrities don’t look as good in person.

Long time no update

I am still alive but am in the process of revamping this blog (a bit).