window.load

I ran into an interesting problem while working on a project for SiteGoals. We updated the code for an old design, moving it from tables to divs. This was relatively easy, except that the bottom divs needed to stretch to match the height of the tallest column. Sometimes that was the main content div, sometimes that was the sidebar items. I couldn’t fake it with a background image because of the quirks of the design and I’ve never had much luck with any of the pure CSS techniques, so I turned to javascript.

I found a pretty simple script for finding the tallest div and forcing the rest to match. The only problem I started to notice is that on the first load, before the images were cached, it was finding the height of the page BEFORE the images loaded, causing the content to spill over the set height. Since the site is in a CMS (Expression Engine), I couldn’t very quick add width and height tags to each image, nor could I expect the client to always do so in the future. So I had to find a way to set the height of the divs AFTER all the images were loaded. I thought this might be a more daunting task than it was. Thanks to a blog post I found, and with only a quick modification to my script, I was able to adjust the height AFTER the images and now the content no longer busts outside the fixed height of the div. Easy as pie!

Getting Real vs REWORK

I really admire 37signals for their accomplishments and their unique philosophies. I’ve read through most of their first book: Getting Real (which you can do for free) and just finished their newest book: REWORK. While I don’t always agree with everything they say 100%, they have a lot of great ideas that can push you in a different direction. Sometimes you have to take what you do, take what they suggest, and find a happy middle-ground. For example, they say

Don’t waste time on problems you don’t have yet… Do you really need to worry about scaling to 100,000 users today if it will take you two years to get there?

Well, no, but if your goal is to get that many users, you should probably take it into consideration while you’re planning your infrastructure. Obviously that doesn’t mean you go out and buy 100 servers on day one, but you shouldn’t just ignore the problem until it happens. At that point it may be too late to scale your code without massive reconfiguring.

They also advise you to always say no to new features. Well that has certainly worked for them and in theory it certainly does speed up development time. But they’ve also lost a lot of customers who want more features.

In the end, 37signals has built a huge business of these principles and a lot of the same principles can work for your own business, just make sure to take them with a grain of salt. Sometimes doing the opposite might even give you a leg up. Regardless, both Getting Real and REWORK are chock-full of great advice and I highly recommend picking one or both of these books up. Getting Real is available online, so definitely check that out before pulling the trigger on either. REWORK has a lot of the same content as Getting Real, but its a little more polished and has some great illustrations.