[Coco] Re: optimizing

Roger Taylor rtaylor at bayou.com
Wed Dec 10 00:46:01 EST 2003


At 12:28 AM 12/10/2003 -0500, you wrote:
>I agree mostly.  First, use an efficient algorithm.  As you code it, include
>any optimizations that come to mind, as long as they don't make the code
>harder to understand or to debug.
>
>In C there's a big temptation to compound short statements together, like
>     if( (z = x + y) > 0) { ...
>and later, if you decide the test isn't needed, you have to "salvage" the
>     z = x + y
>part out and keep it.  Everyone who hasn't been bitten by this one, raise
>your hand.  I thought so :-)  --Mike K.


Many times, but I use HLA.

if(somevariable=true) then
//      I just tested somevariable twice
endif;

or how about:

if(somevariable<>0) then
endif;

:)


----------
Roger Taylor


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://five.pairlist.net/pipermail/coco/attachments/20031210/e04631fe/attachment-0001.html>


More information about the Coco mailing list