[asterisk-dev] code-cleanup concerns

Dinesh Nair dinesh at alphaque.com
Sat Apr 15 02:39:51 MST 2006


On 04/15/06 07:59 Luigi Rizzo said the following:
> On Fri, Apr 14, 2006 at 04:28:23PM -0700, Brian Degenhardt wrote:
>>why removing curly braces on one-line if statements is worth the trouble 
> 
> on this there are different schools of thoughts, but my take in
> general is that it makes the code a lot more compact and readable,

at the risk of sacrificing readability, using curly braces even on single 
line if or else statements reduces errors later on when the one line 
expands to a two (or more) line. i've been bitten by this enough to 
automatically use braces even if it's a one line if/else or for.

-- 
Regards,                           /\_/\   "All dogs go to heaven."
dinesh at alphaque.com                (0 0)    http://www.alphaque.com/
+==========================----oOO--(_)--OOo----==========================+
| for a in past present future; do                                        |
|   for b in clients employers associates relatives neighbours pets; do   |
|   echo "The opinions here in no way reflect the opinions of my $a $b."  |
| done; done                                                              |
+=========================================================================+



More information about the asterisk-dev mailing list