What is the proper place to explain error handling in a try-catch statement? It seems like you could put explanatory comments at either the beginning of the try block or the catch block.
// Possible comment location 1 try { // real code } // Possible comment location 2 catch { // Possible comment location 3 // Error handling code }
I usually do the following. If there’s only one exception being handled, I usually don’t bother since it should be self-documenting.