Unless the loop is a proven bottleneck, please don't use that while loop. I see 
enough mystical journeys going through other people's code, I'd hate to start 
seeing that floating around all over the place. Premature 
optimization...evil...etc.... Pity the Java programmers who wander over into 
AS2 and 3 land and have to squint at oddball loops.
 
> 
> From: "Steven Sacks | BLITZ" <[EMAIL PROTECTED]>
> Date: 2006/09/18 Mon PM 11:27:33 CDT
> To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
> Subject: RE: [Flashcoders] Find item in array
> 
> There has been extensive testing on this (search the archives) and it's
> been proven to my satisfaction that pre-decrementated loops are
> consistently faster than post-decremented loops, and specifically that
> while (--i -(-1)) is faster than while (i--), less p-code or not.
> 
> To the point that it's more readable, that's like saying that you prefer
> quarter notes instead of sixteenth notes when reading music.  Once you
> write while (--i -(-1)) a bunch, you have no trouble reading it.  It's a
> hell of a lot easier to read than the fastest for loop syntax.
> 
> for (var i = myArray.length; --i -(-1); ) {}
> 
> I mean, if you find inline conditionals or non-braced if statements hard
> to read, does that mean you shouldn't write them or that you should
> learn to write them so you can learn to read them.
> 
> I didn't like mustard when I was younger.  Does that mean I shouldn't
> ever like mustard?   ;)
> 
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> 

--
John Mark Hawley
The Nilbog Group
773.968.4980 (cell)

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to