Hacker News new | past | comments | ask | show | jobs | submit login

"no free lunch" and "standing on ..." are 2 ideas, which are also being misused by people in at least 2 ways: One is to block, basically saying: "But no free lunch! Somewhere there must be a cost, because someone else once said no free lunch!", while it is very possible, that one has done something in a way, which was silly from the start and really could have a "free lunch", by switching to a better way of doing it.

The other "standing on the shoulders of giants" is used as justification for accumulating more and more dependencies and not writing stuff oneself, no matter how simple, which is how we get into left-pad-like territory.

We should indeed focus on reusing libraries, but please, _good_ libraries and not ones, which impose limitations in implementation as well as future thinking, by creating a high mental barrier to change ("But if we switch out this library we need to change aaalll this stuff, because our code is adapted to how the library works."). Sometimes adding a dependency is simply not worth it, like in the left-pad scenario. Just write that one function yourself and don't add more dependencies to the project. Always weigh the benefit against the additional load of dependencies added directly or indirectly as dependencies of dependencies.




JS is definitely not a good example of “standing on the shoulder of giants”, the language has always lacked a sane standard library (it is getting better nowadays), plus due to optimizing for size and depending on “tree shakers” they have probably the worst dependency graphs ever.

But should I really start writing a graph algorithm for the 15th time? I believe the point of the quote is not “blindly add dependencies”, but that a significant boost in productivity can come from reusing already existing, high quality code that fits in with the projects requirements. Left-pad is clearly not such for most projects, and “it is not a free lunch” (:D) in that maintaining dependencies also has a cost.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: