if/else, try/catch blocks
Adam Young
ayoung at redhat.com
Tue Mar 23 01:59:33 UTC 2010
For Java, please stick with the standard coding conventions. Everyone
has a preference, but this way, we annoy everyone equally. Lease
surprise, play nice with the community and all that.
Thus, 1.
On 03/22/2010 06:46 PM, Devan Goodwin wrote:
> 2
>
> On Mon, Mar 22, 2010 at 6:11 PM, Justin Harris<jharris at redhat.com> wrote:
>
>> ----- "Jesus M. Rodriguez"<jesusr at redhat.com> wrote:
>>
>>
>>> -----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
>>>
>> Vote for 1
>>
>>
>>> 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-----
>>> _______________________________________________
>>> candlepin mailing list
>>> candlepin at lists.fedorahosted.org
>>> https://fedorahosted.org/mailman/listinfo/candlepin
>>>
>> _______________________________________________
>> candlepin mailing list
>> candlepin at lists.fedorahosted.org
>> https://fedorahosted.org/mailman/listinfo/candlepin
>>
>>
>
>
>
More information about the candlepin
mailing list