13
votes
Modern IDEs are magic. Why are so many coders still using Vim and Emacs?
Link information
This data is scraped automatically and may be incorrect.
- Authors
- John Biggs, Ryan Donovan, Sara Chipps, Nahla Davies, Ben Popper
- Published
- Nov 9 2020
- Word count
- 1178 words
I don't really get this article. Nobody uses a stock "familiar" vim or emacs for programming unless they aren't doing much more than small personal projects. If you are working on relatively large projects, though, and you use vim or emacs, you are probably going to spend a lot of time installing packages and configuring your text editor to the point where it basically is an IDE, albeit one you have pretty much created bespoke for your exact needs. And while there is tons of time to be wasted in setting up a dedicated IDE, I think that the main problem that an IDE is trying to solve (and usually does a pretty good job of solving, in my personal experience) is reducing the amount of "startup" time required for getting a project going.
I program with a pretty stock vim. It's kinda liberating to be able to work efficiently on any machine at any time. And I somewhat subscribe to the idea that if you need an IDE to deal with the complexity of your software then you need to re-think your abstractions. I'm lucky that I rarely have to work with legacy projects but when I have to do so I do find IDEs useful, but they're never a first port of call.
Chiming in to echo this. I use vim with a couple of plugins like powerline to make it a little more modern. I don't need much more than this. Granted, I am not a software dev but rather a scientist, so I am sure that no matter how big I think my projects are they are not nearly as complex (from a CS point of view) as a standard software dev project. I use vim because I need to be able to edit and run my code on tons of different systems, many of which are either only accessible through SSHing or at least more easily accessible in this way. vim is already on pretty much all of these systems, and it only takes a few minutes of one time config to get it set up the way I want. Maybe one day I will move on to a more modern IDE, but vim does everything I want or need for my projects.
I think this could only be the case if you're writing code that you've already written a couple of times before. It seems ridiculous to prioritize that kind of simple or boilerplate code over everything else.
High availability and fast startup is important to people who make small edits to a lot of different projects, often in different languages. Being able to load and edit quickly is important. Setting up a project just the way you like it hardly matters since you'll be gone tomorrow. This can be sysadmin work, or it might be someone who jumps around a lot between different tasks, or someone who works on cross-cutting concerns that affect many different projects.
Full-fledged IDE's tend to appeal the most to people who spend all day working on a single monolithic project on their own machine. Startup time matters less because you will be using the IDE all day and often leave the IDE open overnight. Spending the time tweaking project settings so all the advanced features work pays off. Refactoring tools save lots of work because you're dealing with a lot of code. Advanced searches and navigation matter because it's a large project.
Of course there is overlap. IDE's can be used for multiple projects. But these are the endpoints.
I used to spend a lot of time working in and on Java IDE's, but later switched to VS Code because it's more of a happy medium with an editor-like fast startup along with some advanced features. (This was back when I was coding at all.)
I use all the modern language servers inside vim. It's not even difficult to setup. Installing a new one is one command.
vi (and derivatives) and emacs are free software. Properly free. That's important.
And it's not really that vi is my ide; the whole terminal is. It's fast, familiar, aesthetically minimal, extremely flexible and configurable, etc
I don't agree with the author, but it's a good topic to discuss.
Why do/don't you use an IDE? Why not?
All the good IDEs are big electron monsters. I tend to do a lot of multitasking and a slimmer GTK or terminal option is a lot easier on the RAM than pretty much any of the major IDEs. I'd go with GNOME Builder but it doesn't have great support for Go.
So I use the
micro
text editor most of the time because it does enough (syntax highlighting, multiple cursors, showing compile errors directly on the problematic line, fantastic mouse support) and runs in any environment.This may sound flippant and dismissive, but I am actually curious. What is it that you do that RAM is that much of a concern anymore? I agree some of the IDEs can be huge memory hogs, but most developer machines have RAM to burn (I say with a sample size of... me).
Even on a computer with 16GB of RAM, I find that Electron apps (yes, even VS Code) or IntelliJ are noticeably slower and less responsive, opposed to simpler GUI and terminal text editors. Plus, I quite often have stuff running in the background that takes up a significant portion of that RAM.
For what it's worth, I do not have any performance issues with IntelliJ. I built my PC something like 5 years ago. I have 32 GB of RAM, but even with 3 projects open, it's only using 1.8 GB. I run it on a 2014 mid-range MacBook Pro and don't have issues there either. In the past, I've used it on a cheap used HP notebook running Ubuntu, and it's wasn't bad either.
VS Code, on the other hand, is definitely too slow for me.
I do all my work on a ~2015 Macbook Air. It has 4GB of RAM.
Maybe it's true that many machines these days have plenty of RAM to handle all these programs. But, to paraphrase Parkinson's Law
If we build all our apps with this mindset, cheaper/low-end devices would become practically unusable. That puts people who can't afford good machines at at disadvantage.
Same here, I work on a 2012 MacBook Pro with 4GB of RAM.
Xcode was always a bit of a stretch, but after a few years they upgraded it so much that it barely starts.
I can't write Android apps anymore. Forget the IDE, even running Gradle eats a whole universe of RAM.
I switched full-time to Linux after a Ruby bug made Homebrew swap for hours when unpacking LLVM. (Arguably it's a Homebrew bug. I don't know if it's fixed.)
I never thought I'd become a grumbly old-school hacker-type this young, but come on, guys. This is old hardware but it's not ancient. This computer can run, I don't know, dozens of YouTube videos and instances of Gmail at once. It compiles anything about as quickly as any modern hardware, proportional to the number of cores. After I bought an SSD it boots in like 15 seconds. Practically the only thing I can do to make it slow is to run modern development tools.
I think it's a problem that the resources required to run and develop software are so different.
See that's what I thought about 8GB, it'd be enough for basically whatever. But I've got a good collection of web-based apps with no webless alternative, and they all need to be restarted periodically or else things slow to a crawl. That's one thing Windows handles better than Linux, maintaining responsiveness when having to swap heavily.
sits quietly with 32GB
In my case, I tried Atom and Code from MS. I have a Thinkpad T480 with 32GB of RAM and i7-8650U CPU @ 1.90GHz and there were times when I would throw something at it because it was SLOW as hell, only to check top and see they use 100% CPU/70-80% RAM. With vim I don't have this problem, of course.
The good thing for me is that I don't need a full blown IDE to do my work (devops) and the only times I used those tools were just too see how they would fit in my workflow.
I daresay none of the good IDEs use electron;
Intellij (and others from jetbrains): java (or kotlin?)
Visual studio: c++
Qt creator: c++
I think the only popular editor using electron is vscode (maybe atom too; but same story there), all of whose 'magic' comes from LSP servers that can be consumed by most editors and IDEs.
Vim is an acceptable emacs implementation, and a better one than vscode. It has, for instance, concise facilities to express highly context-dependent grammars in a way that most syntax highlighting engines would struggle with.
I don't use an IDE if configuring it requires more than a few steps. Almost always IDEs play nice with projects done exactly like they expect them to be configured, but any step outside of that and you're in trouble. That's why I usually default to an advanced text editor + terminal, where the time between checking out the code and starting to work is minimal.
Also the amount of things that IDEs show are distracting to me.
The original reason I picked vim was that it seemed to ~16 year old me like switching from MacOS to Linux, if that makes sense. Like driving a manual car. Like I was cool, hanging with the big kids. I kept using it because I've never needed to do anything it won't do (with plugins, ofc), it's flexible, and I feel like a proper hacker using it. Oh, and I would feel weird firing up an electron behemoth to edit some config file. It's nice I can do that in a tmux pane.
I can probably come up with more justifications and argue them, but really it just feels cool.
Okay, so we're establishing a context of a psychologically driven choice. Fine, maybe you're right. Let's see...
Endless war, scary! Let's check out that link. Funnily enough, the highest rated comment is about using both and their relative strengths. Seems thoughtfully reasoned, but it could be a fluke. Let's check out some other responses, hmmm, the popular consensus seems to be just that.
With the old wars coming to their conclusion, now, we are see all the hordes of grumpy and misguided Luddites banding together through the power of implementing custom keybindings to work their arcane practices against the elegance, power, and status of any modern IDE. /s
The lack of subtlety from these content marketers is palpable here. But I love the approach, I'll be honest it got me as far as downloading the VScode .deb. Something I've already used through work and was fine using because Vscode is nothing special to learn or adjust to, it just replaces out-of-the-box mobility at the benefit of minor conveniences.
I don't use a different editor (nor an IDE) for a combination of two† reasons:
Part of it might just be laziness+inertia, but a lot of the bells and whistles I see in full-blown IDEs makes me think: Whatever happened to using tools that "do one/few thing(s), and do it/them well"? Modern IDEs seem to want to fulfil the roles of file manager, terminal, shell, window manager, disk searcher, version controller, differ and more. I ask: were your existing tools that played these roles so terrible?
/ag|ack|ripgrep|grep|egrep/
./git (diff|add -p|restore -p|stash|commit|log|blame)/
.*shrug*
† "Our two weapons are fear and surprise...and ruthless efficiency...."
See, I never knew a world without all these fancy IDEs so I feel like I could take the opposite stance. Why would I learn all these different tools when the ones built into my IDE work so well?
The first time I used the terminal was inside of xcode. Since then, I almost exclusively use my IDE terminal. It works exactly as well for me as terminal or iTerm. Why would I open up another window and have to manage sizing and location of two window? What I have with the terminal inside VSCode is way more convenient.
I can use
/ag|ack|ripgrep|grep|egrep/
, but I'm not very good at them. Anything more than the basics of-r
and-i
and I'm fucked. I can super easily search substrings in my IDE and its way easier for me. Why would I sink the time into learning all those other things?I don't feel proficient with git. It is some fucking magic black box that I will guaranteed fuck up a command using and somehow destroy my repo configuration or state beyond belief and end up just blowing the whole thing away and re-cloning it and hoping I hadn't done too much work. Hell yeah I'll take easily visualizing my diffs using color cues and having guardrails to make sure I don't shoot myself in the foot too bad.
Never heard of it, but I HAVE tried navigating and understanding project trees all via the command line, and its a nightmare and a headache and I will 100% get confused and end up drawing it out. I'm a very visual person. Hell yeah I want to see my project dir tree 100% of the time I'm coding to easily open up other files without having to try and figure out where the fuck they are
cd
bycd
.Huh... Didn't know VSCode could do that. I don't know why I'd ever need it. But neat! Learn something new every day.
Do you never drop a parenthesis or bracket, or have typos and wish someone had warned you before you so you hadn't spent the time closing the file, running your program, getting an error, opening back up the file, going to the error, fixing it, closing the file, running, finding out there's a typo in a variable name, opening it back up, editing the name, closing it, running again, etc? My linting warning saves me so much time. Any time I'm working on a remote server, I'm SO much slower. I go out of my way to avoid having to write code on remote servers, going as far as to write it in my IDE, using VIM to open the file, delete the contents, and paste my new version because I will save so much more time than trying to edit large portions of scripts on a remote server.
¯\(ツ)/¯
I'm not opposed to people doing it a different way. You know all the tools and they work great for you! I am genuinely happy you have a method that works for you. But for me? The old tools suck. I'm a super visual person. I draw diagrams of almost everything. My desk is surrounded by whiteboards. I always use finder when its possible. Having all of those tools in one place is how I learned and its way easier for me to do things this way, like its easier for you to do things your way with all the tools. I don't really have a point in this. I had a point at one point, but really the comment turned into "interesting I have the same feelings for why I use an IDE. Neat."
Agreed! People should use what works best for them, and there's room in the world for different tools and different ways of doing things.
This made me think of my solution:
which made me wonder how you feel about aliases like this. On one hand, it's super convenient, on the other, I am not actually interacting directly with rg, so I won't recall all the flags when needed. How do you feel?
Your comment made me think about this article which fits into this overall topic pretty well: Vim Configuration Porn, Zen, and .vimrc
It's a good post overall, and he specifically talks about how some of his custom mappings made it so that he didn't really remember how to do things "manually" any more, which reduced his flexibility.
So I definitely agree with your point here, but this seems more like a general problem with how software is typically developed in the modern world rather than an issue unique to IDEs.
I don't do much actual programming these days, mostly Terraform, YAMLs, bash, a little Go and Python; Intellij IDEA is mind blowing compared to vim, at least for me.
I find that any vim setup becomes your own really quickly, and so do the problems, and you're stuck figuring them out instead of doing the work.
I still use vim when I randomly SSH somewhere, but for anything on my local machine I prefer Intellij.
Emacs? You'd have to be insane to use that.
I usually use vim for my text editing needs. But I have to at least give emacs a lot of credit for being an incredibly cool idea.
Just so it's clear, I don't even really consider emacs to be a text editor like vim is. That's what makes it so cool. Emacs is more like a lisp interpreter that comes with a text editor built in that is itself written in lisp.
Small changes on a remote server: I'll use vim. I know the basics and the basics are what I am guaranteed on any of our servers.
Big changes on a remote server: Either pray that it is a git repo so I can check it out locally, edit it in my IDE, push out a new branch, check out my changes, and test, OR probably fuck up a lot. Once I know I did it right I'll make an MR. I have pretty bad ADHD and my biggest struggle is attention to details. Its very common for me to make small syntax issues. So I heavily depend on linters and syntax validators in my IDE to try and avoid committing as many of those as possible. When its small changes I'll risk it and try to be extra careful since the whole git route is a bit cumbersome, but for anything more than like 10 lines I'm going to my IDE.
When else I use my IDE: Any time I am working locally on my machine. If I'm going to be copying and pasting things from multiple files I'll use my IDE as well. Navigating file structures in Vim compared to in VSCode or IntelliJ is night and day for me. I have no idea how people do complicated things with VIM. Really I try to go out of my way to avoid using VIM and stick to my IDE as much as possible.
All that said, I do use vim extensions in my IDE. I like the aspect keyboard-based navigation, I want to keep that. But that's about the only aspect of VIM I want to use.
This sentiment doesn't match me at all, but I think it's great for people to choose and use the tools that work best for them. I don't use an IDE, but I wouldn't try to argue that there's no place for them in the world, or that they're not useful for anybody.
VSCode has a remote plugin that uses sshfs or something similar to let you explore directories and edit files on a remote server or inside a container.
I grew up with Joe (Joe's Own Editor), switched to Vim for syntax highlighting after a few years. Many years whence, after beign dragged from Linux VT into X kicking and screaming, and after a few false starts, found Sublime Text.
In parallel, moonlighted on a few jobs requiring VS (C#) and Eclipse (J2SE, Android).
About two years ago started serious effort to switch to Pycharm (Python, JS) and then IntelliJ (Python, Kotlin, JS, Go).
Having used all of the above for extended period of time, I'm most comfortable in Sublime, for the following reasons:
Nowadays I use Sublime (w/ just a few basic plugins) on my machines and vi/vim when SSHd (or when writing git commit messages in command line).
I have learned so much from using Emacs that I could imagine using an editor that wasn't designed in the same way. Lisp was the first programming language that clicked with me. You can make Emacs EXACTLY what you want, and you can do anything in Emacs. Emacs does have a rather steep learning curve, but instead of plateauing at power-user level, it keeps letting you optimize it. Also, with the Language Server Protocol, I can get IDE-level functionality for the vast majority of languages.
My dream for computing in the future is that an entire OS is built on the Emacs philosophy, so I can make MY computer fit with MY brain, not the other way around.
It’s not hard to get features commonly associated with IDEs on Emacs. If you use a distribution such as Doom Emacs, many things will be reasonably plug and play. I understand that there are things other programs do better, and essential features that are only available on certain IDEs, but so far that was not an issue for me. I started using Emacs relatively recently. I find it useful and flexible. I tried IDEs and the popular Electron based text editors, but customizing them was a pain and the interface was not as responsive. I saw no reason to use them, especially because everything I needed was also available on Emacs.
Emacs has actually useful features, this is not just about performance...
And yeah, I also like Vim, but for other stuff.
This article really misses the mark. Most emacs (and probably vim) users add packages that provide the same functionality of as an IDE.
The only modern IDE I prefer to use is VSCode, and in that case, I still use Vim key bindings since I've become used to editing in vim. The reason I use VSCode is because it's the fastest modern IDE with autocomplete (which is all I really need). I could try to configure my vim setup with whatever language servers I need, but for the time being, VSCode works.
I have been the guy who used IntelliJ on teams that used Eclipse (for java) and Atom (for scala). The tools you use shape the code you create: Linting and refactoring tools are the more obvious but project organization in general is heavily influenced by the IDE, at least in java world. You don't build class hierarchies so deep when you need to keep them in your head instead of being autocompleted on the fly. Same with names, and code snippets. Frameworks like spring get very hard to use without IDEs that know their idiosyncrasies as they change things around a lot.
A small ecosystem of simple (commandline) tools is in my opinion easier to adopt if you are developing something in the open and is my preferred way of doing things (I'm vim team, though). For professional teams on restricted computers and software it is miles easier to just get a couple licenses approved and share your IDE configuration.
IDEs are tooling just like package managers, linters, version control, code repositories, and perhaps even frameworks. I would advise against using tools different that the rest of the team if you plan on sharing code with them.
Ed is the standard text editor.