3 ms·
How else would we pad our strings?
by timlyo 10y ago
How else would we pad our strings?
- egeozcan 10y agoThe example you are giving is actually a result of trying to prevent bloat.
- timlyo 10y agoBy adding a dependency to do a one line task?
- egeozcan 10y agoWell, you can add bloat by inlining it too, if it's repeated many times. I thought bloat was for unused code loaded as a side effect to code that one actually depends on, for example, as a part of a big library. That makes a huge difference if you are targeting the client side. I mean, you could also have it as a helper function in your project but that decreases the re-usability to copy-pasting across projects. In the end, effective or not, I can see it as an attempt on reducing bloat. I see that many don't agree, but I'm afraid they don't take into account the constraints imposed by sending code to the clients rather than a binary.
- egeozcan 10y agoFrom the down-votes, I gather that people may have missed what I was trying to say. The left-pad discussion generally divided people into 3 general opinions: 1) Use a monolithic library like lodash 2) Use a library for each function (note that lodash can also be used in this way but we are already far off-topic) 3) Inline these small functions. So a website loading lots of monolithic libraries and using JS for everything is actually the opposite extreme for what caused that drama. If I'm wrong or irrelevant, please tell me how instead of down-voting please because I sincerely don't see how. Thank you.