Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it worth the development time to output valid HTML?

Tags:

xhtml

strict

Developing websites are time-consuming. To improve productivity, I would code a prototype to show to our clients. I don't worry about making the prototype comform to the standard. Most of the time, our clients would approve the prototype and give an unreasonable deadline. I usually end up using the prototype in production (hey, the prototype works. No need to make my job harder.)

I could refactor the code to output valid HTML. But is it worth the effort to output valid HTML?

like image 358
MrValdez Avatar asked Sep 23 '08 08:09

MrValdez


People also ask

How will you check an HTML is valid or not?

Take checkHTML("<p>Test<P>test") for instance. That is perfectly valid HTML, but the browser will normalize it when it pulls it back out of innerHTML . There will be no text outside an element in the DOM generated from that valid HTML.

What is the purpose of development of HTML?

As a markup language, the purpose of HTML is to provide a set of general rules that suggest how content should look when rendered. A markup language doesn't dictate the methods used to display the content, nor does it have foreknowledge of the target context, so this control is imprecise.

Does HTML have a future?

Adobe believes that the Future of HTML lies in retaining the bulk of the behavioral semantics of HTML, it's tagset and associated CSS standard while moving to a fully XML compliant syntax.


2 Answers

It is only worth the effort if it gives you a practical benefit. Sticking to standards might make it easier to build a website that works across most browsers. Then again, if you're happy with how a website displays on the browsers you care about (maybe one, maybe all), then going through hoops to make it pass validation is a waste of time.

Also, the difference in SEO between an all-valid html website and a mostly-valid html website is negligible.

So always look for the practical benefit, there are some in some situations, but don't do it just for the sake of it.

like image 90
Alvaro Avatar answered Sep 27 '22 18:09

Alvaro


Yes. It's hard enough trying to deal with how different browsers will render valid HTML, never mind trying to predict what they'll do with invalid code. Same goes for search engines - enough problems in the HTML may lead to the site not being indexed properly or at all.

I guess the real answer is "it depends on what is invalid about the HTML". If the invalid parts relate to accessibility issues, you might even find your customer has legal problems if they use the site on a commercial basis.

like image 20
Mike Edwards Avatar answered Sep 27 '22 20:09

Mike Edwards