|
|
|
|
|
by Clubber
2945 days ago
|
|
It's not scaling issue, it's a refactoring / maintenance issue. Weakly typed languages cost much more to maintain because you can't have good refactoring tools. In a strongly typed language, if I want to rename a parameter that is used in 20 places, I can hit "Rename," rename it, and it will rename all 20 instances with perfect precision, and that's it. With weakly typed languages, you have to search and replace, which is much more prone to error. This is much more of an issue for JS applications that are much larger than just doing some stuff on a page. I agree, it's a tradeoff. Many languages these days can do both. The best is strongly typed until you are dealing with JSON or something of that nature. |
|
You don't need static typing to do codebase-wide renaming, it just makes it a little easier to build the refactoring tools, but since that is a one-time cost it's not really a particularly important factor in the language design. Other language design decisions have much more influence on this development cost, too, such as reassignability and scoping rules.
"Strong typing" is also something totally different from "static typing" - I'm not sure why you're bringing it up here. The two are not interchangeable terms.
EDIT: Actually, doesn't Webstorm already do such mass-renaming for JS?
EDIT 2: I also object to the use of the word 'refactoring' to refer exclusively to renaming variables. Proper refactoring involves much more work, most of which isn't automatable regardless of the language you're using.