I tend to send this link on whenever this debate comes up, good article on 
public vars vs. getters and setters from a well respected Actionscript coder.

http://www.darronschall.com/weblog/2005/03/no-brain-getter-and-setters.cfm

And I also agree with Steve, Ian, the others, I used to be against public vars, 
but now I see when they don't need to have a "brain" i.e logic is run when they 
are called, and it's ok to allow them as a pair (i.e. both get and set), then 
there is no reason to not use public vars since from an interface perspective, 
they are exactly the same.  And if you ever need the "brain" inserted into 
getting or setting, it's extremely simple to add them afterwards.  Just writing 
out get and set for everything just bloats your code.  There is a place for 
both.  I code public vars all the time now, probably more than get/set pairs.  


Jason Merrill
Bank of America     Instructional Technology & Media   ·   GCIB & Staff Support 
L&LD

Interested in Flash Platform technologies?  Join the Bank of America Flash 
Platform Developer Community 
Interested in innovative ideas in Learning?  Check out the Innovative Learning 
Blog and subscribe.



_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to