Live data from Hacker News

Kill Your Dependencies

mikeperham.com

191–200 of 229 posts

Re: Kill Your Dependencies

#191

Earlier quoted context omitted.

I don't think that's what he's advocating: he's just saying that every dependency you have is another thing you have to worry about, so why not try to limit them as much as possible? Obviously it's impractical sometimes, and that's OK, as long as you understand the consequences.

Every dependency you have is another thing that people besides yourself can worry about with you or for you Need to do X? If you write your own library that does X, chances are you'll be the only one to ever work on it. Need a new feature? You have to stop working on your actual project and implement that feature. Found a bug? No one else will fix it for you. If you depend on a library that thousands of other people…

A better way to view this is that if libraries are kept small, then you can pick a more granular set of dependencies than say a larger library that includes the kitchen sink.

I agree with most comments here that it's not a good idea to reinvent the wheel everywhere, but when all you want is a wheel, and not the entire car, it's ideal that we have a way to just include the wheel.

Re: Kill Your Dependencies

#192
Slightly related, I was packaging up a webapp in docker, and one thing the application did was form-fill PDFs. I had been using pdftk to do this, but it turns out pdftk is written in gcj, and gcj pulls in a lot for its runtime libraries. I wrote a small program using the mupdf libraries and cut the size of my docker image by over 400MB.

Re: Kill Your Dependencies

#193

Earlier quoted context omitted.

I completely agree, but the extremism in the essay is ridiculous. If I'm writing some software, I don't want to have to roll my own version of every little thing when there are battle tested libraries out there that already do it and benefit from many people using it. If my use case is vastly different, sure, but if it's the same use case as everyone else then I see little benefit.

if they are so battle-tested then they probably are not like the email gem that the author spoke of that was using 10mb more memory than necessary for dependencies... node-land is also getting a bit silly this way... to say nothing of java etc... since we are into silly quotes i'll riff and probably get this wrong but: "you wanted a banana but you got the gorilla holding it and the whole jungle too" joe armstrong (er…

10 megabytes of memory more than necessary! Because that's a massive waste of memory in 2016.

Re: Kill Your Dependencies

#194
post #193

Earlier quoted context omitted.

if they are so battle-tested then they probably are not like the email gem that the author spoke of that was using 10mb more memory than necessary for dependencies... node-land is also getting a bit silly this way... to say nothing of java etc... since we are into silly quotes i'll riff and probably get this wrong but: "you wanted a banana but you got the gorilla holding it and the whole jungle too" joe armstrong (er…

10 megabytes of memory more than necessary! Because that's a massive waste of memory in 2016.

Allocation of that memory still costs /something/ even if ram is so plentiful as to be free.

Re: Kill Your Dependencies

#195

I disagree, and this quote I've seen floating around the internet sort of sums the idea up to me (albeit with a music analogy): > I thought using loops was cheating, so I programmed my own using samples. I then thought using samples was cheating, so I recorded real drums. I then thought that programming it was cheating, so I learned to play drums for real. I then thought using bought drums was cheating, so I learned…

I'm usually against counter-arguing by referencing fallacies, but this sums up your comment perfectly:

http://www.nizkor.org/features/fallacies/slippery-slope.html

Re: Kill Your Dependencies

#196
post #193

Earlier quoted context omitted.

if they are so battle-tested then they probably are not like the email gem that the author spoke of that was using 10mb more memory than necessary for dependencies... node-land is also getting a bit silly this way... to say nothing of java etc... since we are into silly quotes i'll riff and probably get this wrong but: "you wanted a banana but you got the gorilla holding it and the whole jungle too" joe armstrong (er…

10 megabytes of memory more than necessary! Because that's a massive waste of memory in 2016.

The kind of thinking that got us web browsers using multi GB of RAM...

Re: Kill Your Dependencies

#197

I disagree, and this quote I've seen floating around the internet sort of sums the idea up to me (albeit with a music analogy): > I thought using loops was cheating, so I programmed my own using samples. I then thought using samples was cheating, so I recorded real drums. I then thought that programming it was cheating, so I learned to play drums for real. I then thought using bought drums was cheating, so I learned…

that's a silly/wrongful quote IMO... I've produced/recorded music for over 20 years and loops from other people are not only cheating, they are not your damned recordings and you sound like every other loop-arranger out there... it's not really that difficult to record real-world sounds and guess what!? you can use those same audio tools (your daw + plugins etc) to manipulate and sweeten YOUR recordings just as easil…

>I've produced/recorded music for over 20 years and loops from other people are not only cheating, they are not your damned recordings and you sound like every other loop-arranger out there...

Actually there are songs using samples that are 10 times more original and unique than songs other people have totally recorded and played themselves.

You can be inventive and original using samples and you can be a copy-cat bore writing your own stuff.

For example, let's compare a cheesy, but still huge classic and immediately recognizable "U can't touch this" with tons of stupid-ass Michael Bolton cliched ballads or MOR rock.

Re: Kill Your Dependencies

#198

Earlier quoted context omitted.

Regardless of how perfectly this does or doesn't match the context, I approve as an electronic musician and programmer and I will use this quote forever! Thankyou! www.soundcloud.com/decklyn

as an excuse for not doing original recordings? collage art is collage art, not painting... sorry:)

Some of the greatest painters, from Picasso and Dali to Warhol also did collage art...

Besides, painting is also not ballet or architecture, so?

Re: Kill Your Dependencies

#199

Earlier quoted context omitted.

Not always. Dependencies were a huge problem at Google, even in C++ (perhaps especially in C++), because they mean that the linker has to do a lot of extra work. And unlike compiling, linking can't be parallelized, since it has to produce one binary. At one point the webserver for Google Search grew big enough that the linker started running out of RAM on build machines, and then we had a big problem. There's still n…

That's a pretty significant special case though. I'd be willing to go with the advice "If you get as big as Google's codebase, be sure to trim the dependencies on your statically-bound languages too." But you probably have a ways to go before that's an engineering concern for your project. (... note that one could make a similar argument for more runtime-dynamic languages. I won't disagree, other than to observe that…

^ THIS. I wish I had more up votes.

The amount of time I've seen wasted trying to scale to Google is insane. People should worry about what Google does when they work for at least a billion dollar company.

For most projects import as many dependencies as you can as you are getting free labour. Sure, once in a while you'll fuck something up and waste a week or two, but it pales in comparison to the months you didn't spend reinventing the wheel.

No one really ever notices that it's all the companies with boat loads of cash that have massive technical debt. Even with the example at Google the first thing I'd try is jamming more memory in those machines, keep going until the linker needs more than 256 GB.

Fuck, Facebook still uses PHP, the stock market doesn't seem to care.

Re: Kill Your Dependencies

#200
post #194
post #193

Earlier quoted context omitted.

10 megabytes of memory more than necessary! Because that's a massive waste of memory in 2016.

Allocation of that memory still costs /something/ even if ram is so plentiful as to be free.

Making your own library also costs something, which are probably more scarce than RAM.
Post reply on HN