The current compiler setup makes use of static constants add considerably more 
bulk to the compiled code than string literals.

It might be possible to make the Google Compiler do a better job, but as it 
stands, we’re better off with string literals than constants.

The FlexJS style of defining constants are to define them where they are used 
rather than creating new Event classes simply for defining the constants. (i.e. 
Timer.TIMER rather than TimerEvent.TIMER)

> On May 23, 2017, at 5:21 AM, Justin Mclean <jus...@classsoftware.com> wrote:
> 
> Hi,
> 
> In the Flex SDK we have a large number of event names hard coded. Is there 
> any reason (performance or otherwise) for coding in this style?
> 
> Usually I would define them as consts in a single place and refer to that. 
> Are we assuming the compiler will optimise this and that no one will miss 
> type event names?
> 
> Thanks,
> Justin

Reply via email to