Recent Entries »

The Flyweight Pattern: (Mis|ab)used at times.

In my brief career in software development thus far, I have seen a lot of “WTF” code, that is, code that deserves to be posted to The Daily WTF. Some of this code was admittedly developed by myself and upon reviewing it a few months after it was written, I secretly wondered what I’d been thinking.

This isn’t going to be an indictment of bad programming; in fact, I think it’s good if you can look back at your old code and see where it could be improved. Such a process suggests that you are continually self-improving, a skill crucial in software development. Besides, all of us have made a mistake or two at times when we were stressed, tired or just plain not thinking straight.

However, there’s one mistake that I’ve seen that I think warrants bringing to light, and that is the misuse of the Flyweight pattern.

Continued

Goodbye, old friend…

I’ve had the same pair of prescription glasses since about 2004, having changed the lens more than once. I just got so used to them that whenever the opportunity arose to replace them, I couldn’t find a pair that felt or looked right. So, I just continued with the same old dependable pair.

They’ve fallen off of my face more than once, have tumbled many times to the hardwood floor from my nightstand while I fumbled for them in the dark, been lost in my bed covers and rolled onto during numerous occasions, and of course I’ve fallen asleep with them on more times than I can remember. Despite all of this, they not only held together, but retained much of the original lustre and remain in excellent condition.

Only one of the earpieces is starting to look worn, the nose pads are looking a little old and one of the lens screws had to be replaced when it fell out and got lost, but other than that, they’re as good as new. This was the first “thin” pair of glasses I had ever worn and I initially had some reservations about durability, so I’m more than pleased with how well they’ve held up. (I think the frames are made up of some titanium, but I can’t remember)

But this past weekend, I decided it was time to finally replace them.

We’ve had a good run, old friend, but I’m afraid it’s time to part ways.

Continued

Boston reflection and updates

It’s been two months since the 2011 Boston Marathon, which was my first attempt at this historic race. As some of you may know, it had been one of the focal points of my life for the past several months, ever since I qualified by 13 seconds back in September of 2010.

I took a new approach to training and really dedicated myself to it. There were many mid-week 4 AM mornings, followed by 1.5-2 hour runs in the dark, snow/rain and wind. I arrived at the starting line being as prepared for any race as I’d ever been.

Continued