I would go for b personally because:

it makes for more legible code (IMHO)
it means you dont have to type as much (I'm lazy)
in AS2, local variables were stored in a register that made access much faster - don't know if this is still the case in AS3 (anyone?)

On 7/27/06, bobpardoe1959 <[EMAIL PROTECTED]> wrote:

We are haveing a debate here at work regarding the the most performant
\ efficient \ best way of dealing with the casting of objects from one
form to another.

a) One person thinks that casting the object to the correct type each
time it is used is better because casting has a compile time penalty,
but at runtime does not incurr a cost.

b) The other person would have us believe that the creation of a
variable of the correct type and casting the object to it and then
using the local variable (thereby eliminating many casts)is better.

I side with a) on the basis that the creation of the variable and the
garbage collection of it costs more than the casting might.

Bearing in mind that either of these methods might be performed in
hundreds of places in the application.

Is there a difference ? Will any one notice. Is one better ?.

Are we being a little to retentive ?

thanks

BOb


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to