3 ms·
I think this idea makes a lot of sense. I recently published a tiny library on NPM for changing the case of strings (snake_case, etc.). It felt so small and si
by kristiandupont 7y ago
I think this idea makes a lot of sense.
I recently published a tiny library on NPM for changing the case of strings (snake_case, etc.). It felt so small and silly that I was tempted to add some other string manipulation functions, to make it a more "serious" library. But it struck me that this would just be silly. How often do you need a whole collection of string manipulation functions? Never! It would just add to the size of dist folders everywhere, with no gain whatsoever. I suspect this applies in many situations.
- strlen0 7y ago> How often do you need a whole collection of string manipulation functions? All the time. It’s called a standard library and most sane languages have one.
- pierreyoda 7y ago> How often do you need a whole collection of string manipulation functions? Never! It would just add to the size of dist folders everywhere, with no gain whatsoever. I mean that's where proper tree shaking would void this argument. When you include lodash (or lodash-es more precisely) for instance only the used functions are in the final bundle with a modern bundler.
- WillDaSilva 7y agoThere's no way I'd ever import a tiny library like that. Verifying that a library does what I expect it to do, uses an appropriate license for my project, isn't likely to break my project in the future, etc., is a fair bit of work, and it only increases as more tiny packages are added. The worrying over increasing the size of the dist folder is a symptom of using a bad package manager. I do believe that packages shouldn't be bloated, and should mainly focus on a single goal, but that goal should be at least somewhat broad in scope. Manipulating strings is a good objective for a package, but changing the case of strings seems too small to be worth it.
- Ididntdothis 7y ago" How often do you need a whole collection of string manipulation functions? Never! " Always! The Javascript world lacks a good standard library or something like STL that covers most of what you need during normal development. Instead you have thousands of little packages of varying quality. I would much prefer a few big libraries with more power and consistency.
- TeMPOraL 7y ago> How often do you need a whole collection of string manipulation functions? Never! Not initially, but as your code grows, you start to call out to more and more of those string manipulation functions... and if each of them is its own separate package, you get an inconsistent mess at the interface level - just like PHP used to be, except PHP didn't consist of individually downloadable functions with much more metadata than actual code.