5 ms·
You're right, but... These features are available for JS using add-on features such as JSDoc, TernJS, etc... but you're right. Cross-file, these tools don't wo
by ericelliott 11y ago
You're right, but...
These features are available for JS using add-on features such as JSDoc, TernJS, etc... but you're right. Cross-file, these tools don't work as well as they do for Java.
BUT.
If you need super-advanced cross-file refactor capabilities, chances are you're not using modern best practices for JS application design, including small modules with simple APIs & the open/closed principle (try to make APIs open for new features, but closed to breaking changes).
Using small modules generally means that you don't write one large monolithic app. Instead, your app is broken into smaller self-contained pieces that are independently usable and independently testable. Doing so dramatically reduces the need for the kinds of refactors that are harder to do in JavaScript than in statically typed languages.
There are also lots of advantages to languages such as JavaScript that allow for type inference without annotations littered all over your code.
Annotations come with a cost, and JS provides many benefits that are not available in languages like Java.
As I said in the article, the JS runtime tooling makes intellisense look like a baby chew-toy.