On 7/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

Hello again,


I got some more question regarding coding rules.

For control block with a single line of code, should we use brackets or
not? Currently, I see both, but not using the brackets seems to be the
most common.


It's not a strictly enforced thing;  in general, for a simple "if"
followed by one line, I don't much care for the braces - they
don't make the code more readable.  But for an "if"-"else",
if one case requires a brace the other should have braces
too.


Regarding nested classes, are those encouraged when they are strongly
coupled with with their enclosing class or should they be converted in top
level classes?


If they're very strongly coupled - and one is clearly the primary class
and the other the helper class - I like using inner classes.  Make
inner classes static whereever possible (would that we'd gotten
that right back when the EG did StateManager.SerializedView....)

Anyway, neither of these are absolute, codified rules.

-- Adam

Reply via email to