I actually don't know whether
public function get foo():int
{
return _foo;
}
or
public function getFoo():int
{
return _foo;
}
is faster to call. But I wouldn't expect them to different greatly, and
which one is faster might change in a future version of the Flash Player
as the AVM gets optimized.
So the Flex SDK team designs our APIs with other considerations in mind.
We consider property-based APIs -- rather than method-based ones -- to
be best practice because properties can be expressed declaratively as
MXML tag attributes, and set in property inspectors in authoring tools,
while method calls require ActionScript code.
Gordon Smith
Adobe Flex SDK Team
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Joseph Curtin
Sent: Wednesday, May 14, 2008 8:34 AM
To: [email protected]
Subject: [flexcoders] Getters/Setters VS Function:Void/Return
Hey all,
I took a quick search, but was unable to find info on rather
getter/setters are faster, or functions that return are faster. Care to
enlighten me?
--
-Joe