Is it "better" to initialize class variables in AS3 class constructor? Or can I just initialize them by default when I declare them at the top of my class? I ask, because when there are many class variables, it seems inefficient to declare them in one place, and then initialize them in another, when I could easily do it in one place. This one is better than the other, why?
Thanks!
eg:
constructor initialization
class foo { var bar:Boolean } function foo():void { bar = true; }
OR
initialization by declaration
class foo { var bar:Boolean = true; } function foo():void { }
source share