3 ms·
Sometimes it makes sense to write a wrapper. I've worked on a team where every few months we'd have some mandated framework change, or a microservice we depende
by shepherdjerred 4y ago
Sometimes it makes sense to write a wrapper. I've worked on a team where every few months we'd have some mandated framework change, or a microservice we depended on was being replaced by some new project. In that case it's easier to update an abstraction in some common library than ripping the code out from every place it's used in application code.
- andrewstuart2 4y agoI love the rule of three. I know I've heard it on the Go Time podcast, but I'd heard it before then. Copy your code once. If you find you've copied it again later, that's the right time to think about whether you'll continue to, and therefore whether it's worth making something reusable. So yeah, wrappers are nice. But I'm also a really big fan of lazy wrappers. Wrap the thing barely enough to get the job done so you can upgrade in one place, but don't get fancy because you will probably hate yourself for it down the road.
- tcfhgj 4y agoI hate that rule. It makes almost entirely sure that you'll loose control for your duplicates. The way around is way easier