Should java try blocks be scoped as tightly as possible?
The basic premise here is false: the size of a try block makes no difference in performance. Performance is affected by actually raising exceptions at runtime, and that’s independent of the size of the try block. However, keeping try blocks small can lead to better programs. You might catch exceptions to recover and proceed, or … Read more