Hacker News new | ask | show | jobs
by WorldMaker 1268 days ago
I worked on a project once and had to prove to several team members that their very slow minification tool in the build process might be reducing the uncompressed size by seemingly quite a bit, but was kind of inflating the compressed size and making the site slower for everyone in reality than the unminified files shipped directly to the user. Performance work is generally underappreciated anyway, but that was particularly underappreciated performance work. "Everyone says minification speeds up the sites! That's just best practices!" versus "Did you actually test this or look at this performance tools?"
1 comments

Minification isn’t just about reducing size of the output, it also has the very important side effect of obfuscating the output to make it difficult if not practically impossible for reverse engineering and compromising of IP. That is a critical aspect that businesses will always opt for. And business use cases drive things like Typescript into existence.
Anyone who believes minification counts as "proper" obfuscation misunderstands both. Minification is not obfuscation. They have different goals. Most "good" obfuscators are the exact opposite of minification: to obscure business logic they expand the code into sub-parts more akin to assembly language than the original logic. "Good" obfuscation is much more than just using shorter variable names everywhere.

Minification is especially not sufficient for obfuscation in a world with pretty printers embedded into every Dev Tools in every browser.

Minification is just about reducing the size of the output. Any business that truly cares about the safety of their IP should look into "proper" obfuscators.

(Personally, I don't think obfuscators are generally worth the build time and their output worth the extra bandwidth either, but yes there I understand that security theater generally beats performance concerns.)

It offers no real protection against anyone who cares.

And it obstructs people who are going out of their way to improve their usage of your site. It's a pity we only see the risk in that, that the miserly antagonistic corporate dominion attitude rules, that is afraid, that quakes at users doing things not on the l blessed path.

This attitude you've very well spoken for bespeaks a great rot & sadness in the world, one that developers should actively try to work against as much as they can.