[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Cuddled / non-cuddled parenthesis convention
From: |
John W. Eaton |
Subject: |
Cuddled / non-cuddled parenthesis convention |
Date: |
Fri, 6 Jul 2012 18:25:27 -0400 |
On 6-Jul-2012, Rik wrote:
| 7/6/12
|
| John,
|
| I'm working on some code maintenance issues. As I recall, the preferred
| convention for parenthesis is that they be cuddled with the preceding word
| when indexing is being performed, but separated by a space if it is a
| function call. I just committed a changeset to modify uses of "retval (0)
| = xxx" to "retval(0) = xxx". I'm considering looking for more of these
| parenthesis coding convention mistakes.
|
| For example, from balance.cc I have
|
| balance.cc:107: if (nn != args(0).columns())
| balance.cc:114: (! AEPcase && args(1).is_single_type());
|
| which I think should have a space to indicate a function call.
|
| balance.cc:107: if (nn != args(0).columns ())
| balance.cc:114: (! AEPcase && args(1).is_single_type ());
|
| Is that right?
Yes, the latter is how I would write it.
jwe