hey wait

if you gzip everything anyhow, why do you ever need to do minification? it doesn't look like you save very much by doing it

@KitRedgrave it speeds up JS and CSS lexing/parsing as well as reducing file size, but that's not much of a factor these days unless you're working at Web Scale

@vyr yeah, i'm really not. thinking that for something like a personal website to just throw random toys onto, it's not really necessary.

and i feel like i would rather not make the source look like absolute hell in the browser. would like to make it easy for the few people who bother to look :)

@IceWolf @KitRedgrave galaxy brain: minify everything but provide source maps 🗺

@vyr @KitRedgrave All that does is make it so you need special tools to look at the source.

@IceWolf @vyr to be fair, special tools that firefox and chrome just ship with by default in the dev tools, where you'd probably be anyway if you're looking at the source

@KitRedgrave @vyr Yeah, but still. Makes things complicated for [as far as I can tell] zero benefit.

@KitRedgrave @vyr And it means if you're looking at websites in anything that /isn't/ Firefox or Chrome, you're kinda screwed.

(Which is a reasonable thing to expect you can do for most websites I'd say. App Websites maybe not but most sites aren't that.)

@KitRedgrave technically it does reduce parse time. And takes up less space in cache and maaaaaaybe speeds code up due to shorter identifiers but I'm just speculating on that one

Also more people know how to minify than know how to get their server to use gzip I think

@KitRedgrave Honestly I don't know how many of these are actually significant if any

In some js engines it can have performance impact because the jit will use very rough heuristics like "number of chars in a function" to determine if it's a candidate for optimization.

@dsavage @KitRedgrave there was a rather famous(ish?) bug where someone added a comment to some code and it caused the app to run 40× slower or some such…

@KitRedgrave makes understanding the source code harder - for many companies this is seen as a benefit

@KitRedgrave .m
webdevs: minify the js!!!
also webdevs: make sure you include these long-ass licensing comments, v important, gotta have those

@KitRedgrave It's still smaller if you do it right (reuse the same identifier in different scopes, make certain things more consistent, and they'll compress better), but tree shaking is where the real benefit comes in: removing code you wrote or included, but didn't use, especially an issue when using libraries.

(Yes, I know some people are too cool for libraries, and if it works for them, cool, but I use them judiciously to save time for things I prefer to do.)

@aschmitz oh yeah, tbh i was thinking implicitly of code shaking already being done.

and linking to minified libraries is alright, since those aren't the code of interest

@aschmitz though i guess then you'd have to do symbol mapping in your code for the latter, which nobody does and so your own code would be half-minified anyway if you did that lol

@KitRedgrave Ah, no, I meant that you'd include the libraries in your code for minification, then tree shake the whole thing. Saves you from sending parts of the libraries you don't use. (And in general if you're at the point of counting bytes, you really shouldn't be using libraries from another server/file. The added latency is significant unless your page is *huge*.)

Sign in to participate in the conversation
The Vulpine Club

The Vulpine Club is a friendly and welcoming community of foxes and their associates, friends, and fans! =^^=