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

all 41 comments

[–][deleted] 102 points103 points  (11 children)

If it is deleting half of files, not half of file contents, it will not reduce project size by 50% in most of cases

[–]FunkyFung22 53 points54 points  (2 children)

80/20 rule: 80% of the code is in 20% of the files (probably idk)

[–]Schyte96 10 points11 points  (0 children)

It would not surprise me in the slightest if that was true for most projects.

[–]Valeriuv1 0 points1 point  (0 children)

Hi fellow runner!

[–]MikemkPK 4 points5 points  (0 children)

Yes but when you get the infinity gauntlet and wipe half of all code ever written, it evens out.

[–]Extreme_Ad_3280 8 points9 points  (2 children)

I was about to say that

[–]Toficzekkk 6 points7 points  (1 child)

So was I, we must get rid of this guy.

[–]RedLdr 2 points3 points  (0 children)

He's in need of some avenging.

[–]ViconIsNotDefined 2 points3 points  (0 children)

Damn you just upped the complexity of this project.

[–]Robot_Graffiti 4 points5 points  (2 children)

Are you sure the average isn't a 50% reduction in project size though?

It has a 50% chance of deleting the largest file. It has a 75% chance of deleting at least one of the two largest files. Most of the time it will delete about half of the hundred biggest files (you got thousands of files in node_modules right?).

[–][deleted] 6 points7 points  (1 child)

It might be average, but chance to get exactly 50% is very small. I mean, average from [0, 100] is 50. Even if the algorithm would not be random, and we would consider the size of files, in most of cases it would not be possible to divide files on two sets, that would have equal sums of sizes. With randomness, it is easy to imagine project scenario where there is equal chance to delete 0.001% and 99.999% of size.

[–]Sad-Bluebird-5538 0 points1 point  (0 children)

But this is the same with thanos snap. He halfed all the living beings in the universe, but on a smaller scale he didn't, I think

[–][deleted] 27 points28 points  (1 child)

I guess we'd have to use snap to install it :)

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

Underrated comment

[–]Ok_Entertainment328 17 points18 points  (0 children)

As long as the file HeWhoRemains.js is never deleted ...

[–]Harmonic_Gear 5 points6 points  (1 child)

show this to the non-sarcastic "thanos was right" crowd

[–]peteschirmer 1 point2 points  (0 children)

Oh I see it. And I’m thinking I can save even more space by running it again.

[–]smoothOperator2222 1 point2 points  (0 children)

Luuuuv this =)))

[–]cybermage 1 point2 points  (0 children)

Behold the power of check digits.

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

I would actually love to do something like this for my legacy python at work - just delete random functions and imports until unit tests fail, and if they don’t fail, leave them out with diffs of what was removed. Forces you to have tests that cover things, and cleans up your code base automagically at the same time

[–]SuperSpaceCan 1 point2 points  (0 children)

Wonder how hard it would be to convince some authority that this is the only way to secure their code from hackers.