5 ms·
How does serious background help the argument for wasting your time writing code that's already been written. By the way, why should serious people use padding
by eviks 1y ago
How does serious background help the argument for wasting your time writing code that's already been written. By the way, why should serious people use padding from the standard library?
- yurishimo 1y agoI 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.
- eviks 1y agoWhat 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?
- beej71 1y agoThe standard library is a far less risky dependency than third-party libraries. It's far more reliable in presence and behavior.