There are so many developer tools, libraries, patterns and best practices in the developer community that it boggles the mind. So how do you know what tools to use? My answer to that question is simple. Does the tool that you are implementing meet your needs? If so, how long does it take to implement? I recently went through an example that taught me a valuable lesson.
While developing a Web site for a client, the scope document had a Photo Gallery section indicated in it. My first instinct was to use what I had always used LightBox2 – logically. I was already using swfobject 2.1 and didn’t think there would be a problem adding Lightbox2 to the application. I was very wrong. Firefox (oh why can’t they just be like you) was rendering the Photo Gallery without issue, but IE 6&7 were erroring out horrifically. This was not a good sign.
Looking into the issue, Lightbox2 uses Prototype, Scriptaculous (2 scripts) and the Lightbox.js plus CSS. A lot of points of failure in my opinion. The only solution to fix my IE issue was to pull out the scripts and “fix it.” But that didn’t help the fact that the client wanted a Photo Gallery with a “lightbox” viewing format. I thought about using another solution I was familiar with, ShadowBox, but it seemed bloated and really more than I needed.
A co-worker (@ianlintner) suggested another tool that acted just like Lightbox, but without all the scripts. I was excited to try something new that would be more efficient for the UX. He suggested using Slimbox 2 (Slimbox, the ultimate lightweight Lightbox clone). I reviewed the specs and they had switched from Moo Tools to using jQuery – even they had optimized it so I wouldn’t have to.
This new tool did not pretend to be more than it was. Other developers like to find “silver bullet” tools that do what they need and more! Sometimes, it’s overkill and they waste more time implementing the “enterprise” level tool that does the same thing a little script would do. But it’s cooler…pfft. My recommendation, if you need a pair of pliers – you may have a rusty pair without grips that gets the job done or you may find a new pair of pliers that is shiny and has new grips. Either one of those tools are sufficient for the job. Just don’t go get a pipe wrench to do the same job if it isn’t needed.
Some of the added benefits were file size, Lightbox 2 was 70+ KB, while Slimbox 2 is around 45K B. It works perfectly on all platforms and browsers without any conflicts on my site. The jQuery script is hosted by Google, of course, so that saves me from even having to host the script. I like delegating stuff even if it adds points of failure, my point-of-view – if Google is down then a nuclear strike is on its way. Checkmate.
Overall, the lesson I learned was to be more aware of optimized tools that do what old tools accomplished, without going overboard.