Hacker News new | past | comments | ask | show | jobs | submit login
Why is Google's source/HTML structure unreadable?
11 points by cmstoken on May 12, 2013 | hide | past | favorite | 9 comments
I'm not talking about the homepage, but almost all of their in-house services/products: gmail, google+ etc...

When you inspect element all the classes and ids are short and obscure, changing each time the page is loaded. I'm sure on the developers' end it's all human readable and the server is generating all that mess but my question is why would they do this?

Is there any benefit to making their source (which most bots can't crawl anyway because of JS) obscure and unreadable? Is it to prevent something?




They have open sourced the tools for this: https://code.google.com/p/closure-stylesheets/#Renaming

The stated reason is to reduce file size.


I would imagine that http gzip compression would cut transmission size just as well regardless of whether the file text is minified or not.

And I would be wrong; this guy found that gzipped minified text can be 50% smaller than the original gzipped file: http://stackoverflow.com/questions/807119/gzip-versus-minify


The html, css, and javascript are compressed. Compressing the files would reduce propagation delay making happier users. Also the slightly reduced bandwidth requirement probably saves google a pretty dime when you consider the number of requests they have.


Actually compressing doesn't make any difference to the propogation delay since that's the time to the first byte, which remains the same, irrespective of data size. In fact, if compression is performed on the fly, then it will likely increase propogation delay. You're probably referring to transmission time, which is a function of data size.


A lot of their products are built with GWT https://developers.google.com/web-toolkit/

which compiles the client side code automatically.

So its more that the code is auto-generated (and because its generated it doesnt need to be readable), rather than deliberately obscured.


Google has turned GWT over to an external team and is no longer using it for new apps.

Google has been using AngularJS for some new sites.

But no matter how you do it, single page apps usually result in a heavily minified representation.


Think of HTML as assembly language. When I was writing compilers, my boss told me "A good compiler should generate assembly language that an assembly language programmer would be fired for writing".

And so it is with HTML.


It may just be a side effect of minifying the code.


I don't know if it is done intentionally or not or if it has any value to Google, but it makes it a lot harder to write browser extensions that interact with those sites. (If you open the console when running Rapportive on gmail, for example, you can see through their logging what work is required to overcome it.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: