Re: GTK+ policy (was RE:rendering-cleanup-next)
- From: Tomeu Vizoso <tomeu sugarlabs org>
- To: Jon Cruz <jon joncruz org>
- Cc: gtk-devel-list Developers <gtk-devel-list gnome org>
- Subject: Re: GTK+ policy (was RE:rendering-cleanup-next)
- Date: Tue, 14 Sep 2010 09:46:38 +0200
On Tue, Sep 14, 2010 at 09:14, Jon Cruz <jon joncruz org> wrote:
> On Sep 13, 2010, at 10:49 PM, Kristian Rietveld wrote:
>> 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.
> Aside from the functional reasons to use braces even for single-line statements, using them make review and reading much simpler.
> If one just can go "here is an if statement, oops, the brace is missing" reading and reviews fly by. On the other hand, if one has to go "hmm... here is an if, let me look for a brace. No, I don't see one. Let me read and consider if this is a situation calling for one or not", then code reviews, reading, maintenance, etc. go significantly slower. Over the years I've consistently found it to be at least an order of magnitude slower, and more error prone.
> And on the functional side, yes I've fixed many many bugs in many projects that have been caused by or missed due to lack of braces on single-lines.
> Oh, and nested if statements do get things quite complicated if the rule is to only use braces sometimes, instead of the simpler "use braces 100% of the time".
One more reason is that if braces are them from the start, they won't
need to be added later and git-blame will be more useful.
> gtk-devel-list mailing list
> gtk-devel-list gnome org
] [Thread Prev