Yes. The ActionScript 3 compiler is your friend

This is a post I stumbled upon only a couple of weeks ago and really just want to point to it again and reiterate ALL of what is said here.

Coming from the dynamic "language" ColdFusion into "semi strict" AS2 and now AS3 it seemed at first that the compiler was NOT my friend. I have now come full circle and absolutely love the "strictness" of AS3. Sure you write more code but the pay off IS worth it.

The compiler certainly is your friend and should NOT be kept in the dark by using Object as "Data Buckets" etc. (See Paul Williams post Compilers have feelings too) Do the extra "leg work" and make you own data types (VO's etc) and cast anything that returns an Object to that type.

This for example

model.currentProduct = mydatagrid.selectedItem as ProductVO

where model.currentProduct is of Type ProductVO and the returned value from selectedItem (Object) gets cast to ProductVO now the compiler is your friend

Comments
zxspam's Gravatar [url=http://google.com]google[/url] <a href="http://yahoo.com">yahoo</a>
# Posted By zxspam | 5/19/08 8:20 PM