Live data from Hacker News

Minification Is Evil

todepond.com

31–40 of 93 posts

Re: Minification Is Evil

#31
post #21

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?

How big is your JS that minification has measurable performance impact? In my experience, minification doesn't add much (if anything) on top of gzip + cache for most applications.

Re: Minification Is Evil

#32

Earlier quoted context omitted.

Doesn't really matter after compression unless the bulk of your code can be culled from the end product. Tbh the largest business value this has is slowing down people trying to use your internal APIs.

Can client/browser choose if to use compression? If so, this is a problem for the website

Yes, HTTP Accept-Encoding

Re: Minification Is Evil

#33
post #19

Earlier quoted context omitted.

Doesn't really matter after compression unless the bulk of your code can be culled from the end product. Tbh the largest business value this has is slowing down people trying to use your internal APIs.

It would be nice to have experimentally-derived numbers to point to in order to help people visualize whether or not minification actually improves compression to any significant degree.

I've seen the same thing with different jQuery versions: https://stackoverflow.com/questions/3239125/is-there-any-poi...

At least with jQuery, it seems that minification matters considerably.

Re: Minification Is Evil

#35
post #20

With GZIP and moreso Brotli the difference in actual data transfer is negligible anyway. Minification doesn't really achieve much other than obfuscation these days.

First of all, you're probably bundling your code, stripping comments, have tree-shaking eliminate parts of it. That's already a form of obfuscation. Then, minification will affect performance of parsing, it can even affect whether a function gets inlined by the JIT compiler, because character length is a very cheap heuristic. Whether I care about that or not is my judgement call.

Re: Minification Is Evil

#36
post #4

Earlier quoted context omitted.

Not much to read really, it's not even an "article". But I agree, there is not really much point to minification for small or medium websites. Transport compression takes care of file sizes.

Minification is the "feel good" optimization for frontend (ahem, full-stack nowadays) developers that want to feel like they are doing FAANG-level optimizations.

What would be worthwhile optimisation to do?

Re: Minification Is Evil

#37
I have my personal website on GitHub. It gives much more than "not minified code". 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).

Re: Minification Is Evil

#38

I don't understand; I'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'd rather open-source my code.

which is actually a security risk

If people seeing your frontend code is a security risk, I've got some bad news for you...

Re: Minification Is Evil

#39
post #21

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?

Hi. Article writer here. Sourcemaps are pants and a nightmare to deal with.

I make up for performance in other ways! Let me know if any part of my website(s) run slow

Re: Minification Is Evil

#40
post #21

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?

Yep. This is basically like saying "don't distributed compiled binaries"

I'm sure some people here will agree with that sentiment, but for the majority of users it's the better option. And if the goal of the project is for the source to be open then they can host that source somewhere for those who want to tinker, inspect, or build their own binaries.

At some point most web apps will probably be blobs of WASM anyway.

Post reply on HN