Are You Keeping Your Code Clean?
Nov
19
The other day, I was revising some work I had done during my previous employment, as our office has added the site to our body of work. It was an enlightening experience. I assumed that since I had build the site that I wouldn’t have any problem getting back on that bicycle and ride.
Or so I thought.
When I created those pages, I was working by myself, so there wasn’t much thought about developing efficient, easy-to-read code. I knew the site like the back of my hand, because I worked on it every day.
After the job change, the site became less of my personal responsibility and so the site that was once like the back of my hand became less familiar, like the cousins you see at Thanksgiving.
After I spent some time reintroducing myself to HTML, I found that my code was not only sloppy and hard to read, but some that was just plain bad, including unnecessary inline CSS. The horror!
The one thing I learned from this experience is to try and code as cleanly as possible, and include comments whenever possible. It’s especially helpful when closing out DIV tags, as they seem to come in a flurry at the end of a page and adding the comment can help determine where different containers are being closed out.
For tips and inspiration, I would suggest reading Smashing Magazine’s recent article, 12 Principles For Keeping Your Code Clean, which talks about the different ways to ensure legibility and standards compliance.
November 19th, 2008 at 11:47 am
The listed site has some good recommendations. Notice though that a few of those problems are solved just by moving to XHTML 1.0 Strict - ah, the beauty of XHTML.
Good read, Bruce!
November 19th, 2008 at 11:54 am
I’m sure that XHTML strict still intimidates a lot of people. It’s so… strict!