by ryaniscool · 11y ago · 0 comments
That being said, I disagree with the main premise. The tooling is getting there but it's just not as good as old-school IDE's for typed languages. Specifically, the code insight tools don't really compare. For example: Intellisense, refactoring, go to definition of a symbol, and find symbol references.
I programmed in typed languages for many years and when I find myself back in an old-school IDE for a typed language like Eclipse or Visual Studio a cognitive load is lifted off my shoulders.
I know for front-end, and also a reasonable number of back-end web developers in scripting languages lightweight editors like Sublime, Atom etc are popular these days.. maybe that's driven the idea that "scripting/untyped/loose typed languages can't have good Code Intelligence"?
the biggest issue i see, is that the "dialect" that you need to follow to enable the intellisense isn't well-defined. what seems to work for me:
1. explicitly define constructors
2. explicitly define the prototype
3. use jsdocs if you're using inheritance
4. initialize object literals (even if they get overwritten immediately)
One idea I've had on this subject is that each layer of tooling multiplies or reshapes the capabilities of all the other layers.
This sounds great, but there are good reasons to choose limited tools. Sometimes a powerful tool can grow so powerful that it does the work of other tools, and suddenly your other tools are dependent on this one layer.
So we use vim to edit 10 KLOC files, but should your files be that big? Your editor can do braces and semicolons for you, but should you need those? If I have a fancy type system do I need tests?
I'm not specifically advocating for a crappy editor, but the rule of least power suggests that we might get ultimate flexibility out of weaker tools.
Honestly I don't buy this. Nobody sufficiently experienced to need the power of vim/emacs should also be so comfortable with live editing on a server that it drives their choice of editor.
I've used simple text editors and semi-intelligent editors that have basic code intelligence from a prebuilt library and honestly i wouldn't go back to either of them.
The advantages of a good IDE are enough to make me overlook that it runs on Java of all things.
It's amazing how many capabilities people miss on.
My main experience of using webstorm was on a client's legacy code base. Their policy was that webstorm had to used over any other tool.
None of the clever feature like go to definition worked properly and it ended up just dropping back to grepping for symbols project wide.
Personally I couldn't see any features you couldn't get from using TernJS and ctags with a quality editor.
I found it a bit slow and the keyboard navigation to be about limited. (Not in the main editor so much but in little things like navigating window splits, manipulating pairs, etc)
My gf works in js with webstorm and was amazed by what I whas doing in php.
That said php is much more static than js.
On the other hand I'm sometimes surprised by the things it can figure out from my code.
VS Code provides all of this (at least for Angular, which I use it for). I think JetBrains supports those actions as well (WebStorm)
Are you sure this is true for everyone? I learned programming through Java, doing about 6 months of it in an IDE. But I have now been programming in pretty much pure JS with no ide (just vim) for a much longer time and I feel a big cognitive burden when I go back to heavy IDE's. I think our minds change over time and become used to whatever we're programming in.
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.