Never use a dependency that you could replace with an afternoon of programming
blog.carlmjohnson.net
Never use a dependency that you could replace with an afternoon of programming
1–10 of 333 posts
Re: Never use a dependency that you could replace with an afternoon of programming
#2Re: Never use a dependency that you could replace with an afternoon of programming
#3Dance with the devil you know and all that.
Re: Never use a dependency that you could replace with an afternoon of programming
#4Hardly a problem today since I just write to `stderr` and have the container log aggregator push elsewhere but boy was it annoying.
Re: Never use a dependency that you could replace with an afternoon of programming
#5The 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'.
Unfortunately, like all things in engineering, you have to carefully reason about the pros/cons, requirements, and costs. After that analysis, you can make a judgment on depend vs. build (also, buy vs. build).
Re: Never use a dependency that you could replace with an afternoon of programming
#6Yes, 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? Submit a patch.
Worried about the dependency changing? Lock the version.
Too many external repos to retrieve those dependencies? Use a local cache.
Don't reinvent the wheel.
Re: Never use a dependency that you could replace with an afternoon of programming
#7Factor, re-factor, and (most especially) DELETE should be tools in the toolbox -- but see if you need it/keep it (e.g. protoype it in, etc first) before you re-write.
Re: Never use a dependency that you could replace with an afternoon of programming
#8Re: Never use a dependency that you could replace with an afternoon of programming
#9why not just copy the code from the dependency into your own sources?
Re: Never use a dependency that you could replace with an afternoon of programming
#10If 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 of a library that should be used when a solution exists within it or by utilizing it.