

7·
6 hours agoYou can’t, not in e.g. Java or C#.
C++ and Rust are the only languages I know of that do this right.


You can’t, not in e.g. Java or C#.
C++ and Rust are the only languages I know of that do this right.


Garbage collection doesn’t solve the problem either, cause it’s too unpredictable and typically doesn’t even give you the option to close resources when memory is reclaimed. So just opening SQL connections and forgetting to close them will quickly drain the connection pool.


The executive accused the media of spreading “misinformation and outright lies,” arguing that “in the age of social media and 24/7 news, myths take hold faster than ever before.”
Yeah? Well whose fault is that?
Maybe you’re thinking of
IDisposablewith theusingkeyword. The problem with that is that you have to remember to use it in every call site. Nothing stops a caller from writingvar x = new Foo()and walking away.