News for hackers. Stuff that matters.
Re:The smallest JavaScript libraries on the internet by yread on Tuesday February 02, 2016 @06:39AM (#11018853)
I'm wondering for some time if the minification could be done in a way that would help the gzipping achieve better ratios.

For example if you have to minified function and one has three local variables and the other two it might be beneficial to minify it as "var a, b;var c;" if there are a lot of functions with two parameters a only one with 3. Or always assign "this" to a variable called "t" so that "t=this" (or "var t=this;") is repeated often.

This seems to be low hanging fruit but there is a lot of microoptimizations like that even if it saves <5% like this brute forcing it might be worthwhile.

Re:The smallest JavaScript libraries on the internet by hawski on Tuesday February 02, 2016 @07:29AM (#11019040)
Google's Closure Compiler does something like this [1].

It also reminds me of Stack Overflow in 4096 bytes [2], where author also tried to write code that would compress more.

[1] https://github.com/google/closure-compiler/wiki/FAQ#closure-...

[2] http://danlec.com/blog/stackoverflow-in-4096-bytes