News for hackers. Stuff that matters.
Re:C: Simple Defer, Ready to Use by bangaladore on Monday January 06, 2025 @09:58PM (#42618680)
See but the issue is that humans are not perfect, and time is usually a resource.

Without defer like mechanisms objects get leaked, mutexes held after return, etc...

In a perfect world everything could be perfectly explicit as infinite time and energy has gone into ensuring nothing is forgotten and everything / every code path is well exercised.

Even then, scoped based resource acquisition / releasing still feels more ergonomic to me.

There are no comments on this comment yet.