News for hackers. Stuff that matters.
Re:Ask HN: When do you use a library vs. implement something... by scottmf on Friday April 20, 2018 @02:18AM (#16882535)
Why waste time rewriting something like leftPad?
Re:Ask HN: When do you use a library vs. implement something... by cup-of-tea on Friday April 20, 2018 @06:33AM (#16883644)
Really? 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.

Re:Ask HN: When do you use a library vs. implement something... by victorNicollet on Friday April 20, 2018 @02:42AM (#16882637)
leftPad 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.
Re:Ask HN: When do you use a library vs. implement something... by rejschaap on Friday April 20, 2018 @05:11AM (#16883296)
Calling 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.

Re:Ask HN: When do you use a library vs. implement something... by scottmf on Saturday April 21, 2018 @12:15PM (#16891978)
The trouble with leftPad was a flaw of NPM which could have happened with any package.