Re:Convincing Programmers They Want To Use Lisp
by chc on Monday February 21, 2011 @04:50PM
(#2247364)
How does catching exceptions absolve us of the need to remember to close files?
[ Parent
| on HN ]
Re:Convincing Programmers They Want To Use Lisp
by teilo on Monday February 21, 2011 @04:57PM
(#2247403)
This isn't about exceptions, though it is certainly part of the problem. Try, catch, finally blocks are commonly used to ensure that resources are released once they are no longer used. It not only forces you to remember to close the resources, it also forces you to think about what happens if something in your code breaks, and you have these open resources still in use. It's practically the entire reason that the "finally" block exists.