开发者

Why does ActionScript 3 have two modes of compilation (Strict & Standard)?

开发者 https://www.devze.com 2022-12-15 13:59 出处:网络
I am learning ActionScript 3.0. Coming from Java world I can easily relate to strict compilation mode. I think having type safety checks at compilation time makes perfect sense.

I am learning ActionScript 3.0. Coming from Java world I can easily relate to strict compilation mode. I think having type safety checks at compilation time makes perfect sense.

This makes me wonder, why the compiler allows a standard mode were all the type safety checks are deferred to run time? Is compatibility with ol开发者_如何学JAVAder ActionScript specification the sole reason for having standard mode?


not all functions have to be run as strictly adhering to a type at compilation, especially if running dynamicly created variables and applications. have a look at the LiveDocs page for some good examples. It is mainly a stylistic thing as far as i have found, depends on the background you are from in your coding.


I'm not sure whether this'd qualify as an answer, because who really knows exactly other than the Flash team, but my guess is that because AS3's an implementation of ECMAScript, and thus loosely typed by definition, that that's probably the main reason why there's an option for standard/loose mode.

0

精彩评论

暂无评论...
验证码 换一张
取 消