Objects: simplicity itself

Posted at 21:38:00 on Fri, May 05th 2006 by graham
in: programming

Another techy post, I'm afraid. I'll get back to the writing / ranting / mumbling ones in a bit. Promise.

A nicely productive and generally un-frustrating day as far as Das Projekt is concerned, though if Eclipse crashes one more time when I try to update it I might just start getting a mite ornery.

Managed to get a couple of niggling bugs nailed down this morning, including an annoying database issue that turned out to be caused by two libraries using two different database APIs but the same basic SQL statements, with the upshot being that one knew what to do with the SQL whilst the other just shrugged its shoulders and washed its hands of the matter. The trouble was that the second library was only being called on a sporadic basis, making the bug that much harder to track down.

Now that I've got the big things done, at least in outline (for example, one of the Big Things is a scheduler that sends out SMSes on, er, schedule. It doesn't actually do that yet, it just pretends to, but it's just a case of uncommenting a line of code and we're away) I can just go through the list of required features, code them and then tick them off. Hopefully that won't take too long.

One of the happy consequences of my doing this work is that I've produced a lot of very re-usable code. Part of the spec for Das Projekt was that its original creators had meant for it to become an all-purpose platform that could be sold to all and sundry. Unfortunately, due to time restrictions that hasn't happened, but I've tried to write my code in a way that will make it very flexible when they do come to produce something that they can sell.

It's one of those situations where my own code has surprised me. Things have just worked, which, though not a novel experience for me (he boasts), is still a pretty gratifying one. What I mean by that is that I've written a number of small frameworks that allow new additions to the system to be added in a few lines of PHP. You want to handle a new incoming text message? Write a quick handler and drop it into the MOHandlers directory. All handlers descend from a common hierarchy and have database access where needed. Need different database access? Don't want to write the SQL to do it? No problem: we have table gateways and OR mappings to take care of it all for you.

So a lot of what I've been doing today has consisted of writing a couple of lines of code, dropping it into place and then sitting back and saying "Oh. It worked. Shiny." a lot. Which is why this post by Andy Skelton about his experiences writing the WordPress widgets hierarchy (which sadly never got used) struck a chord with me when I read it.

Objects are cool, and that's all there is to it.

Add your comment

Sorry, anonymous comments are disabled. Please sign in with OpenID if you want to comment.

If you don't have an OpenID, you can get one at myopenid.com.

Search

Latest Twitter

In Arrochar, Scotland. Living near the bones of the earth. 2008-08-26 21:19:22 (More)

Recent entries

Launchpad Bugs

Post Categories

10mm 15th of july upload amusing animals atheism august9upload august 9 upload autoportrait bass bbc bird blackandwhite blogging blogs buildings canonical caton church colourised computing cricket d300 d40x desaturated django editing flickr flower forestofbowland from the inbox funny general heysham home humour in the news lancashire lancaster landscape launchpad links linux london lune may 12th upload me monochrome morecambe morecambebay music nanowrimo nature news new site night norfolk norfolkbroads novel novel-the-second observations pendle people photography podcasts posts that started out differently programming python quotes ranting reading reflection religion science sea selfportrait sepia shadows sigma1020mm silliness sky stupidity sunset texture thoughts three hundred and sixty-odd days of 2008 travel tree twitter ubuntu warren ellis, internet jesus water work writing writing ideas

About

Graham Binns is a writer, photographer, musician and software developer from Lancaster, England, with far too much hair, a penchant for odd t-shirts and a magnificent hat. He has been making things up for as long as he can remember and has been making code work for long enough to make a living from it.

He has written one novel, which is in the process of composting, and is working remembering how to write before embarking on a second. In the meantime, he photographs things, since it's easier not to have to make the world up in his head all of the time.

From the gallery

Corners No entry Tramway Smash Wasteland