Nitpicking & the Joy of Clean Code

May 24, 2006

I’ve spent the past week or so working on a couple of projects that a “kinda known” company ’round here as well as a large national design firm, put together for my company. I have a few nits to pick with these people, promptness being one of them for both. My main, large problem, is that their code isn’t too clean. I’m not talking ASP or PHP, but their XHTML/HTML & CSS is a mess.

While I’m not the cleanest of html’ers, this site’s code is a testament to that, but when I code for a business site you had better bet that it’s damn tight. When I showed an example of the code in question to a co-worker, they brought up that it was probably done in Dreamweaver’s Design view. The more I thought about it, the more that it all became apparent.

While I’m not gonna get into the whole handcoding vs. WYSIWYG debate, I’m starting to become a handcoding snob. I think that handcoding has the possibility to make the site more efficient. For instance, if you’re coding a table. Why have DIV’s applying a style inside of a TD, when you can have that TD or TR apply the style instead?

One of my other little nits to pick, is with the use of Javascript menus. I think we’re all to a point now, where we can hack the hell out of UL’s to make some nice menus that are smaller in size and function a little better. 75K of graphics & Javascript or 3k with CSS & two graphics? Sure the fonts don’t look as nice on older systems, but that’s a trade-off. I will say that I’ve implemented more CSS/Javascript-less graphic menus in the past month than I ever have.

The more I work with outside web designers, the more and more I want to just put together a group of 3-5 people to just kick the shit out of these people. Get a good graphic designer or two, get a good css/html coder (my specialty), get a good programmer or two and you’d have an awesome core group….very similar to the one I’m in now.

I don’t care if anyone does Flash. I don’t care if they’re the Pooba of Perl or the Admiral of AJAX. If it’s not clean, then you’re doing your customers a disservice.