Despite this whole FP issue coming back into fashion in the last years,
there's really no use for that in ECMAScript-like languages. Every piece of
code you can write using nested functions can be rewritten in a way that no
nested functions will be used and the program will work better.
I'm not sure where would you need immutable objects, except date and string.
I'm not sure what kind of impact you were afraid of re' constants, but, sure
the constant which is not static is initialized as many times as it's scope
is initialized:

function foo():void {
const bar:int = 100;
}

bar initialized as many times as often you call foo().

class Foo {
private const bar:int = 100;
}

bar is initialized as many times as often you create new Foo.

If you need an example of intensive use of "closures" in AS3, look into
binding mechanism in Flex. It uses them a lot, and this is why it is bad.
Another example - Googlemaps, which is just another example of a lame code.
It is confusing to think that big corporation with many years of programming
experience would produce crappy code. I cannot tell why did this happen
exactly... but you know, lots of girls wear high heels, even though it's one
hell uncomfortable :)

Reply via email to