2026-10-06 18:16 UTC
Maybe you’re thinking of IDisposable with the using keyword. The problem with that is that you have to remember to use it in every call site. Nothing stops a caller from writing var x = new Foo() and walking away.
Replies (1)
-
@ChairmanMeow@programming.dev 2026-10-07 10:45
I am, but you can use a custom analyzer to stop it from compiling if misused. So you can actually stop a caller from writing that and walking away :)