There’s been a lot of talk about the broken window theory — and rightfully so. It’s hard to dispute that the evidence of decay leads to more decay.
This theory also applies to your HTML/CSS. If you let your code get messy, you’re a lot more likely to continue to take shortcuts and apply hacks. Inline styles lead to more inline styles lead to more inline styles. And before you know it everything is a mess. It’s like your code is rotting — it eventually gets so bad you don’t want to go near it (or you pinch your nose, inch closer, and then just throw it all away).
And bad code spreads like a virus. You end up duplicating pages with bad code. You end up copying and pasting chunks of bad code into other documents. Shattered glass can cause a lot of damage.
So pay attention. Repair those “HTML/CSS windows” quickly. Remove inline styles. Remove unnecessary classes and ids. Keep your code clean from the beginning and it will pay off.
A friend suggests that one good metric to use in evaluating engineers is how many lines of code they delete from a project. The theory is that these are the people cleaning up your broken glass. (Doesn't work if you tell them you're measuring it, though!)
This is a delicate subject. A balance needs to be reached. I can see this easily leading to gold plating / pefectionism. I'm not advocating coding sloppily, just saying you have to pick your battles. If something is going to be re-used, well, make the investment. But I think a lot of HTML coding is for "one offs" - just random pages that will never be revisited. Better to just get them done and move onto other tasks.
'Broken window theory'. Every right-winger's favourite bit of cod sociology - a discipline many of them otherwise despise. :)
I agree with Ryan. Gold-plating is a worse problem than occasional inline styles. But both are signs of bad planning, which is the real problem.
One man's "window fix" is another man's " way too much talk about CSS and XHTML and Standards and Accessibility" ;-)
Yep - the "broken window theory" is quite a subject. Looks like some good reading there... and there's also the ' broken window fallacy' to check out.
For html/css-
Sloppy coding does lead to not wanting to go near it again. You create a dark forest. I have had to "gear up" and "psyche up" to go into some website area source code sometimes. All those timely shortcuts - that worked enuff... it's scary stuff! I find the need to 'Ghostbust' websites once in a while.
Lately, I have been focused on best practices. More and more people are looking at and embracing the ideas of web standards. (Molly talks about " What Is A Web Standard"...)
For individual designers... pick your poison, I guess.
In a team environment though, these 'broken windows' become unacceptable. Best Practices sometimes need to be agreed upon - like a ' manual of style'- for coding practices. A simple do's and don't list helps in group/team situations.
There is nothing worse than going into some area of a site that has been hacked together by someone not thinking like me! :)
It is hard enough to go back and try to remember what I was thinking when I hacked something together.
It is like many things- visualize who is coming after you... ('cause it might even be you!)