...

View Full Version : How necessary is validating?



cineweekly.com
12-16-2010, 08:49 AM
I've read many articles on why it's important but I still am not convinced that it's anything more than coders being too strict. Why is it that I can't find one site without errors, even the most popular sites:

Site / Validation Errors
joblo.com 4,504
google.com 35
ign.com 889
artofmanliness.com 68
codingforums.com 30

My site only has 30 or so (not the version uploaded) and 90% of those come from the two ads on my pages.

VIPStephan
12-16-2010, 10:37 AM
OK, yeah, you can get away with errors in your code. But it depends on what kinds of errors you’ve got. If it’s some unencoded entities or a missing alt attribute or stuff like that then there’s no big deal but if you forgot to close an element or nested elements wrongly this could affect the look of your site and the way styling works in different browsers drastically. So you have to use common sense in how many errors you wanna let go through.

However, I wouldn’t take other bad examples as example to aim for. Take the good ones. The question is not why you should care, it’s why you should not care? Why would you wanna do a bad job if you can do a good one? Why wouldn’t you wanna stand out from the crowd? There’s already too much bad code out there. Why would you wanna add even more bad code?

The thing is that, for example, many errors come from CMSs that are coded badly, and you as site owner can’t always to anything about it. Some things come from bad user input, e. g. by several people editing the contents without HTML knowledge, just using a WYSIWYG editor. You, as coder, have not much control over a site once it’s released (unless you’re the sole editor maybe), so you can’t always prevent errors. But you can at least do the best job you can do as long as you have control over it. After all, with valid code you can be sure that layout problems come from CSS, not from errors in your HTML.

And by the way: Google, despite its popularity, is really the worst example you can bring up when it comes to good practices in coding. I’ve lost respect for Google when I found out that they do browser sniffing using the user agent string to serve different content to different devices (and they even did a bad job with this technique).

paolo1
12-16-2010, 12:57 PM
I think you always should validate your code, it can prevent many errors. And valid code usually is displayed correctly in different browsers.

teedoff
12-16-2010, 04:05 PM
Stephan summed it up pretty well. As I have said in other similar threads, most big player sites out there today dont completely validate. But, as already pointed out, this doesnt always mean its bad code. Could be unencoded characters or the like.

As for me, validation is a means to an end. I WANT cross browser compatibility. I WANT good semantic code. I WANT my site to be completely error free if at all possible.

Another thing to consider too is if I'm creating a site for a major client, and the site doesnt validate, they may or may not appreciate that fact. They may not even know whether it validates or not, but if they were to see validation errors, it may reflect poorly on me in the future.

You know home builders can build homes JUST according to code. Does that mean there wont be things wrong with the house once you as a home buyer moves in? Not usually. I've seen too many homes built that were exactly to code, but the builder didnt care whether it was built with quality materials and good workmanship. Nothing worse than a new home owner having a water line start leaking water because the couplings were fitted together with bad glue. lol I know thats a strange analogy, but it rings true.

I want to code to the very best of my ability, and that means code free from validation errors.

cineweekly.com
12-16-2010, 08:22 PM
You know home builders can build homes JUST according to code. Does that mean there wont be things wrong with the house once you as a home buyer moves in? Not usually. I've seen too many homes built that were exactly to code, but the builder didnt care whether it was built with quality materials and good workmanship. Nothing worse than a new home owner having a water line start leaking water because the couplings were fitted together with bad glue. lol I know thats a strange analogy, but it rings true.


I don't see it as building a house that will fall apart, I just see it as a house whose design may or may not be easily compatible with future trends. "It may be tricky getting newfangled cable internet to my house way out in the country but I'll find a way when there's demand."

I will validate as sort of a code spell check for closing tags or something but if it's just being picky then I stick with what works. If my site looks great now on the top 5 browsers then that's all that matters to me.

tom_my
12-17-2010, 01:12 PM
This great number of errors could be typical errors only, like missed "/" in <br/> tags. Validating assures not only correct coding but also good style in coding, accuracy and high standards.

But I can't believe that sites with huge amount of content can reach 100% validation per page.

NoeG
12-17-2010, 02:39 PM
yupp html changed dramatically over the years it got a lot stricter with the closing tags and some tag sare actually non existant in new versions that doesn't mean its not gonna work anymore it just means its considered bad markup and invalid code, I try to make sure my code is 100% validated to stay caught up with the current html and css even though the old html still works

cineweekly.com
12-17-2010, 07:31 PM
I guess everyone agrees "If it ain't broke, don't fix it". What we disagree on is the definition of 'broke'.

To me: If it looks good to most users now, it ain't broke.
To validators: If it doesn't follow strict W3 trends, it's broke (even if it looks fine).

teedoff
12-17-2010, 07:49 PM
Again, if its functional and cross browser compliant then yes its fine. If you are having issues though and you have hundreds of validation errors, then how could you expect more.

I think you can pretty much achieve BOTH. Great looking sites that are both function AND contain valid code. THEN if you have issues, you can say well its not my code, must be IE! lol

cineweekly.com
12-17-2010, 08:01 PM
Haha, IE... ugh.

Rowsdower!
12-17-2010, 08:04 PM
There aren't validation police, but when I create a custom CMS or when I create a theme for an existing CMS, or when I just create a page in general, I take the time up front to make it validate. I think it's a more professional way to do business but the market share that recognizes the difference is very slim.

For me, it's more a matter of personal satisfaction to ensure all pages are 100% valid (unless a CMS's core functions generate invalid results as is the case sometimes, in which case I just make my code valid). I recognize that all validation errors are not created equal, but I also usually insist that a user on the forum here validates 100% before asking for CSS help. I feel that this is just a matter of good manners. Don't crap all over the floor and then ask me to fix your toilet. In either case I don't mind helping, but I don't want to work around your mess! :D

Excavator
12-17-2010, 08:11 PM
Haha, love the analogy :thumbsup:

cineweekly.com, check out the link Why validating is good in my signature line. It discusses exactly this issue.

VIPStephan
12-17-2010, 09:21 PM
Well, I’m still wondering: If you write code from scratch, why would you write invalid code in the first place when writing valid code isn’t any harder at all? To me it just doesn’t make any sense to write invalid code and let it be like that.

However, equally important – if not more – is semantic code. Code that reflects the meaning of the content it’s marking up.

cineweekly.com
12-17-2010, 10:34 PM
I always write as valid or semantic as I possibly can but I'm always learning and accept the fact that I'll never know everything about html, css, and php. I code in the way I currently know how but sometimes I can achieve the effect I'm going for but apparently there's a better way of doing it that I just don't know yet, which is why it comes out invalid. I'm sure I'm mixing the terms 'semantic' code with 'valid' code but I know I always close tags, alt my images, and make it as clean as I can.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum