40

So, I couldn't help noticing while demonstrating Chrome's DOM browser thing to my brother, that Google uses a <font size=-2> tag.

I know this is a stupid question, but from a programming point of view--why would they use a deprecated tag on Google? Is it because it's smaller than using <p class="whatever"> and then creating a style for it, or just going <p style="font-size: x-small">?

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
Carson Myers
  • 37,678
  • 39
  • 126
  • 176

3 Answers3

107

In November 2005, Matt Cutts, a Google software engineer, said:

Google’s home page doesn’t validate and that’s mostly by design to save precious bytes. Will the world end because Google doesn’t put quotes around color attributes? No, and it makes the page load faster.

Source: Google Blogoscoped - Matt Cutts, Google’s Gadgets Guy (Interview)

Daniel Vassallo
  • 337,827
  • 72
  • 505
  • 443
  • 2
    ceejayoz: +1 for your intuition, even without a good source. A merited Enlightened badge :) – Daniel Vassallo Dec 27 '09 at 22:54
  • 1
    Interestingly...they serve their home page gzipped. Deflating it would be both faster (to compress/decompress) and at least 4 bytes smaller in every case. – David Murdoch Apr 29 '10 at 11:43
74

Saving a few bytes on the Google homepage likely saves them terabytes of transfer bandwidth.

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • you're right, I figured this after I looked at the source outside of the DOM browser and saw that it was all condensed – Carson Myers Dec 27 '09 at 22:17
  • 30
    Google is almost certainly using gzip compression too. So the savings are less significant after compression but probably still significant at Google's scale. At **your** scale, the savings are almost certainly **insignificant** (no offense). Don't use the `` tag just because Google does. – Asaph Dec 27 '09 at 22:20
9

Space saving issues is certainly one reason google might use the font and center tags. Another reason could be for compatibility.

It's in google's best interest to make their homepage to work in all browsers, including pre-IE6 and mobile browsers. Since the font and center tag are so ancient, they're almost universally supported.

Xavi
  • 20,111
  • 14
  • 72
  • 63
  • 2
    I really doubt that Google has an interest in being compatible with 13 year old browsers. This would contradict their efforts to push for rich web applications like GMail and Google Docs. – Daniel Vassallo Dec 28 '09 at 02:00
  • 9
    The google home page makes billions of dollar. GMail and Google Docs make tens of million, maybe hundreds millions? Which "effort" do you think Larry and Sergey are optimizing for? – Xavi Dec 28 '09 at 02:17
  • Centering content is notoriously hard to achieve with just CSS, even with modern browsers. Using the `center` tag is a widely supported alternative. Also, it's extremely difficult to surmise a corporation's intentions from the outside. I'm just trying to present a possible reason why google would do something so strange. – Xavi Dec 28 '09 at 03:17
  • 12
    Centering content in CSS is easy. `margin: 0 auto` for block-level elements, `text-align: center` for non-block elements. – ceejayoz Dec 28 '09 at 03:27
  • 6
    Assume "ancient" browsers make up 1% of google's traffic (this may actually be conservative -- old browsers, bad mobile browsers, obscure things like screen readers for the blind...). Assume google makes 1 billion a year in revenue from search traffic (this may be conservative). Increasing revenue by 1% would mean $10 million a year. – Frank Farmer Jan 08 '10 at 20:52