|
|
|
|
|
by dustin1114
4113 days ago
|
|
I think I like most of what this document proposes except for the following: In strong code, accessing objects (strong or not) throws on missing properties.
New object properties have to be defined explicitly and cannot be removed
from strong objects.
To me, this seems to break a fundamental aspect of the language. I've found it very acceptable to be able to define an object literal property "on the fly." However, with strong mode trying to make the language friendlier to eventually being more statically typed, I see the necessity. It just boggles my dynamically typed mind :-) |
|
The given justifications for doing this, though, seem to be all about performance rather than an attempt to evolve the language.
If that's true, I think it's possible the proposal has a naming problem.
Calling it "use strong" implies that this is about evolving the JS language so that devs are spending time writing more strongly-typed code.
Calling "use optimize" would make it a lot clearer that this is not an attempt to Java-ify JS, and this is more something you'd primarily invoke for performance-critical code paths.