Re: GTK+ policy (was RE:rendering-cleanup-next)

On Sep 14, 2010, at 3:48 AM, Paul Davis wrote:
> On Mon, Sep 13, 2010 at 6:27 PM, Matthias Clasen
> <matthias clasen gmail com> wrote:
>> 2010/9/13 Thomas Wood <thos gnome org>:
>>> Clutter's (very detailed) coding style document may be useful here,
>>> since it has a very similar coding style to GTK+:
>> Yes, I think we could basically adopt this word-by-word.
> i know that coding styles are, as it says in the clutter guide,
> "arbitrary", but i would just like to mention one little detail that i
> find problematic when working on shared projects (and much less so on
> non-shared projects). this rule:
> ----------------------------------
> Curly braces should not be used for single statement blocks:
>  if (condition)
>    single_statement ();
>  else
>    another_single_statement (arg1);
> -----------------------------------

To add to this, it does not specify how to deal with braces in nested if-statements.  When I start to nest if-statements (also with a single-statement body) I typically start adding braces, because it is a bit clearer and avoids the dangling else problem.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]