if/else, try/catch blocks
Jesus M. Rodriguez
jesusr at redhat.com
Mon Mar 22 21:09:54 UTC 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
It was brought up today that some folks prefer:
if (true) {
// some code
} else if (some_expressions) {
// some code
} else {
// some code
}
to the current format of
if (true) {
// some code
}
else if (some_expressions) {
// some code
}
else {
// some code
}
Same applies to try/catch/finally blocks:
try {
// some code
} catch (Exception e) {
// log or rethrow
} finally {
// final cleanup
}
as opposed to the current format:
try {
// some code
}
catch (Exception e) {
// log or rethrow
}
finally {
// final cleanup
}
I've grown partial to the latter (new lined version, but was used to the
former in a past job). So I'm putting this up for a vote, majority wins.
Only one vote per person.
1) same line
2) new line
jesus
- --
jesus m. rodriguez | jesusr at redhat.com
principal software engineer | irc: zeus
red hat systems management | 919.754.4413 (w)
rhce # 805008586930012 | 919.623.0080 (c)
+---------------------------------------------+
| "Those who cannot remember the past |
| are condemned to repeat it." |
| -- George Santayana |
+---------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/
iEYEARECAAYFAkun3KIACgkQvJZ57YntiYPtBQCeI+IfmeKwmjS/PqksdZTWrDly
S/MAn0CAWjOlKkAhmdqXO22yHvcFv3nL
=dVIQ
-----END PGP SIGNATURE-----
More information about the candlepin
mailing list