Web Design Forum: How should web browsers treat sloppy or incorrect code? - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How should web browsers treat sloppy or incorrect code? Rate Topic: -----

#1 User is online   BlueDreamer 

  • Web Guru
  • Group: Moderators
  • Posts: 5,804
  • Joined: 23-October 07
  • Reputation: 203
  • Gender:Male
  • Location:Northampton (where?)
  • Experience:Advanced
  • Area of Expertise:Web Developer

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?
0

#2 User is offline   Mihai Georgescu 

  • Advanced Member
  • PipPipPip
  • Group: Members
  • Posts: 338
  • Joined: 04-May 08
  • Reputation: 0
  • Location:Suffolk, UK
  • Experience:Web Guru
  • Area of Expertise:Coder

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.
0

#3 User is offline   wizely 

  • Word Designer
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,528
  • Joined: 12-April 08
  • Reputation: 84
  • Gender:Male
  • Location:UK/NZ
  • Experience:Web Guru
  • Area of Expertise:Copywriter

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! :D
0

#4 User is offline   Seth 

  • Debugging the world of code one line at a time.
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 1,225
  • Joined: 18-February 08
  • Reputation: 8
  • Gender:Male
  • Location:Philadelphia-Metro, USA
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 01 August 2008 - 05:13 AM

:hi: I think that browsers should still allow not total valid code but should display a small icon saying that the site may view differently depending on the users computer and other variables. Validity is great, but sometimes, a site just can be totally valid. Now I hear people screaming already and I understand why.... Honestly in a perfect world web sites would all be to standard and view correctly on everyone's screen and you'd be a whole lot freer to do what you wanted with your site. But it isn't that way and sometimes sites work even though they aren't valid and they work fine across the whole spectrum.

Who's in charge of what the standards are anyway (haha don't answer that I actually know the answer) 8)
0

#5 User is offline   ErisDS 

  • Evil Moderator
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,663
  • Joined: 16-January 08
  • Reputation: 25
  • Gender:Female
  • Location:Northants, UK
  • Experience:Web Guru
  • Area of Expertise:Web Developer

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!
0

#6 User is offline   Mesa 

  • Expert
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 769
  • Joined: 30-July 08
  • Reputation: 5
  • Gender:Male
  • Location:Wirral
  • Experience:Advanced
  • Area of Expertise:Web Designer

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?
0

#7 User is offline   Rachael 

  • Princess.
  • PipPipPipPipPip
  • Group: Members
  • Posts: 1,390
  • Joined: 14-October 07
  • Reputation: 0
  • Location:Northants, UK
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 01 August 2008 - 08:55 AM

@Eris - alt "tag", or alt "attribute"? :pp

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. :(
0

#8 User is offline   splashtech 

  • Dedicated Member
  • PipPip
  • Group: Members
  • Posts: 146
  • Joined: 20-March 08
  • Reputation: 0
  • Location:Bournemouth, UK
  • Experience:Advanced
  • Area of Expertise:Web Developer

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.
0

#9 User is offline   Seth 

  • Debugging the world of code one line at a time.
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 1,225
  • Joined: 18-February 08
  • Reputation: 8
  • Gender:Male
  • Location:Philadelphia-Metro, USA
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 01 August 2008 - 03:35 PM

:hi: to be honest, most browser, proper and not proper will view your site if it's not valid standard code. I might look weird but it will view something most of the time. 8)
0

#10 User is offline   wizely 

  • Word Designer
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 2,528
  • Joined: 12-April 08
  • Reputation: 84
  • Gender:Male
  • Location:UK/NZ
  • Experience:Web Guru
  • Area of Expertise:Copywriter

Posted 01 August 2008 - 10:37 PM

View PostSeth, 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". :lol:

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! :lol:
0

#11 User is offline   Seth 

  • Debugging the world of code one line at a time.
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 1,225
  • Joined: 18-February 08
  • Reputation: 8
  • Gender:Male
  • Location:Philadelphia-Metro, USA
  • Experience:Advanced
  • Area of Expertise:Designer/Coder

Posted 01 August 2008 - 11:17 PM

Oops yea! haha 8)
0

#12 User is offline   Mesa 

  • Expert
  • PipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 769
  • Joined: 30-July 08
  • Reputation: 5
  • Gender:Male
  • Location:Wirral
  • Experience:Advanced
  • Area of Expertise:Web Designer

Posted 01 August 2008 - 11:32 PM

View Postwizely, on Aug 1 2008, 23:37, said:

In ten years time will advancement still be held back by sites coded in the 90's?


In ten years time people might be using IE7 or heaven forbid 8, who knows what crazy future lies in wait. :rolleyes:
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users