Re:Code Health: Make Interfaces Hard to Misuse (2018)
by Akronymus on Monday September 07, 2020 @05:00AM
(#24397865)
Couldn't you return a tuple with the object and the useful return value though?
[ Parent
| on HN ]
Re:Code Health: Make Interfaces Hard to Misuse (2018)
by Smaug123 on Monday September 07, 2020 @05:52AM
(#24398171)
Sure - that's not the difficult part, in my book. (I use F#, where there's tuple destructuring syntax, so it's easy.) The hard parts are about making sure you can't reuse the token in the wrong context.