Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Trivial
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
in a lot of places, compund statements are formatting in the following
manner: try { ... } catch (...) {
... } wheras the appropriate, more readable formatting would
be: try { ... } catch (...) { ... }
(the same for if .. else statements) maybe the code convention
document was a bit lax in describing this...
manner: try { ... } catch (...) {
... } wheras the appropriate, more readable formatting would
be: try { ... } catch (...) { ... }
(the same for if .. else statements) maybe the code convention
document was a bit lax in describing this...
insufficient visual separation between the try and the catch blocks.
But if you insist...
I do... :)
But why? Even you implicitly agree it's too crowded, because more
often than not, you write try { statement; } catch
(Exception &e) { statement; } I.e., you put a blank line in
the middle. How is this better than the first style above? Please
give at least one reason. "Appropriate" has no meaning, and "more
readable" is highly subjective.
it's subjective, I aggree. this is the nature of coding conventions.
as I define the coding convention for this project, obviously there's
a subjective bias to my side. but, for background, please see the
SUN Java Coding conventions:
http://java.sun.com/docs/codeconv/html/CodeConventions.doc6.html#430
what I require is basically the same as there.
I changed them already, and I also did a web search which gave similar
documents as this one. For some conventions, they give a reason, e.g.
if (condition) singleStatement; // error-prone int a, *b;
// error-prone which is fine; for others, they don't. I was
curious whether there was any reason for this ugly try-catch
formatting that I'm not seeing. I guess there isn't.