Archive for the ‘Uncategorized’ category

Pattern Traps

October 7th, 2009

Design patterns are ideas for solving problems that commonly occur in software development. Patterns provide a language framework for programmers, helping us to discuss abstract concepts in an efficient manner.

If you’re not familiar with design patterns, I highly recommend reading the seminal work by the Gang of Four: Design Patterns: Elements of Reusable Object-Oriented Software. Its a bit dry but an excellent read. I remember when Joshua Storck recommended the book to me many years ago; it opened my eyes to a higher level of programming and helped me grow from a task implementer to a software designer.

Patterns are helpful for structuring thought around problems and forming elegant solutions. However, there are a few things to keep in mind: Patterns have consequences, and patterns are not best-practices. Programmers must still apply thought. Terry Chay describes this in his article, Challenges and Choices.

I just came across an article by Amy Hoy in which she describes the dangers of over relying on patterns. She’s spot on:

People no longer treat patterns as the shared wisdom of experts, however. They are inclined less to bang their heads against a problem and then consult the Book of Wisdom to see what it says about their particular problem. Instead, they treat patterns as Wal-Mart for decisions. They don’t know what they want, exactly, but hey, this little item here on the shelf looks like a potential candidate.

They start with a pattern and see how to make it fit.

This is bassackwards.

We all build our own patterns around problems we’ve encountered. But just as with design patterns, its important that we force ourselves to think through problems creatively before jumping to more commonly treaded paths.

Installing MacFusion

July 17th, 2008

I recently setup a new MacBook Pro for web development. While trying to mount a samba share I discovered MacFusion, an application that lets you treat various remote storage mechanisms as if they were folders on your local hard drive. MacFusion is built on top of MacFuse, which is the OSX port of the Linux based FUSE that facilitates building filesystems that run in userspace.

» Read more: Installing MacFusion

SVN notifications

July 9th, 2008

I’ve been investigating how to send notification emails when changes are committed in a Subversion repository. Two interesting options I found are svnnotify and svnmailer.

» Read more: SVN notifications

Organizing log files into date based directories

April 10th, 2008

I recently had to grep through a few hundred thousand log files in a single directory. The logs dated back several years and had never been organized into directories. In fact, there were so many log files that grep’ing the directory resulted in an “argument list too long” error. This error is described clearly here, and the quickest solution is to use find to pipe the filenames into grep using xargs:

find . -name "*.log" -print0 | xargs -0 grep "xyz"

» Read more: Organizing log files into date based directories

The new VCR

April 3rd, 2008

The garage door opener is to me what the VCR was to my parents. After struggling with the garage door for a few hours, I decided I better write down some instructions.

I have a Craftsman garage door opener with three buttons on the controls. It uses rolling codes but aside from that all I can tell you is it sucks, its loud, and it never seems to do what I want it to, like opening.

» Read more: The new VCR