Alex Bennee wrote:
> > I really wish the syntax wouldn't allow both so that this was never a
> > question of "style".
 
> Much as I agree with you (I always use braces in my private code) our
> style guideline 6.2 does allow people to do the single line:
 
> if (condition)
>   do_something();

I know, I'm also incosistent with it. For example, if the conditional statement
is return or break I usually consider it okay to omit the braces. That's also
why I wish it was obligatory so that this wasn't a matter of taste.

> Maybe we should remove that rule and insist on braces all the time?

Maybe.
 
> Are there any static tools we could use to point out derogations from the
> STYLE document in the code base?

I don't think so. I posted some AWK script ones to check some style rules. You
could possibly use some indent tool together with diff to point those out. Or
write some (Perl) script. There are also some typos which happen rarely but if
they happen cause easily a severe malfunction e.g. "while (cond); {" or "if
(cond);". We should have a script to warn in case of such constructs but we're
low on tuits I'm afraid.

Actually that's not specific to Gtk-Gnutella at all and would be useful tool in
general. I'd even think there already is such a tool. If there isn't, this
would certainly justify a small but neat self-standing project.


-- 
Christian

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Gtk-gnutella-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to