Wednesday, November 7, 2007

Manage Your Mistakes

This happens to me fairly often, and maybe you've seen it or done it, too. I'm leaning over someone's shoulder as we both discover that Some Idea Doesn't Work. Before I can say anything, they select all of the relevant text and hit the [Delete]-key. All of the time, effort, energy and imagination that went into the failed effort is now... gone.

Well, okay, maybe not "gone". Dreamweaver will let you un-do all of the way back to a blank page. But still, maybe there was just a detail or two that kept success at bay. Here's a tip that I learned long ago when it comes to failed efforts: You may be a lot closer than you think and you may not realize it until you go down a blind alley or two. So, don't delete your first effort, comment it out, instead.

You spend twenty minutes wrestling with some element of your page, only to find out it doesn't work. Go back and add <!-- to the top and --> to the bottom. Browsers will ignore the markup that didn't quite work but it will still be there for you to compare, gather information from, de-bug and so on. If you are trying to get a Cascading Style Sheet to work some magic and discover it doesn't, you can comment-out the offending style rules by using /* and */ characters. Suddenly, the rules aren't gone, they just don't work. You can add back as many property-value pairs as you need to get things working as you would expect.

Next time you decide to convert a Table into a Division on one of your web pages and you don't want to get to a place where you can't come back, consider commenting-out the table and working from there. If it all gets too frustrating or the boss comes in with a Right-Now! project, you can roll back the changes by moving your comment tags from the Table to the new markup and save the new work for later.

No comments: