Hacker News new | ask | show | jobs
by yurishimo 370 days ago
I would argue that a leftpad/is-odd package is the equivalent of writing a for loop. The time it cost you to search the internet, download the package, and rerun your build script cost more than the time to write the function from scratch and the behavior is indentical.

Duplicate code across the ecosystem is fine. Not every function must be unique for an entire programming language.

1 comments

What about the time it cost you to search the internet, read the docs, and use the one from std? How many seconds does each variant take (with hot/cold memory cache?)

And the behavior could also be worse, there is no guarantee of perfection.

The last argument is too generic to offer any guidance. Why is it better for this function be duplicated?? Should it not be part of std to avoid uniqueness?

> Should it not be part of std to avoid uniqueness?

> > > > (assuming the standard library doesn't include one already)

This doesn't address the should