Avoiding dependencies is a noble goal, and something to be valued, but this simple rule is too simplistic. The problem lies in the fact that there are a great many things I can hack together in an afternoon to "replace" some kind of external dependency, but the quality discrepancy of these hacks is highly variant. My understanding of what can or should be done in an afternoon might differ with my colleagues'. Unfortu…
Never use a dependency that you could replace with an afternoon of programming
11–20 of 333 posts
Re: Never use a dependency that you could replace with an afternoon of programming
#12Given the variance in standard library coverage, it’s rarely productive to argue about this topic in a language agnostic way. Using only stdlib in Go is very different from using only stdlib in JavaScript.
Re: Never use a dependency that you could replace with an afternoon of programming
#13Re: Never use a dependency that you could replace with an afternoon of programming
#14Re: Never use a dependency that you could replace with an afternoon of programming
#15This reminds me of the Node left-pad module problem in a way. I think if something is so trivial to write, you should write it rather than using a dependency. If it is non-trivial, I prefer the official standard libraries for a programming language. That is if a solution exists in the standard library. I think the Go standard library with its batteries included mantra and the level of support it gets is good example…
Removing a dependency doesn’t have to mean writing from scratch.
Re: Never use a dependency that you could replace with an afternoon of programming
#16This is horrible advice. There's a reason that you don't write your own hashtable implementations. Yes, I can write a hashtable implementation in an afternoon, but it's going to have bugs that I'll spend the next year fixing, and still not achieve the performance of the pre-built version. All that work of finding existing solutions and learning how to use them? That's part of the job. Find a bug in the dependency? Su…
If it has any bugs that would surface in a year of production (while the dependency version wouldn't) then you didn't write an equivalent in an afternoon.
The advice, if it's to be useful at all, must be things that you could completely replace in the same quality, in an afternoon.
It's the left-pads and is-odds, to begin with.
Re: Never use a dependency that you could replace with an afternoon of programming
#17This is horrible advice. There's a reason that you don't write your own hashtable implementations. Yes, I can write a hashtable implementation in an afternoon, but it's going to have bugs that I'll spend the next year fixing, and still not achieve the performance of the pre-built version. All that work of finding existing solutions and learning how to use them? That's part of the job. Find a bug in the dependency? Su…
Re: Never use a dependency that you could replace with an afternoon of programming
#18Probably good advice, but when was the last time a programmer accurately scoped a problem when they said it will take “an afternoon” to build?
Re: Never use a dependency that you could replace with an afternoon of programming
#19(2) if Linus's Law is "given enough eyeballs, all bugs are shallow", then having fewer eyes on a library means more bugs.
(3) Oftentimes you think you can replace a dependency with an afternoon of programming, but it turns out, it's not quite as simple as you think.
(4) Sometimes you only use a small piece of a library to start with, but over time use more and more. If it's your own code, then you're going to be continuously refactoring, updating, rewriting it. If it's a library, then you can just start using the additional pieces as you need.
Re: Never use a dependency that you could replace with an afternoon of programming
#20Probably good advice, but when was the last time a programmer accurately scoped a problem when they said it will take “an afternoon” to build?