Why is Google.com's source code so messy?

- 1 answer

Ad

I'm just wondering why Google.com, one of the most minimalist websites, has a so messy HTML source code.

Two main questions:

  • Is it a sort of obfuscation in order to keep parts of the code "secret"?
  • Has anyone ever tried to explain it?
Ad

Answer

Ad

Two things I can offer to help understand what's going on with google.com

  1. While the displayed content on the page is simple, there is a lot going on in behind the scenes to understand your browsing history, cookies, etc. to serve up dynamic content such as preset search results and ads, of course. In addition, while every piece of google.com looks simple but has much more going on behind it. The search bar gets populated with a drop down of search results as you type. Apps in nav bars get loaded as you drop in. The language of the site can change instantly. All of this is quite complex.
  2. All of this code has been minimized and files have been concatenated together to reduce page load time, making it look really messy. You're right in that google isn't interested in making the code you can see on their main page understandable. Their goal is to serve you the best possible experience. Hopefully that clears some of it up!
Ad
source: stackoverflow.com
Ad