Re:Write code. Not too much. Mostly functions.
by brundolf on Monday December 21, 2020 @10:32PM
(#25502545)
I'd have one canonical one used everywhere, and 2n pure functions to convert at API boundaries. By making them pure functions you guarantee (or at least suggest by convention; depending on your language's type system) that those conversions will have no side-effects. As methods, you can never be sure as the caller whether there will be ramifications to calling them in new places.
[ Parent
| on HN ]
There are no comments on this comment yet.