I'm going to chime in here.

Lazy Instantiation is an irrelevant argument when you're instantiating in the constructor. What you perceive as "cleaner" is merely philosophical.

var container:Sprite = new Sprite();

vs

var container:Sprite;

public function ClassName()
{
   container = new Sprite();
}

I think the single line version is cleaner. In fact, I would argue that instantiating classes in their variable declaration is a very specific way of making it extremely clear that those variables are being made available immediately to the class, and anything that does not have a definition is going to be lazily instantiated later.

I'm a big fan of this type of coding practice where the meaning is derived from the style.

My 2 cents,
Steven
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to