Validating Your Pages

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Validating Your Pages

Post by Benjamin »

It kind of irks me when programmers judge web pages based on whether or it validates. I write good code and I adhere to the standards as closely as possible. I haven't checked whether my web site is valid or not. I'm inclined to say that most of the pages probably do validate, but I'm sure a few don't as well.

My main argument against it is that it's easy to fail validation in XHMTL Strict just because your using a target attribute in a link. I'm sorry but I'm not going to add javascript just to make links open in a new window. I'm sure the XML parser isn't going to croak on something like that anyway.

I put a lot of research into things before reaching conclusions. I researched this issue a long time ago pretty heavily. I remember reading a very good article about it, but I haven't been able to find it.

Here are a few articles that are inline with how I feel about it.

http://www.cs.tut.fi/~jkorpela/html/validation.html
http://www.thesitewizard.com/webdesign/ ... tion.shtml

Don't take this any further than "I agree - here is why" or "I disagree - here is why". I guess this is one of those topics people have a fit about. Keep it civil.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

I agree - in some ways. Is that allowed? :)

Judging a site only by looking at whether it validates or not is silly. The quality of a site depends on so many factors. Valid code really isn't in the top 10.

Validating - for me - is just a tool to make sure my code syntax is correct. Nothing more, nothing less. It's the same with php and error reporting. Can be valuable to turn them on to see if I made mistakes. And most of us do once in a while. A machine (ok, and feyd) is much better at finding them then us humans.

So validating isn't an end-goal. It's just one of the many steps in the process of building a site. I do go for 100% validation though. It's not that difficult and it helps making sure some browser quirk is not due to one of the errors in the code.

If you want to use the target attribute you should use html 4, then it'll validate. XHTML isn't any better then HTML 4. I think it's more important to go for a strict doctype. But that's another discussion I guess.

I agree with you that it's kind of irritating if you show the result of your hard work to people and the only responses you get are "you have 2 validation errors".
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

I disagree, especially if you are a developer/designer by trade and are trying to sell your services to someone.
The Second Article wrote:Note that validating your web page does not ensure that it will appear as you want in various browsers. It merely ensures that your code is without HTML or CSS syntax errors.
Imagine if you were looking for a contractor to build an add on to your home. During the bid applications, you find out that one of them uses processes or materials that are not code-compliant. In fact, they admint that their work may have errors, but they are OK with that because the errors are just little ones. Would you be inclined to patronize that contractor?

That may be an extreme example, but I am of the opinion that standards are in place for a reason. They help people on both ends of development (the developer and the user). To assist in this process more, the W3C has implemented several different validation levels of markup so that a developer can code in HTML, HTML Transitional, HTML Strict and XHTML. If one of the standards is not to the liking of the developer, then we as developers can use another standard without having to be at odds with the standard that we think should be different.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I agree with Everah. You're selling a product to somebody for money under the impression that you're a "professional" web developer. You shouldn't really admit that the product you're selling contains errors. I have to ask... why on earth even bother using XHTML if you don't plan on following it??? Switch doctypes to something that you can implement correctly... that's what the doctypes are there for.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

One agree and 2 disagree...

I'm in the middle...for years I could have cared less about how my web pages appeared technically based on w3c standards...

Recently however I've had a change of heart...after arguing with iamsure he convinced me standards were important...

Like d11 and Everah has noted, you are a professional and should follow industry standards the best you can...however in my case or in my opinion...

Having rock solid visual designs are more important to appease the masses, than having technically solid web pages which might suffer aesthetically somewhat just to allow a small minority the ability to view web pages...

I struggle with the above...do I please myself and my client or do I retract a little on design and make the site more standards compliant?

As for your argument towards using javascript over target...after some consideration...

Meh why not...using Javascript does make sense in this regard...I have no problems with making that switch...

Cheers :)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Having rock solid visual designs are more important to appease the masses, than having technically solid web pages which might suffer aesthetically somewhat just to allow a small minority the ability to view web pages...
But Hockey, what I don't understand: what has visual design to do with validation of your code? It's not one or the other.
(except that when you have many validation errors chances increase that your layout breaks in some browser)
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

matthijs wrote:
Having rock solid visual designs are more important to appease the masses, than having technically solid web pages which might suffer aesthetically somewhat just to allow a small minority the ability to view web pages...
But Hockey, what I don't understand: what has visual design to do with validation of your code? It's not one or the other.
(except that when you have many validation errors chances increase that your layout breaks in some browser)
Fare enough... :)

What I meant, was sometimes validation is a PITA :P and for the sake of simplicity I will occasionally favour design (tables, etc) and major browsers, for the majority of users over validation...

Besides, validation is just the suggested standard...every browser will no dought render differently (at least somewhat), despite these standards...when that changes I will adopt standards based coding practices 100% of the time...

Cheers :)
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Hockey wrote:Fare enough... :)

