3 ms·
I was just thinking about this earlier today! But then isn't that just the same thing as try-with-resouces?
by lliamander 5y ago
I was just thinking about this earlier today! But then isn't that just the same thing as try-with-resouces?
- valenterry 5y agoVery similar but not the same. try-with-resources is essentially a "hack" that tries to emulate what I described (and it mostly succeeds with it). That way, the ecosystem doesn't have to be changed. "My" solution requires that libraries use/support this pattern, and it also requires the language to have nice syntax, something that Java isn't very good at.