Just had my mind going today. I spent some time in IE debug mode, browsing the web as usual, and oh boy do I see many errors 🙂 Most of these errors are because some value are of a different type than expected (at least as far as I interpret the error messages).
What are the reasons JavaScript and similar scripting languages aren’t strongly typed? Is it just to make the languages “easier” to understand and more accessable, or is the lack of a “compile-time” the real problem?
It should definitely have strong typing available. Actionscript 3 is strongly typed, but still has prototype inheritance and a wildcard type if you need dynamic objects.
There are no downsides to having that feature available, and I have to say, for a project of moderate to large size, strong typing prevents A TON of problems. To get the most out of it you need IDE support so it can report errors and provide autocomplete options, but Javascript would be in a whole new world if it had real classes and strong typing.