What I meant, was sometimes validation is a PITA :P and for the sake of simplicity I will occasionally favour design (tables, etc) and major browsers, for the majority of users over validation...

Besides, validation is just the suggested standard...every browser will no dought render differently (at least somewhat), despite these standards...when that changes I will adopt standards based coding practices 100% of the time...

Cheers :)
Why are so many people under the impression that we talk about validation we somehow drop all usage of tables and target? :(

Tables are valid in both XHTML and HTML... getting rid of tables would be silly... it's just knowing what to use them for.

Equally, target *is* a valid attribute. It's just about choosing the correct doctype for your work. This is why I think people should validate their pages. It's easy to achive *if you use the right doctype*. I constantly see people specifying XHTML strict and happily allowing invalid code in there when really they could use a transitional doctype and get valid results... it seems silly to me. The definition of "valid" changes from doctype to docype.

DTD's are written for this exact purpose of defining what tags can appear where, which ones are slf-slocsing, what attributes are allowed, what data types they can hold, how many times they can appear etc etc. Once you understand the point of the DTD it seems crazy to specify it and then completely ignore it.
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

sometimes validation is a PITA
:lol: ok, sorry i'll stop laughing :wink:

Well if all or most of your users are happy (and you as well) I wouldn't worry about an error or two. serious. A few unencoded ampersands won't break your layout.

But as chris says, knowing about doctypes may help. I remember, when I started with my first site I bought the book of Zeldman (designing with web standards) and the chapter about DTD's confused the hell out of me. I just copy-pasted one I thought was ok and was used by many people (xhtml strict that was) and coded for it. Only later I understood them.

And really, validation isn't hard. One click in FF or Safari with the webdev extension and the validator tells exactly which line is wrong and why.
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Hmm... great to see everyone ignored my comment. :-P

I think standards are good, they should to be adhered to, but they should also be taken with a grain of salt. I like to think of compliance in steps: there are things you should absolutely get right, and there are other things that aren't so important.

The great thing about HTML is that its cleartext. Even if a few decades into the future browsers that render HTML are a relic of the past (which I doubt), you can still crack open the source and get the basic idea, the text. If you're standards-compliant, good for you: your HTML should be easier to understand (at least for machines). But...
A few unencoded ampersands won't break your layout.
Encode them anyway. :-P
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Post by matthijs »

Hmm... great to see everyone ignored my comment
hehe, sorry about that :)
Indeed, it's not going 100% at the w3c itself... a big organization, based on work of volunteers. Not easy. Hopefully the troubles get sorted ...
Encode them anyway
Yes sir! :wink:
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Ambush Commander wrote:Hmm... great to see everyone ignored my comment. :-P
I just read the Hoehrmann article (most of it, it was a long read) and thought I understand what he has to say abot the lack of investment and support of the validation tools at the W3C, that does not exonerate devlopers from coding incorrectly or using the wrong DTD's. The simplest and most logical thing to do is plan what your markup should accomplish, then locate the most appropriate DTD for the markup document. Then code in it.

Just because some of the less common errors in markup are allowed (according to Hoehrman) it does not mean we can throw out the standard. If we know the standard we should utilize it. If there are different standards to choose from, we choose the one that is most apropriate for our development needs. But in all cases, I think we should adhere to the standard.

PS I agree with d11, tables are a perfectly acceptable development tool in your markup, regardless of the DTD. The 'target' atttribute of the 'a' element is acceptable in all except the XHTML Strict DTD.
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Why are so many people under the impression that we talk about validation we somehow drop all usage of tables and target?
Admittedly I don't know enough about validation, css, etc to be arguing right from wrong...but to answer the above question...

I was under the impression tables were meant for tabular data...and target...I have no idea :)
This is why I think people should validate their pages. It's easy to achive *if you use the right doctype*.
Again, my lack of knowledge in this area doesn't help :P
Once you understand the point of the DTD it seems crazy to specify it and then completely ignore it.
Although that makes total sense, it never occured to me...I was always under the impression one would want to validate against the latest standard, which I think was xhtml 2 - or soon to be???
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

matthijs wrote:
sometimes validation is a PITA
:lol: ok, sorry i'll stop laughing :wink:

Well if all or most of your users are happy (and you as well) I wouldn't worry about an error or two. serious. A few unencoded ampersands won't break your layout.

But as chris says, knowing about doctypes may help. I remember, when I started with my first site I bought the book of Zeldman (designing with web standards) and the chapter about DTD's confused the hell out of me. I just copy-pasted one I thought was ok and was used by many people (xhtml strict that was) and coded for it. Only later I understood them.

And really, validation isn't hard. One click in FF or Safari with the webdev extension and the validator tells exactly which line is wrong and why.
Thats true...even my own web site validates, using massive amounts of tables, etc..it still validates...

My problem is, I'm an extremeist...if I validate I might as well go completely CSS driven layout, etc...

One or the other, I can never accept a balance of both I guess :P
Post Reply