Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> CSS classnames were manually named with 1-3 character abbreviations, with a dictionary elsewhere, to save on bytesize.

Not to take away from your effort, but that sounds like something a minifier should be able to do, right?

Edit: Yep, you said it below:

> A lot of these convolutions should've been done by compiler, and indeed, a lot were moved to one when we got an HTML-aware templating language.



Yeah. The issue was that there were two other constraints that had to be satisfied at the same time: CPU time to render the page couldn't go up appreciably (or we'd run out of machines), and there was a lot of legacy HTML and JS to update. Google actually had a CSS compiler at the time (since open-sourced as Closure Stylesheets), but it required that you run every JS reference of a classname through goog.getCssName (which was prohibitive because we couldn't use Closure in the JS for bytesize reasons), and that you post-process the HTML (which was prohibitive both for CPU reasons and because Closure Compiler is written in Java while the HTML for Google Search, at the time, was generated in C++).




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

Search: