Software developer blog

IDE vs. VIM

Have you ever seen people engaging in endless debates about what editor do real developers use? Sure you have. You might have even read the xkcd classic on the topic:

I'm sure you've been part of this discussion too.

I'm sure it's not much of a breaking news for you, that this is mostly a religious debate. Talking about it is just as pointless as trying to convince atheists about the existence of God, or vice versa.

That being said, I'd like to go further. Lately I've been hearing people debating about how much of an idiots are those who use vim instead of using an IDE and vice versa. You can go on and on about the wonderful features of Eclipse or InteliJ but you might easily get laughed at in certain circles for not knowing that modern vim versions support most of those things too. You might argue, that IDEs are slow, and can not be effectively used through an SSH link, and be called an idiot for that. You may even start a debate about how mode less mouse based software are for non technical people who can't keep in mind which key does what in which mode, and if they are in the right mode. Eventually someone will tell you that real programmers like modes, because they are effective, and he would be just as wrong as right.

Bottom line: don't even go near that debate. (I sometimes jokingly bring up the topic, but only if I'm prepared for flame wars.) You don't want to know what that guy uses. All you should care about is if they are working effectively. You may argue that a more powerful tool will let you move faster, but that is not necessarily true: it takes time to navigate around on a feature laden interface, while most features in vim are within a key press and you don't even have to move your hands from the home keys. On the other hand once you navigated to the right feature, it may do more for you, than any key press in any advanced editor. So who are you to tell which one is faster? You can't, because that all depends on the user. (Actually it also depends on the language, but I'll go into that later.)

I've been asked this question twice on job interviews: "What is your favorite tool for editing source code?" At one company the right answer was vim or emacs, at the other it should have been any IDE and definitely not vim or emacs. Both companies were big and famous software developer companies where smart people work. Still the interviewers asking this question were just as wrong as if they would have been asking me about my choice of breakfast. (French toast by the way.) Actually it's worse: it's like asking about both my sexual orientation and religion. It depends on so many things, and poor candidate won't know what is your "favorite" answer. Why do you even expect a right answer? At the same time you'll be judging them based on something that doesn't tell anything about their capabilities. As a candidate I think there is no right answer here... either way I might be screwed, since if the interviewer asked a question like this, she probably won't accept "it depends" as a right answer.

And what is my personal preference you ask? I'm torn on the topic with a preference toward vim, but I will tell you what I think is good about each.

In general I'm one of those people who prefers command line tools over GUI based stuff, since I feel they give me more control, and I can use them through ssh connections. I also hate how modern IDEs can fill the entire memory on my PC, and still freeze in the middle of a complex change. I like how vim uses modes, and gives me a lot of power for refactoring in languages for which there isn't a good refactoring browser yet. (And that's where the language dependence comes in.) It's usually harder to extend modern IDEs than it is with vim.

On the other hand visualizing the result of static code analysis (like syntax checking) is easier with GUI based applications. (Yes... there are such tools for vim too...) A red line under the part that's wrong is less disturbing than a red background. Auto complete is also better visualized in GUI. So my primary argument for IDEs is aesthetics. I'm not even sure anymore if that's a valid one... However there are certain tools that are only available on certain IDEs. The most important being is of course a good refactoring tool. But that's like arguing for windows over Linux because there isn't a good program for a certain task. (No AutoCAD, no Cakewalk, no PTGui... I could go on...) So in the end it turns out that IDEs are not anymore useful than windows 🙂

Usually I switch back and forth between an IDE and vim. When I code C++ I almost never leave vim, unless I have to do something with a horrible legacy code base, because than I spend more time in the debugger. (GDB is fine as long as you have unit tests and a clean code, but won't help you much in deciphering an Odyssey of bad code.) When I code Java, I almost never open vim. With PHP I definitely prefer vim. (Edit: lately I've been playing around with PHPStorm, and that might change this... but actually that only shows that as tools change ones preferences may also change over time.)

My dream is a vim based IDE. A tool that is available in both command line and GUI mode. (The best would be one that supports an in browser cloud mode too.) It should support a wide variety of plugins and tools, be easy to extend, should not have too many background processes, so that it remains fast, and it should still have the power of modes that comes with vim.

@ //