jeffman Posted October 26, 2010 Share Posted October 26, 2010 By some estimates, over 99% of HTML pages on the web today have at least one error in them. But because these errors don’t cause browsers to display visible error messages, nobody ever fixes them. diveintohtml5.orgThat website is a pretty good read, btw. Link to comment Share on other sites More sharing options...
Fmdpa Posted October 27, 2010 Share Posted October 27, 2010 On my webpages, they are CSS3 "errors". Wish the browsers would catch up faster. Link to comment Share on other sites More sharing options...
wirehopper Posted October 28, 2010 Share Posted October 28, 2010 If the site visitor can read the page, are the errors relevant? Link to comment Share on other sites More sharing options...
jeffman Posted October 28, 2010 Author Share Posted October 28, 2010 Not sure.Browsers are supposed to do everything possible to parse code that contains errors. That's pretty easy when a body tag is missing after a head element is closed, or when a closing body tag is missing, stuff like that.It's more difficult in other situations. As an example, some browsers really fall apart when you put stuff in non-existent places, like this: </td>illegal location; these words might get displayed anywhere<td>.It's also likely that different browsers use different algorithms for parsing bad HTML, and that they change their algorithms for doing so over time. If your HTML has errors, but you kludge the page so it looks right anyway, next year's browser may parse the errors differently. Suddenly your page doesn't look right anymore.I think the bigger issue, if there is one, is that the very forgiving nature of browsers encourages many developers to never correct sloppy habits. If browsers continue to be forgiving, again, this may not be a problem.Or consider this. A lot of people get into programming with HTML as their gateway. HTML leads to JavaScript or PHP, which in turn may lead to Java or C++. If you're accustomed to an environment that tolerates sloppiness, you may have a hard time adjusting to an environment that tolerates zero or almost zero sloppiness.Maybe I'm like a lot of programmers and I just have OCD when it comes to sloppy code of any kind. This could be an unwarranted prejudice when it comes to HTML. Don't know. Mostly I found the "statistic" interesting. Link to comment Share on other sites More sharing options...
ShadowMage Posted October 28, 2010 Share Posted October 28, 2010 Maybe I'm like a lot of programmers and I just have OCD when it comes to sloppy code of any kind. This could be an unwarranted prejudice when it comes to HTML. Don't know. Mostly I found the "statistic" interesting.Count me in that category! Error messages just plain bug the crap out of me. I'm also very particular about spacing and indenting my code to make it as readable as possible. I even have to write my DTD's a specific way:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> I can't stand it all on one line.And, yes, the statistic is interesting. Not really surprising, but interesting. A lot of people get into programming with HTML as their gateway. HTML leads to JavaScript or PHP, which in turn may lead to Java or C++. If you're accustomed to an environment that tolerates sloppiness, you may have a hard time adjusting to an environment that tolerates zero or almost zero sloppiness.I actually started the other way around. I got into programming through Visual Basic first, then C#, and then I started dabbling in HTML, JavaScript, and PHP. So that's part of the reason I'm so particular with my code. Link to comment Share on other sites More sharing options...
boen_robot Posted October 28, 2010 Share Posted October 28, 2010 Well... in university, when they (tried to) teach us HTML, they did go on to saying that writing this in "a way that doesn't follow these rules" is not a good practice, invalid, and we should avoid it, even if the browser appears to display it fine... now if only they omitted the "font" element, the "background" body attribute and others, that would've been great. It's a good thing everyone already knew HTML better or knew who to ask for a better resource (guess who told them what ). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.