Against Fx - ActionScript/MXML namespaces

1 view
Skip to first unread message

Ben Clinkinbeard

unread,
Feb 2, 2009, 12:24:04 PM2/2/09
to Flex SDK Community Committee
Relevant argument from http://iamdeepa.com/blog/?p=34:

3.ActionScript/MXML namespaces
Even if we used namespaces to aid in disambiguation, explicit scoping
is still necessary. For example, in MXML, which namespaces are added
by default? In the ActionScript world, when you write: var b:Button =
new Button(), which Button do you mean? You either have to explicitly
import the right Button class, or the system (code hinting) will have
to prompt you to chose which Button you wanted to instantiate and add
the explicit import directly. In the Gumbo timeframe, we are hoping we
will improve code completion to assist with this so that you don’t
have to type ‘Fx’ all the time. Imagine a code-hinting world where you
type ‘Bu’, and ‘FxButton’ and ‘Button’ drop down. Completing that will
insert FxButton; if you meant to instantiate a Halo Button, you just
have to select it in the code hinting dropdown.

Tom Chiverton

unread,
Feb 2, 2009, 5:28:06 PM2/2/09
to flex-sdk-commu...@googlegroups.com
2009/2/2 Ben Clinkinbeard <ben.clin...@gmail.com>:

> Even if we used namespaces to aid in disambiguation, explicit scoping
> is still necessary. For example, in MXML, which namespaces are added
> by default?

Either there is an import all ready, or the developer adds one - the
IDE can even have an option to prefer Flex 4 to 3, and set up that
import by default.

> In the ActionScript world, when you write: var b:Button =
> new Button(), which Button do you mean? You either have to explicitly
> import the right Button class, or the system (code hinting) will have
> to prompt you to chose which Button you wanted to instantiate and add
> the explicit import directly.

Nothing wrong with that. As above, if Builder defaults to Flex 4
package, or the compiler has a --prefer-flex-4 and --prefer-flex-3
argument there's no issue.
OK, so the developer can still write buggy code, and the compiler will
moan - that's normal !

> In the Gumbo timeframe, we are hoping we
> will improve code completion to assist with this so that you don't

They we go then. Fix the supporting tools (Builder) rather than making
the SDK ugly...


--
Tom

Reply all
Reply to author
Forward
0 new messages