Re:Never use a dependency that you could replace with an aft...
by Ma8ee on Tuesday August 11, 2020 @07:40PM
(#24127210)
It’s cheaper in the sense that it is faster to write and maintain those 20 lines of code. Because someone has to evaluate the library, understand it well enough to actually call it and then make sure it stays up to date. And often there are a few lines of code to translate your data into a form that the library requires etc.
Re:Never use a dependency that you could replace with an aft...
by BigJono on Wednesday August 12, 2020 @02:33AM
(#24129145)
Plus for every developer to come, one call to an external library usually also means 30 pages of documentation to trawl through if they ever want to change anything, 29.9 of which is completely irrelevant to whatever your narrow use case is.
That's the real cost. The size of the code means absolutely nothing.
Re:Never use a dependency that you could replace with an aft...
by Retric on Tuesday August 11, 2020 @07:38PM
(#24127201)
You can’t use a library with zero lines of code. On top of this library’s always have development overhead outside of the code you write. Ex: What version number should you use? Did the latest version break something? Did the old version break something on the latest compiler? Etc etc.
By using a third party library you are writing twenty lines less code, so it's cheaper in that aspect.
There are probably libraries that are faster than your twenty lines of un-optimized code, so it's cheaper as far as computing resources are considered too.
The only time it could matter is when you ship the code to the client through the wire (such as a Javascript bundle).