2 ms·
If you find yourself repeating a pattern in many places, with slight variations in the values used, that's a good candidate for refactoring that pattern into an
by scott_s 11y ago
If you find yourself repeating a pattern in many places, with slight variations in the values used, that's a good candidate for refactoring that pattern into an abstraction for that resources. In your example, I can easily imagine refactoring uses of that library being abstracted into a class or a set of functions so that interaction with the library only happens in one place.