Live data from Hacker News

Cull your dependencies

tomrenner.com

1–10 of 132 posts

Re: Cull your dependencies

#4
It would be nice if there were a way to quantify the value of your dependencies.

If you have a dependency with 1,000 LoC and your application is utilizing 800 of them, that seems like a good reason to use the dependency.

You're (hopefully) getting unit tests, documentation, and public exposure of the code (bugfix opportunities) for "free"

If you have a dependency with 1,000,000 LoC and you only need 1,000, that indicates the dependency isn't a good fit for your project.

This is only a heuristic, but are there any tools that examine metrics like that?

Re: Cull your dependencies

#5
It is a fine balance. Good luck doing that in JS which has zero standard library on the browser.

C#, for example is in better shape and you can do a lot before you reach for nuget for anything outside of Microsoft.

I prefer to not import tiny libraries but adopt the code into the codebase.

Re: Cull your dependencies

#7
The argument seems a bit myopic. The author is talking about errors and vulnerabilities found in libraries while ignoring those same factors in bespoke code. At best that's a "security through obscurity" scheme.

Re: Cull your dependencies

#8

It is a fine balance. Good luck doing that in JS which has zero standard library on the browser. C#, for example is in better shape and you can do a lot before you reach for nuget for anything outside of Microsoft. I prefer to not import tiny libraries but adopt the code into the codebase.

> Good luck doing that in JS which has zero standard library on the browser.

The article is saying something more like vendor your dependencies (and cut out the stuff you don't use within dependencies).

> I prefer to not import tiny libraries but adopt the code into the codebase.

Yep that's what the article is saying.

Re: Cull your dependencies

#10

It would be nice if there were a way to quantify the value of your dependencies. If you have a dependency with 1,000 LoC and your application is utilizing 800 of them, that seems like a good reason to use the dependency. You're (hopefully) getting unit tests, documentation, and public exposure of the code (bugfix opportunities) for "free" If you have a dependency with 1,000,000 LoC and you only need 1,000, that indic…

You're also exposing yourself to potentially needless breaking changes and many libraries that aren't well tested or don't have static types. Or growing in size because of optional dependencies but build tools and languages without builtin support for keeping unneeded optional dependencies out of the imported code.
Post reply on HN