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?)
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
__,_._,___
- [flexcoders] Cast or create local var - which is best \ per... bobpardoe1959
- Re: [flexcoders] Cast or create local var - which is b... JesterXL
- Re: [flexcoders] Cast or create local var - which is b... Paul BH
- Re: [flexcoders] Cast or create local var - which is b... Ralf Bokelberg
Reply via email to