By Posted in - Code on November 12th, 2012 minify-google-icrunched

I am sure that you have opened up someone’s .js or .css file and have found one looooooooong line of seeming gibberish.

This is “minifying”, also called “packing” or “compressed” (not to be confused with zipping or tarring a file).

Here are a couple of good unminifiers that I have been using in order to view someone’s code to see how they did something:
JavaScript Beautifier, and, Mr Coles CSS Unminifier.

Now, why would someone pack their code?
Well, the number one reason is to hide the source from prying eyes but, honestly, this is like using a twist-tie to lock your front door. Way too easy to override. Just see the above two links. Besides, the coder hiding their code probably learned a lot from dissecting others code. Seems a bit hypocritical, not to mention self-important. And you know what? It is a pain in the arse having to keep a packed and unpacked version and trying to keep them straight.

The second reason, which makes more sense, is to speed up parsing and execution. Does this work? No idea. You would really need some seriously controlled lab experiments to figure that out. Transfer speeds at home fluctuate way too much. There is no way that you could do a quantifiable test.

Regardless, here are a couple of good packers if you want to experiment…
Dean Edward’s JS Packer (the industry standard), and, CSS Compressor.

Please leave a Comment...