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

The "grep test" doesn't just help humans and IDE's. Closure Compiler's ADVANCED_OPTIMIZATIONS mode (https://developers.google.com/closure/compiler/docs/api-tuto... ) only works with JS code that can pass the "grep test". Setting or getting properties using dynamically generated property names won't work (even if Closure Compiler could understand your intent, it would have to know at runtime which minified name the concatenated parts should result in).

So in this case, writing longer, "grep-friendly" JS code can actually reduce the size of the JS payload you serve to your users.



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

Search: