Archive for August, 2008

Some rather opinionated plugins

Saturday, August 30th, 2008

Update: The belongs_to patch has now made it into core Rails. Thanks to Jon for persevering with it where I threw in the towel, and to Koz and Pratik for giving it their attention. I’m still not entirely convinced that going through the conventional channels (as opposed to “whinging on a blog”) would have yielded the crucial feedback to get the patch in a state where it could be accepted, but all’s well that ends well…

A shark, being jumped, yesterday.Take this as the rantings of a pissed-off curmudgeon who’s had his second core patch rejected if you will, but it’s my sad duty to report that Rails has jumped the shark. It happened when it stopped being a framework and started being a collection of opinions instead.

You see, in my book a framework is something that’s meant to make programmers work more effectively – not to lecture them about what they’re doing wrong. Lecturing can be a good thing, as long as it ultimately results in better code – I’ll happily admit that following the Rails learning curve has taught me an awful lot about good programming practices. More and more though, I’m finding it being used to justify just plain broken features: If it doesn’t work, it’s your fault for not doing it the right way. Take this bit of profoundly broken behaviour:

let’s say we have a Company model, which belongs_to :city

>> torchbox = Company.find_by_name('Torchbox')
=> #<Company id: 1, name: "Torchbox", city_id: 1>
=> #<City id: 1, name: "London">

Aha, we’ve got the city wrong. Let’s reassign a bundle of attributes then, like we would if we were doing this through a web form:

>> torchbox.attributes = {:name => 'Torchbox', :city_id => 2}
=> {:name => 'Torchbox', :city_id => 2}

Right, so now we should retrieve the correct one.

=> #<City id: 1, name: "London">

Er, oops.


Sunday, August 3rd, 2008

When I’m writing Speccy music, I’m always very conscious of stereotyping myself. At the Forever party, they gave up on anonymising music competition entries after realising that everyone in the room recognised the Gasman entry (and the Yerzmyey entry, the Factor6 entry…) within two seconds of it starting up – even if I’d gone to great lengths to reinvent myself.

This time, with two or three days left before Assembly and nothing to show, I decided to make it easy on myself, and stick with what I know – the primal boop-durr-tish-durr bassline, the crowd-pleasing echoing cascades – and not be too bothered about basking in my signature style. As a result, it’s not the most original piece of music I’ve ever written, but it did its job – it made first place in the Extreme Music competition where it was up against PC soft-synths in addition to the now familiar Commodores and Nintendos.

The title isn’t a bid to stir up controversy with drug references, by the way. I just liked the combination of words.

Download gasman_-_spacecake.mp3