TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Minification Is Evil

46 点作者 tpetrina超过 1 年前

20 条评论

jmull3n超过 1 年前
Don’t agree with this take. Sacrificing the performance for all my users so a minuscule percentage of them can poke around a little easier? All the JavaScript is likely transpiled anyway. They can use dev tools to unminify most of it. Deploying with source maps for production might be a better ask?
评论 #38380416 未加载
评论 #38380502 未加载
评论 #38385126 未加载
评论 #38380320 未加载
评论 #38380628 未加载
评论 #38380497 未加载
PaulHoule超过 1 年前
Not minifying your code is evil from the viewpoint of people who have to wait for your page to load.
评论 #38380128 未加载
评论 #38380025 未加载
评论 #38380447 未加载
评论 #38380367 未加载
评论 #38380505 未加载
评论 #38380185 未加载
评论 #38380605 未加载
lcnPylGDnU4H9OF超过 1 年前
The three lines of not-haiku made me want to write a haiku.<p><pre><code> Do not minify Your front end is insightful Let people inspect</code></pre>
评论 #38380200 未加载
Zealotux超过 1 年前
I don&#x27;t understand; I&#x27;m not going to increase the size of my assets just to please the very small minority of hackers who want to play around. I&#x27;d rather open-source my code.
评论 #38380646 未加载
评论 #38380289 未加载
donatj超过 1 年前
With GZIP and moreso Brotli the difference in actual data transfer is negligible anyway.<p>Minification doesn&#x27;t really achieve much other than obfuscation these days.
评论 #38380455 未加载
评论 #38380591 未加载
评论 #38380413 未加载
sanitycheck超过 1 年前
Sadly, not minifying source code can often lead to your idiot customer discovering that their web app is not a magic binary blob and complaining that it&#x27;s &quot;insecure! anyone can see how it works!&quot;, which then in turn leads to your idiot PM agreeing to a new &quot;obfuscate all code&quot; feature without bothering to involve anyone technical.<p>Deliberately obfuscated JS is <i>far</i> more evil, take it from someone who&#x27;s had to debug 3rd-party obfuscated JS libs.
评论 #38380601 未加载
gustavus超过 1 年前
Minification always struck me as a cargo culting type way that &quot;badass rockstar programmers would get every last ounce of performance&quot; out of their code.<p>Because as noted below minification is much less impactful than compression, but going even further, if you really care about performance the solution is as simple as not shoving 20 metric boatloads of JavaScript in your website in the first place.<p>If you&#x27;re argument I&#x27;d &quot;muh rural customers&quot; then maybe you should actually look at how your website is designed and ask yourself if you need to ship 3 different frameworks to accomplish what you need to do, or maybe start by stripping out the bloated analytics and ad nonsense in your code.<p>At the end of the day the author is right, the arguments about whether minification is useful is a teachincal argument, but the business will always want it for the purposes of obfuscating their code, and so we need to push back against the idea of it being an industry norm otherwise managers will push to make it so.
JodieBenitez超过 1 年前
Hey... good to see this. I was never convinced about this for small to medium JS code base while serving through mod_deflate or similar.
toss1超过 1 年前
Soooo long gone are the days of the really compact website<p>There used to be a contest for best website that would fit into 5k bytes. [0]<p>Now, the bloat is so bad that there is a serious suggestion to nevermind the website, just make people download the entire cargo load and use it locally, merely to get acceptable performance.<p>If this does not tell us that the entire framework thing has gone too far, abstracted everything from actual speedy code, larded everything up with so much &#x27;just in case&#x27; baggage code, etc... IDK what will.<p>[0] <a href="https:&#x2F;&#x2F;www.the5k.org&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;www.the5k.org&#x2F;</a>
explaininjs超过 1 年前
Lots of folks outing themselves as never adding comments with remarks like &quot;compression works nearly as well as minification&quot;.<p>In some of my more logically involved code, the bulk of the bytes are in comments - and they barely compress at all.<p>Just minify. Nobody cares about your source code; if they do and you want them to, publishing on GitHub is far better as it allows for viewing the TS&#x2F;ESNext version and separate files too (don&#x27;t tell me you aren&#x27;t bundling!!); and working with minified code is not hard, especially now that dev tools have built-in maxifiers.
评论 #38382591 未加载
tpetrina超过 1 年前
In the modern era of minifying JS to squeeze out bytes, in certain cases, for smaller, non-commercial sites, it might be better for devs to learn from reading each other&#x27;s source code.
qwery超过 1 年前
This is cute. It&#x27;s refreshing to see such a simple idea published on the internet in such a way. I also got a kick out of the URL.<p>Thanks for submitting it!
nsonha超过 1 年前
Why is everything on the web has to serve some random tinkerer who do not benefit the creator of the website in any way? How about we apply this thinking to other kind of products? An app has to be designed for tinkerers to? A cars, a rockets?..., so everything has to be open source? Why?
stared超过 1 年前
I have my personal website on GitHub. It gives much more than &quot;not minified code&quot;. And actually, I had one interesting email on a widget I created (weighted sorting of blog posts, so it is up to the user to weigh novelty, popularity, my opinion, etc).
Havoc超过 1 年前
Surely better tools to analyse stuff is a better answer.<p>Think ASM disassemblers - arguably a harder task and people do fine with it
Veuxdo超过 1 年前
Think of the lives lost to javascript minification.
eloy超过 1 年前
I think minification should be done on another layer: HTTP compression and HTTP parallelization and that kind of stuff. And just don&#x27;t make a complex web app, so it will be fast.
评论 #38380581 未加载
incrudible超过 1 年前
No.
djaouen超过 1 年前
Didn’t read the article, but I agree with the title lol
评论 #38379926 未加载
colesantiago超过 1 年前
Hard disagree.<p>Nobody cares about the source, let website authors do what they want.