3 ms·
This sounds like pre-mature optimization. If the library does what you need it to do, use it. If it becomes a problem later, then optimize it. That last thin
by jedberg 6y ago
This sounds like pre-mature optimization. If the library does what you need it to do, use it. If it becomes a problem later, then optimize it.
That last thing you want to do is spend a bunch of time reimplementing code when: 1) It may not matter at all, 2) You might miss important edge cases, or 3) You got everything right but you still have to maintain it forever.
If it's going to take you three days to integrate the library, maybe it's not such a good library, or maybe it's really complicated because there are a lot of edge cases. In that case, dig into the code and see if you can figure out what it's doing.
But if you think you can spend an afternoon rewriting a library that would take three days to integrate, there is a good chance you might be missing something important.
- lolc 6y agoI remember starting with an overloaded library from NPM where I used some basic functionality. That worked fine for a while. When later I got lost fixing a defect in the tangle, I just ripped out the parts I needed and made a trimmed version. The interface remained the same, for the parts I was using. Nothing to adapt. In this way I had little investment in the beginning. And once I knew what I needed, it was another small investment to clean the code.