[mtasc] Get/set vs 'normal' methods
David Rorex
drorex at gmail.com
Wed Mar 16 01:27:34 CET 2005
I did a quick look over the bytecode generated in both cases (using
flasm to decompile it), and it looks like there is no overhead. using
get/set may even be faster (I don't know though), because in that
case, the variable is marked as a 'property'
-David
On Tue, 15 Mar 2005 17:22:46 -0500, Richard Kilmer <rich at infoether.com> wrote:
> Is there overhead to having:
>
> public function get foo() { return __foo; }
> public function set foo(value) { __foo = value; }
>
> Vs.
>
> public function foo() { return __foo; }
> public function setFoo(value) { __foo = value; }
>
> I understand the code 'readability' value of the get/set methods but is
> there some type of extra methods, dispatch or overhead to getter/setter use?
>
> -rich
>
> --
> MTASC : no more coffee break while compiling
>
More information about the mtasc
mailing list