5 ms·
Why is Google's source/HTML structure unreadable?
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?
- aualin 13y agoThey have open sourced the tools for this: https://code.google.com/p/closure-stylesheets/#Renaming https://code.google.com/p/closure-stylesheets/#Renaming The stated reason is to reduce file size.
- Tangaroa 13y agoI 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 http://stackoverflow.com/questions/807119/gzip-versus-minify
- jfoster 13y agoIt may just be a side effect of minifying the code.
- Another_one 13y agoThe 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.
- hnriot 13y agoActually 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.
- jaredsohn 13y agoI 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.)
- deleted 13y ago[deleted]
- barryhunter 13y agoA lot of their products are built with GWT https://developers.google.com/web-toolkit/ 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.
- samplonius 13y agoGoogle 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.
- wglb 13y agoThink 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.