Several try-catch blocks VS one big try-catch block [in a thread]?

The example you posted suggests having a single catch block for clarity and maintainability. I agree with that, it's good advice. Are you worried about performance?

Theoretically, if you're doing stuff between your exception throwing blocks, multiple try/catch blocks would be faster. But the difference would be quite small, and maintainability would suffer. Go with the single try catch.

The thing is that I have a run() method which has a plenty (like 5-9) of same try-catch blocks in it. All of them looking like that one I posted. No performance worries here.

– FractalizeR Apr 27 at 20:15 so then it'll be easier to do a single try-catch block. More maintainable and clear. – Milimetric Apr 27 at 21:18 thanks.

– FractalizeR Apr 27 at 21:23.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions