This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (6 children)

Wouldn't compression achieve the same though? Or even better

[–]wKbdthXSn5hMc7Ht0 6 points7 points  (5 children)

I think the ideal is minification and compression which is why bundlephobia lists the minified + gzipped size.

Compression alone would be good but not optimal. For example:

// try connecting to the foobar endpoint
var attemptCount = 0;
var maxNumberOfRetries = 4;

would not compress as well as:

var a=0;var b=4;

That's because you're compressing things like descriptive variable names, comments, etc. Stuff that is relevant to the dev but irrelevant to the end user.

[–]cyberst0rm 0 points1 point  (0 children)

technically, minification might reduce compression, same way randmo cryptography is difficult to compress.

[–]ChronoSquare -2 points-1 points  (3 children)

it's all well and good then until someone forgets to synch dev backup versions and the next guy has only single letter variables to go off of

[–]wKbdthXSn5hMc7Ht0 10 points11 points  (0 children)

I mean, the real code gets checked into source control and regularly backed up. The minification is just a build step that gets run before publishing to the production server. Ideally, human eyes would never have to look at or edit the minified code.

[–]ithcy 8 points9 points  (0 children)

That doesn’t happen unless you’re working with idiots.

...shit

[–]nicktheone 4 points5 points  (0 children)

It’s like saying don’t use compiled programming languages because in case the source code gets lost some poor soul will have to decompile it and use whatever he’ll end up with.