Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

They're basically dual of one another.

`using` is mostly more convenient, because it registers cleanup without needing extra calls, unlike `defer`.

And of course you can trivially bridge callbacks, either by wrapping a function in a disposeable literal or by using the DisposableStack/AsyncDisposableStack utility types which the proposal also adds.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: