Is Valid Code Important?
If you like to do your own code on notepad or one of its alternatives, a validator is a big help anytime you are having a problem with it. Any time a page you've produced looks funny (but you aren't enjoying the humor) you can just run it through one of the online validators and it will produce a list of things it objects to. It is likely that one of these will have pinpointed the error for you.
There are forums where web design people get together and answer each other's questions. One of the first rules before posting a problem in some of these forums is that you validate the code. Validation does have its uses and has helped me find problems.
I started with valid code as a priority and using xhtml for its more exacting standards. There was a price to pay. My first site depended mainly on social bookmarking for traffic. I had the "Add This" social bookmarking widget at the bottom of the page and it would produce errors. I worked through the code to stop that from happening but its appearance suffered.
I was worried that IE6 would fly into a tizzy and go into quirks mode because of invalid code. (The sooner that browser follows Dracula to the grave the better.) It turned out that for my sites, visitors hardly used any form of IE. From 75 to 95% of the traffic was with FF, so eventually I quit worrying about it and at least the appearance of the social bookmarking button improved.
I frequently link to articles on a site that uses & (ampersands) in the URLs. These will not validate and you have to use the html code for the ampersand in the URL to get it to validate. Apparently some of the older browsers (programmed in Latin or Sanskrit) have a problem with them. At first I did substitute the html special characters code for each ampersand but quit doing that quickly. Since I've seen these used quite often I've just assumed that browsers have evolved faster than the validators, and have quit worrying about that little error message too.
Frequently the problems validators bring up are only problems for very old browsers. It depends on your traffic. Some sites do get a significant percentage from IE6 and older and of course you would want to adjust to your visitors. Interesting to me, YouTube is stopping IE6 support so some of the big sites also don't want to bother.
Another huge site that doesn't worry much about it is Google. I read one of their people saying that they don't use the /body and /html tags because none of the browsers do anything with them. When they run out of material the page ends. The advantage to leaving them out is to save on bandwidth! Considering the amount they use displaying videos this does seem small but I do similar things and it makes sense to me.
But not having those end tags results in validator errors. They don't seem to care. I have seen pages put up on large, active sites that didn't even have the whole head section or doc type declaration. Someone intelligent put one up on a PR4 site and it does really well on browsershots.org, better than any page of mine that I have ever tried there.
If you add any commercial advertising to your pages there is a good chance that it will not validate. I have experienced this with ClickBank, Market Health*, Amazon, and Adsense. I just ignore it now. Obviously the people who produce them know what they are doing, and I have never had something invalid in the ads that will screw up the rest of the page layout.
If I do want to use validation to check a page layout for errors, I do it before adding the ads. I had a page with 6 separate Amazon ads and it produced over 130 errors from them at a validator. It would be a serious pain in the neck wading through all of those looking for one in my code that was causing a problem with a page.
Someone in a forum posted that he checked the top 100 sites and none of them validated completely. I'm too busy to bother but the news doesn't surprise me. A simple html/css site should validate before you put the ads in, and it is worth doing just for the learning.
Valid code is important if it affects the layout of your pages, but a lot of companies and sites are getting a lot done with code that seems to be better than valid.
*Market Health is the easiest CPA to be accepted to. For nearly all their offers, you just need to confirm your email. This gets you an affiliate link, and you are ready to pick out banners or links for your site. Their ads vary visually from good to extremely good, and are served from their servers.
They were practically a breakthrough for me. Suddenly having sites with a lot of text was an advantage. The advertising had all the visual attraction and clicks went way up. Their system is simple. Since they serve their ads, you don't even need to upload images to an image folder. You just copy the lightweight html they supply and paste it wherever you want it in your html sheet.