If you’ve ever worked with me, or read my blog posts, you know I am an Emacs junkie. Emacs is my first and last editor, and I’ll happily spend hours making it just the way I want it.
Things Both Emacs & WebStorm Do Well
There are a few critical features where both Emacs and WebStorm work just fine. For one, they both do a great job of hooking into external code quality tools like ESLint. Either one can hook into these tools and provide real-time linting and error checking.
Things WebStorm is Better At / Emacs Can’t Do
While Emacs is great, there are a few things it is just plain worse at or can’t do at all. Critically, all of the most annoying ones are things WebStorm can do, which makes it very appealing.
Symbol and definition lookup is another great feature of WebStorm. While Emacs can find symbols and definitions in a single file via Tern, WebStorm can actually inspect your whole project and find a definition, or at least give you a very pruned list of candidates to choose from. This makes navigating through code exponentially faster, and it really reduces the strain of context switching between files.
Things Emacs Is Still Better At
Another thing Emacs is much better at is Vim emulation. While WebStorm’s Vim emulation is decent, I find frustrating bugs quite often. These include keys not registering, getting into weird states where I appear to be halfway between insert and normal mode, and a weirdly sensitive mouse selection that always seems to put me in visual mode when I don’t want to be. Additionally, some advanced features like macros rarely work right for me, and I have basically given up on using them. It also really irritates me that yanking does not copy things to my system clipboard, which Emacs does by default. I find that whenever I need to do any advanced editing like large find/replacements or macro-driven refactoring, I’m better off just opening the file in Emacs and doing it there.
Lastly, you can pry Magit, the Emacs git source control tool, from my cold dead fingers. I’ll admit that I haven’t even really tried using the VCS management inside of WebStorm because I can’t comprehend anything being better than Magit.
Pain Points Shared by Both Tools
My Current Workflow
Currently, my Node development workflow has me using WebStorm most of the time. The fact that it can easily run small subsets of tests, plus debugging and quicker code navigation, all mesh well with my TDD workflow.
I still keep Emacs open to my project, though. I use it to do all of my git work, and also to do complex edits using Vim macros.
>Despite all the advantages WebStorm has, there a still a number of things Emacs does better. One of the simplest is “dumb” auto-completion.
There is hippie expand in WebStorm! It is even bound to M-/ by default :)
You might also find this plugin useful: https://plugins.jetbrains.com/plugin/7906?pr=clion
I didn’t know about hippie expand, I’ll have to check it out. Call me lazy but its a bummer it is not just worked into the automatic (not key driven) completion when there are no intelligent completions :).
Admittedly it does takes some time to code up Emacs-Lisp scripts but this is the kind of tool building that is just part of the job and pays dividends over time.
End result: in 98% of cases, if you want to rename something globally in the project / change function signature, it JUST WORKS. And giving things better names is crucial in delivering better code.
In my experience it is spotty at best for JS. Renaming and extracting variables works really well. Extracting functions sometimes works, but often ends up calling the extracted function the wrong way, e.g. not using “this” to call it even when you extract it into the same class (granted this is an amazingly hard problem in JS). Inlining on the latest version of WebStorm literally does nothing, you click it and the code doesn’t change.
Sorry for the comment spam, when I try to reply to the comment above yours, it keeps replying to you.
Have you looked into [Visual Studio Code](https://code.visualstudio.com/)? I think people tend to dismiss it because it’s from MS but they certainly know how to make good IDEs and developer tools.
And if you are on Windows, give [Node.JS Tools for Visual Studio](https://www.visualstudio.com/en-us/features/node-js-vs.aspx) a try. It’s even better with the full power of Visual Studio behind it.
I second this!
If you’ve never used webstorm/idea’s git conflict resolution tool, then you’re working too hard. It’s the most comprehensive, easy-to-use system I’ve ever seen for conflicts, and produces correct code with less chance of errors.
You should try magit before you say that :)
I do everything except conflict resolution in magit. But for merge conflicts IDEA is imo superior.
I’m curious what you like better about it? The latest versions of Magit just open up conflicted files with Emacs’s built in smerge mode which I find perfect.
Hm, I actually never reflected on this before. Looks like mostly it’s just inertia and personal preferences :)
I think I like IDEAs UI here more (gutter marks for changes, sync mouse wheel (sic!) scrolling of three windows), and I also find inspections especially useful, because it’s easy to introduce some silly error during merging.
> While Emacs can find symbols and definitions in a single file via Tern
Tern does cross-file lookups too, though this sometimes needs a little configuration (to set up a module-loader plugin). Just do alt-. twice, once to go to the import and once to go to the actual definition.
I’ve tried that without success before, I may have my configuration wrong. I’ll be sure to try again soon and see if i can have any more luck.
I’ve been using tern more the last few weeks, and you are right that it can do cross file lookups. Unfortunately, at least for me it only works maybe 50% of the time. Sometimes, I can even get a particular symbol looked up in another file, and then try that exact same symbol again a few minutes later and see it fail. The unfortunate thing is that unless a tool is reliable it really isn’t useful.
Maybe i’ll see if I can do some open source work on Tern to make it work better in these cases.
> You’ve forgotten to mention the most important aspect of Emacs: it’s programmable.
You can build your own plugins for WebStorm, and if you make something others may find useful you can share it.
What about emacs’ ctags/etags for symbol lookup? That’s been around for a while and you have to generate a TAGS file initially, but you can definitely do that in emacs. If you want to do it the brute force way, you can use Projectile’s built in integration with grep/ack/ag and just search for “function doSomething()” to find a function definition, for example.
I’m surprised that you cite emacs as being unable to doing these things, because I believe emacs’ greatest strength is that you can augment it to do anything you can think of. It does require sometimes significant investment, but you cite the fact that you enjoy customizing emacs and you “spend hours making it the way I want it”. I would encourage you to dive in and write some elisp to add these features yourself to those packages you mention. I fully understand that adding features yourself is not the same as having them baked-in in WebStorm/IntelliJ.
Of course you can add things to emacs, you can add things to Webstorm too in the form of programmable extensions. I was reviewing features that are available out of the box or with easy to add extensions that anyone can use though.
Also, CTAGS has been a pain in my experience, and es6 which I am using is not well supported. and you have to set up something to continually regenerate your definitions as you add code.
Any tips for using Tape for unit testing in Webstorm? Did anybody find any helpful plugins for this? Any success stories about using Tape?
I have always worked on WebStorm and though there are some hardships, I find it quite useful. But after reading this I would love to give it a try to Emacs too.
You forgot to mention that WebStorm JS debugger utterly rocks. Does emacs even have JS debugging ?
In fact you can use PhpStorm as well which is prices almost the same. Because Phpstorm has all features of WebStorm as well as PHP.
I don’t believe that is true. WebStorm seems to have a lot more JS focused features that PhpStorm does not have.
Like what? Even if not enabled by default, can be downloaded for free.
Comments are closed.