[Coco] Re: optimizing
KnudsenMJ at aol.com
KnudsenMJ at aol.com
Wed Dec 10 00:30:10 EST 2003
In a message dated 12/9/03 6:56:40 PM Eastern Standard Time,
rtaylor at bayou.com writes:
> Anyway, my own general rule (derived from a degree in hardknocks) is to not
> save all of the optimizing for last, so it won't be that much extra work.
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.
More information about the Coco
mailing list