Page 1 of 1
How should web browsers treat sloppy or incorrect code?
#1
Posted 19 July 2008 - 11:59 PM
I've been working with some XML files this week which had errors in and therefore wouldn't display correctly. That got me thinking about web browsers...
Currently if a web page has erroneous HTML, a browser will use a "best guess" and display the page according to the HTML it has to work with. On most occasions the browser will render the page pretty much correctly, save for one or two oddities and the day is saved for the site owner.
Unfortunately this does lead to sloppy coding being "acceptable" - just look at the rubbish some WYSIWYG editors spew out.
So, what if we had a scenario where browsers would only display pages if the HTML was 100% correct and error free?
Would this be a step forward or backward?
Would it lead to better coding?
Should browsers annotate incorrect code in the rendered page?
Currently if a web page has erroneous HTML, a browser will use a "best guess" and display the page according to the HTML it has to work with. On most occasions the browser will render the page pretty much correctly, save for one or two oddities and the day is saved for the site owner.
Unfortunately this does lead to sloppy coding being "acceptable" - just look at the rubbish some WYSIWYG editors spew out.
So, what if we had a scenario where browsers would only display pages if the HTML was 100% correct and error free?
Would this be a step forward or backward?
Would it lead to better coding?
Should browsers annotate incorrect code in the rendered page?
#2
Posted 01 August 2008 - 12:20 AM
I can't believe nobody responded to this yet 
I think that we can agree on the fact that not everyone can produce 100% valid code (come on ... I'm almost sure that some people actually use MS Word to generate web pages). Some people don't care, some people don't know about code validation.
I think that we can agree on the fact that not everyone can produce 100% valid code (come on ... I'm almost sure that some people actually use MS Word to generate web pages). Some people don't care, some people don't know about code validation.
#3
Posted 01 August 2008 - 03:21 AM
This won't get me any designer friends but... going for a 100% valid approach is great, but only if the standards themselves are 100% what is needed. And they're not. It's all good saying that you can div this and div that but when I look at the standards as an 'outsider' - they're just cobbled together and try to make the best of the bad job the earlier browsers did.
Is that sacrilege? Not to me. Imagine if you could wave a magic wand and recode the billions of current web pages in any way you want. Would it be the same as the current standards?
For me, semantics are as important as validation. What designers and end users want in a site is markedly different from what the current standards offer - not just because of browser bugs. I've had a sneaky-peek at what could come in the next standards and it's getting closer to just having semantic mark-up and more meaningful tags but with every evolution the standards try to close the gap between what the end result should be, but they're hamstrung by legacy issues.
What I'm trying to say is, "Is it acceptable to have semantically incorrect code as long as it's valid?" - is this what people want enforced? If the day comes when 100% standards-compliant means 100% semantic, 100% usable and 100% accessible then sure thing, make it a requirement. Until that day, standards-compliance doesn't guarantee these things so don't insist on it!
I'll go make my last request!
Is that sacrilege? Not to me. Imagine if you could wave a magic wand and recode the billions of current web pages in any way you want. Would it be the same as the current standards?
For me, semantics are as important as validation. What designers and end users want in a site is markedly different from what the current standards offer - not just because of browser bugs. I've had a sneaky-peek at what could come in the next standards and it's getting closer to just having semantic mark-up and more meaningful tags but with every evolution the standards try to close the gap between what the end result should be, but they're hamstrung by legacy issues.
What I'm trying to say is, "Is it acceptable to have semantically incorrect code as long as it's valid?" - is this what people want enforced? If the day comes when 100% standards-compliant means 100% semantic, 100% usable and 100% accessible then sure thing, make it a requirement. Until that day, standards-compliance doesn't guarantee these things so don't insist on it!
I'll go make my last request!
#4
Posted 01 August 2008 - 05:13 AM
Who's in charge of what the standards are anyway (haha don't answer that I actually know the answer)
#5
Posted 01 August 2008 - 06:29 AM
It depends on the errors.
I think that if there are missing closing tags, a nice little icon in the corner and bubble message saying the site may not display correctly would really push the cow-people out there to invest in writing valid code.
However, if there's a missing alt tag on an image it should be an accessibility warning message that can be turned on, but is off by default.
It would be very positive for our business when millions of companies discover how crap their websites are under the bonnet!
I think that if there are missing closing tags, a nice little icon in the corner and bubble message saying the site may not display correctly would really push the cow-people out there to invest in writing valid code.
However, if there's a missing alt tag on an image it should be an accessibility warning message that can be turned on, but is off by default.
It would be very positive for our business when millions of companies discover how crap their websites are under the bonnet!
#6
Posted 01 August 2008 - 08:18 AM
Interesting topic, good debate so far.
Personally I think stricter standards should be enforced, with the industry being so accessible (and the anonymity of the web) anyone can set up their own web site design company. Not that I'm saying that's a bad thing, simply clients (and ultimately the end users) would benefit from hopefully better coded sites.
Now some people think "who cares about valid code, so long as the site looks and functions as it should do across the top five or so browsers?", so there's the flip side to the argument.
I think ultimately sloppy code, and browsers best attempt to to run it, should be something every coder strives to eradicate when coding (just look at the "...valid xhtml and css" mantras on nearly all design sites).
Of course the other thing is (which annoys me even more) is people using half decade old web browsers. What's the point in standards, and browsers being compliant, when the end user has an out-of-date browser which is more likely to reward sloppy code?
Personally I think stricter standards should be enforced, with the industry being so accessible (and the anonymity of the web) anyone can set up their own web site design company. Not that I'm saying that's a bad thing, simply clients (and ultimately the end users) would benefit from hopefully better coded sites.
Now some people think "who cares about valid code, so long as the site looks and functions as it should do across the top five or so browsers?", so there's the flip side to the argument.
I think ultimately sloppy code, and browsers best attempt to to run it, should be something every coder strives to eradicate when coding (just look at the "...valid xhtml and css" mantras on nearly all design sites).
Of course the other thing is (which annoys me even more) is people using half decade old web browsers. What's the point in standards, and browsers being compliant, when the end user has an out-of-date browser which is more likely to reward sloppy code?
#7
Posted 01 August 2008 - 08:55 AM
@Eris - alt "tag", or alt "attribute"? 
I think valid markup is definitely important, but it's not the be all and end all. You can have valid markup which results in a completely unusable and inaccessible site, but hey, it'll still get you through the W3C validator.
I think valid markup is definitely important, but it's not the be all and end all. You can have valid markup which results in a completely unusable and inaccessible site, but hey, it'll still get you through the W3C validator.
#8
Posted 01 August 2008 - 03:25 PM
Proper browsers (read: not IE) WILL fail to render a page if it contains errors, if it served as application/xml+xhtml instead of text/html. If only it was better supported by certain browsers.
Blah.
Blah.
#9
Posted 01 August 2008 - 03:35 PM
#10
Posted 01 August 2008 - 10:37 PM
Seth, on Aug 2 2008, 03:35, said:
I might look weird but...
Oh come on Seth, you don't look that weird! OH, I think you meant "It might".
I'm glad to see I haven't been shot down completely and folks seem to agree that, at the moment, standards compliance doesn't equal good coding. You can have a terrible case of divititus that renders your code completely non-semantic, you can design completely unusable and inaccessible sites and still have the little w3c tick. Vice-versa, you can have a site that's not valid but is accessible and usable.
Hopefully the standards will catch-up with what's really needed, draw a line in the sand and say "from now on...". Like Eris said, if old sites have to be re-written then all the more work for you! At some point this must surely happen? In ten years time will advancement still be held back by sites coded in the 90's? People and the search engines like fresh content so, if a sites so out of date with it's coding, maybe it deserves not to work if legacy crap is dropped!
Share this topic:
Page 1 of 1
Help





















