| There used to be the general wisdom of, "Don't re-invent the wheel. Let the hive-mind craft utility functions and use those because they'll be battle-hardened, well tested, and you can focus on your core business". I think the left-pad incident helped shatter that myth. He we had huge packages depending on a package which padded a string in an inefficient manner. It turns out that the many eyeballs of the bazaar had averted their gaze from what was actually happening, which is a system of impossible to audit dependency chains. I think it also shows the impact of using a language with a poor standard library. Padding is absolutely something that should be available as an extension over String. If JavaScript were controlled in the same manner that Go, Rust, Java, .NET, python etc, then it would have been added years ago. Apparently it has now finally arrived in ES2026: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... |