TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

An Argument Against JavaScript Minification

25 pointsby soofaloofaabout 14 years ago

9 comments

jdietrichabout 14 years ago
Minification is <i>vital</i>. It has been widely reported that an extra 100ms in latency costs Amazon 1% of their sales. Google found that 500ms of extra latency reduced traffic by 20%. Optimising page load time is one of the cheapest and simplest ways of improving user experience and so your business.<p>Sacrificing profits and UX for a few hypothetical developers is lunacy. If you really want to share the wealth and let newbie developers read your source, blog about it or submit it to Github - then you can include explanation of your design and make it far easier for them to get the interesting bits.
评论 #2532983 未加载
评论 #2532965 未加载
marcusboosterabout 14 years ago
This sounds more like an argument for open source. Ignoring efficiency issues, I'd much rather view a JavaScript framework on GitHub than in a View Source window.
wccrawfordabout 14 years ago
If you want to share your code with others, open source it. There's no need to not-minify it so they can see it.<p>I don't see this an an anti-minification argument at all. Instead, it's an argument for open source in disguise.
评论 #2533890 未加载
kilianabout 14 years ago
Here's how I do it: minified versions are used in the site, if someone wants to see my code, they can remove the "min" part:<p>used on site: <a href="http://laserey.es/media/javascripts/base.min.js" rel="nofollow">http://laserey.es/media/javascripts/base.min.js</a><p>non-minified: <a href="http://laserey.es/media/javascripts/base.js" rel="nofollow">http://laserey.es/media/javascripts/base.js</a>
phaylonabout 14 years ago
People "learning" by copying, coupled with large popularity, are what gave JavaScript, PHP and Perl such bad reputations. There are tutorials for most of the things newcomers might want to do in JavaScript. As such, I wouldn't place much value in people copying my work when deciding if minification is necessary.<p>I assume we're talking about individual per-site code here, since they can always download non-minified versions of commonly served frameworks easily somewhere else.
评论 #2533417 未加载
评论 #2533072 未加载
lyimeabout 14 years ago
This is an easy problem to solve.<p>Include paths to the original JS files (un-minified) at the top of the minified JS file as comments.
tszmingabout 14 years ago
Some modern compressors such as YUI Compressor use real JS engine to parse your script and therefore can detect syntax error during minification, I can't see any reason why not using it.
yuhongabout 14 years ago
I remember FSF's "free" JS campaign, and it basically comes down to something like this.
nicetryguyabout 14 years ago
prettyprinter.de