3 ms·
withFile also has the drawback that you can invalidly return the Handle from the handler.
by tome 6y ago
withFile also has the drawback that you can invalidly return the Handle from the handler.
- klodolph 6y agoThat’s true, but not much of a drawback because it’s not a likely error for humans to make and there aren’t really negative consequences.
- dllthomas 6y agoNegative consequences are whatever use-after-close errors you make trying to use the thing you returned. ... but I certainly agree that it's not an error that's made very often, and the flexibility is the bigger point.