Hacker News new | past | comments | ask | show | jobs | submit login

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.




There is absolutely no reason why this wouldn't be possible in a dynamically typed language. I'm in the process of building such a tool for JS, in fact.

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.


> You don't need static typing to do codebase-wide renaming.

But you do. WebStorm isn’t magical. It can’t understand your untyped code like it can understand typed code.

The more I’m reading your comments on this thread the more I’m not sure you’ve ever used a static typed language with a good IDE. If I am correct, I think it makes more sense for you to try Java/IntelliJ and then weigh in on this subject. You may have a very different opinion.


It’s funny you mention JSON because when you deal with JSON is when you realize what really differentiates the two styles of language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: