Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I was a little surprised that Amazon's site doesn't specify a doctype, and is rendered in quirks mode. What could possibly be the reason for this? I understand what quirks mode is and why doctypes were introduced, but I can't understand why this would be intentionally left off.

I guess it might simplify markup if they're trying to support ancient browsers, but isn't that like shooting yourself in the foot when it comes to modern browsers, especially when their site is so Javascript rich? Does this level the playing field when it comes to supporting really old browsers?

Is there something else I'm missing?

share|improve this question
    
AFAIK, doctype and rendering mode don't affect how JavaScript is processed. It only affects how HTML and CSS are processed. Though I'm not sure why Amazon still isn't using a standard rendering mode. –  Lèse majesté Jan 14 '11 at 5:11
1  
It does impact JavaScript, or at least DOM. Internet Explorer 8 will treat name as id for the purposes of getElementById — but only in quirks mode. –  Quentin Jan 14 '11 at 7:29
1  
The doctype does indeed effect Javascript, newer features like DOM storage aren't supported when IE is in compat mode or quirks mode. That's just one example I know of off the top of my head. –  wsanville Jan 14 '11 at 13:53
    
Great question. I dug in a little deeper on the Amazon site and they are actually doing a lot of things wrong regarding how they layout their content. I'm wondering if this isn't a mistake on their part that just hasn't been caught yet, but they really have way too many web dev's to make a rookie mistake like this. I'd love to know why they are doing this. –  XOPJ Jan 14 '11 at 14:34
    
Not sure how Amazon is a new web site? –  Alex Angas Feb 13 '11 at 21:57
show 1 more comment

3 Answers 3

To answer the question in your title of whether there are any good reasons to use Quirks for a new site - no there aren't. Standards greatly increase cross-browser compatibility, making development much easier and faster.

To answer your question of why a site like Amazon uses Quirks - firstly, they aren't new (their first sale was in July 1995), and secondly, it's probably not cost effective for them to change.

Unfortunately, good quality standards haven't been around throughout web development history. A site as old as Amazon is likely to have needed hacky tricks to make everything work up to this point, all of which would have to be rewritten. As JamesRyan says, it's a lot of work to update an entire site to use standards. A part of this is updating code, but I'd argue a more significant part is in time-consuming testing. Then there's the significant risk of lost income due to introduced bugs, which would affect revenue and in serious conditions, market value (probably only temporarily).

Amazon works, and works pretty well. Considering that and the risks involved, how do you think the business would justify making the site standards compliant, when it would mean average Joe User miss out on new features that will gain Amazon more revenue?

share|improve this answer
1  
In most cases, it's more cost effective in the long run to follow standards than not. Non-standard code can produce unpredictable results in different browsers. Standardized behavior is just that. All standards supporting browsers will behave the same. Also, if current browsers support the standardized behavior, it won't likely change. That's one of the benefits of doctypes. Even if a new standard comes out, browsers will continue to honor existing doctypes. So given a standard and nonstandard way of doing the same thing, it's almost always more cost-effective to follow web standards. –  Lèse majesté Feb 13 '11 at 23:50
2  
'Standard' code can produce unpredictable results in different browsers too. The problem is the main benefit of html standards has never materialised with all browsers still rendering things differently and requiring independant testing. So making something that works is still better than making something that is standard. –  JamesRyan Feb 14 '11 at 12:05
    
Anyone who's been in web development for the past 15 years has seen the significant benefits of web standards. Perhaps you're too young to recall the days of Netscape and IE4, but web development is much less painful today due to increased support of standards. Just because 1-2% of the standard isn't implemented doesn't mean the benefits of standards are lost. The fact remains, your non-standard code has less chance of cross-browser compatibility than standard code. You can't even count on the same behavior from version to version of the same browser, much from across different browsers. –  Lèse majesté Feb 15 '11 at 0:56
    
@Lèse: I don't think anyone's saying that standards shouldn't be followed. Anyone that starts a new site would be crazy not to base it on web standards for the very reasons you've outlined. However Amazon has been around for a long time. It's not as simple as changing a few lines of HTML. (It may even be worth considering as part of a site overhaul, because it's pretty likely functionality will change for at least some users anyway.) In conclusion, if your web site drives your core business, these changes are risky and testing has to be rock solid. Bugs could cost revenue and market value. –  Alex Angas Feb 15 '11 at 3:00
    
@Lèse: I think there are some wires crossed here due to way the OP has written their question (calling Amazon a new site). I've rewritten my answer to compensate. I hope your "Perhaps you're too young" comment isn't intended to be condescending. I've been developing web sites for a little over 14 years and absolutely know what you are talking about. –  Alex Angas Feb 15 '11 at 3:27
show 2 more comments

Probably because their site is massive and the work required to update it all and test that it looks right across the site in all browsers is a huge amount of effort for little or no gain.

The browser world changes so rapidly, you can look at pretty much any major site and they will be using something that has a newer better alternative.

share|improve this answer
    
That's an interesting hypothesis, but I imagine any large site like Amazon has probably been engineered to a sufficient degree and with SCM mechanisms in place to make code updates manageable. And even though browsers change fairly rapidly, it's mostly predictable change. That's another benefit to complying with standards. –  Lèse majesté Feb 13 '11 at 21:21
    
You can manage changes as efficiently as you like, but there is still a base cost to actually do and test the change itself. –  JamesRyan Feb 14 '11 at 12:09
    
There exists a base cost for everything. There's a base cost to implement changes on a small site as well. What's your point? Yes, sites like Amazon and Google are huge, but so are their web teams. And developers of large applications also place great emphasis on maintainability. If they can't manage something as simple as changing doctypes without breaking the site, then how could they possibly roll out more complex changes like new features, revamped designs, or infrastructure changes? –  Lèse majesté Feb 15 '11 at 1:09
    
something seemingly as simple as changing the doctype could drastically change how pages are rendered and even break parts of a site entirely for swathes of users. Its a simple change that causes a complex result. Not to mention the bigger the system the higher overheads of a small change compare to the benefit. Do you not get that a large team can not act as efficiently? It seems to me that you are just being argumentative. –  JamesRyan Feb 16 '11 at 23:49
add comment

Bandwidth.

(Which is to say: you're looking at this the wrong way and so asking the wrong question. Quirks mode is just a side-effect of what they're actually doing.)

Your immediate reaction to this will be that it couldn't possibly be much. But multiply that small amount by their traffic, and it suddenly becomes a real number. Sites like Amazon(Google, Yahoo...) have to take things into consideration that you might never even think about, and also employ cheats that would normally be unacceptable if you're just going for standards compliance, but are still workable.

If Amazon ever does use local storage, or anything else quirks mode would definitely break, you'll see a doctype get added immediately; right now though, it's a technically correct but also theoretical(in this context) argument.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.