3 ms·
There are a couple reasons I can think of to use a library: * The code is the best in the world and would take anyone years to compete with its speed. Librarie
by cup-of-tea 9y ago
There are a couple reasons I can think of to use a library:
* The code is the best in the world and would take anyone years to compete with its speed. Libraries like gmp, fftw etc come to mind.
* The API is good. A good API extends the language in a way that makes your code better and more enjoyable to write.
I usually try to avoid dependencies where possible because it will always make life easier later on. Introducing a dependency for a single function should be a sackable offence imo. At that point you're just too lazy or incompetent to do your job.
- scottmf 9y agoWhy waste time rewriting something like leftPad?
- victorNicollet 9y agoleftPad is an exceptional case because 1° it should have been part of the standard library and 2° it is a library that only contains one function.
- rejschaap 9y agoCalling it a library is a stretch. The whole leftPad controverse makes a pretty good case for rewriting. It would have saved many people a lot of trouble. Also, if you know your langauge, rewriting it is probably faster than finding, installing and using a package.
- scottmf 9y agoThe trouble with leftPad was a flaw of NPM which could have happened with any package.
- cup-of-tea 9y agoReally? It would take ten minutes of my time once, as opposed to risking the idiotic errors that occurred when people depended on that "library" being available. I'm suppose to make sure stupid shit like that doesn't happen. It's not a waste of my time. It's my job.