Hacker News new | ask | show | jobs
by toprerules 589 days ago
I've seen so many editors come and go, and yet I've been using Vim for the past 20 years and have never had a problem. As stupid as it sounds, if I could give one piece of advice to any entry level SWE, it would be to learn Vim or Emacs and just stick with it for your whole career.
15 comments

I find this and the emacs sentiment really weird. I use vim daily for quick edits, but for any sizeable codebase, especially new/unfamiliar, IDE's are just better. It's like depriving yourself of a bunch of tools and helpers for no visible benefit.
Since I graduated, I've had people try to sell me on the following editors, which were going to be the future: BBEdit, TextMate, Sublime Text, Atom, Komodo Edit, NetBeans, and Eclipse.

Each was going to kill Emacs.

Somehow, I think I'll be using a version of Emacs until the day I can no longer type.

Meanwhile, everyone else is wasting months getting up to speed on the latest and greatest thing every 8 years or so.

This adds up over a career.

Oh, and by the by, this was written in Emacs using GhostText as the link between Firefox and Emacs.

>Meanwhile, everyone else is wasting months getting up to speed on the latest and greatest thing every 8 years or so.

Yeah I used to think this way, because you're right: becoming proficient in emacs takes significant effort and time.

But becoming proficient in VS code takes maybe 25 minutes. 25 minutes to change IDEs every 8 years or so doesn't seem like an onerous requirement to me.

Emacs just has extremely poor defaults and out of box UX.

>But becoming proficient in VS code takes maybe 25 minutes.

Becoming proficient in kicking a ball takes 5 minutes. Becoming proficient in football takes slightly longer. Magit alone makes VS Code look like a child's finger painting.

>Magit alone makes VS Code look like a child's finger painting.

Magit is indeed a great git client, but I don't see what that has to do with emacs having bad defaults and an out of box experience that could be charitably described as antique.

Antique means stable.

When you've been using the same thing for 20 years changing defaults to be trendy isn't a plus.

You'll understand in 20 years when you're on your 4th IDE which will change the world^tm.

Bad defaults for who? Emacs userbase is quite heterogeneous, not everyone is a swdev, not everyone is young. All it takes to have great defaults is maybe ten instructions in init.el.
So true! Now don't get me wrong, I quite like VS Code as it's so easy to set up and there is a plugin for almost anything, but I find myself always coming back to Emacs.

He's right about the defaults though. Use something like Spacemacs or Doom if you just want to dip your toes in the goodness that is Emacs.

I typed up some thoughts about the nth time I tried out Visual Studio Code to see what all the fuss was about and if my productivity could be improved vs. Emacs. I might turn it into a blog post, if I can be arsed to start a blog again.

One header read: "Not better enough". Inasmuch as Visual Studio Code does anything better than Emacs, it doesn't do things better enough to justify expending the high activation energy of switching, unlearning my Emacs workflow and learning all that I need to know to do things Visual Studio Code's way.

I honestly believe emacs UX to be fairly superior. I watch my colleagues struggle to find open files among tens of open tabs in vs code every day. Or endlessly navigating on the filesystem tree with the side bar before finding what they need. Things that take half a second in emacs take minutes for them. And the UI is so cluttered.
There are a number of neurodiverse hackers who've "switched off the targeting computer" precisely because it's disruptive to thought to always be having to constantly juggle the state of code in your head with the fucking video game appearing before your eyes as you type. I am one of them.

Recent research has confirmed that this is an actual phenomenon: https://link.springer.com/chapter/10.1007/978-3-031-35017-7_...

Discussed on Hackernews: https://news.ycombinator.com/item?id=36721055

If IDEs help you work better, that's great. Do not presume your experience and preference generalize to all.

Maybe i just never gave the heavyweight ide tools a fair chance, but i always found them more distracting than helpful. Focus is king for me, and vim gives me that.
I use IDEs with vim keybinds and zen mode (full screen, hide everything except text editor) when writing code.
VSCode is not a heavyweight IDE by any means.
It literally contains a whole browser engine just to render a UI.
Its all relative.
idk, I find I don't miss anything from heavyweight IDEs. I switched to neovim like 6 years ago. 95% of working with a codebase, familiar or not, is navigation and editing. LSPs enable pretty much any editor to intelligently navigate to definitions and find usages of a given construct. Anything beyond that is quickly hitting diminishing returns.

The one exception is maybe untangling particularly gnarly git conflicts.

good thing Emacs has a best in class git and visual diff editor package
Emacs is fine, but it's not really about the visual diff and more that you get syntax checking and other features in the diff view that afaik aren't available in lighter weight tool. Neogit is quite good and is heavily inspired by magit, so it's not like they're appreciably different.
Not OP, but I was confused as well, but found that a lot of people who did this had basically created an IDE-like experience with tmux, etc around vim, etc.

Not really my thing but I guess it works for them.

What tools, what helpers? I hear this comment a lot and it's just ignorance on the part of people who clearly have never tried to actually learn how to use (Neo)vim or Emacs. I've used Jetbrains, VSCode, Atom, Xcode plenty and there's nothing that I can do in those IDEs that I can't do in Vim besides things related to platform specific SDKs.
My current codebase is a liberal mixture of C, C++, Java, and mksh. The whole project uses CMake and GNU Autotools and ndk-build and whatever the heck calling mma with AOSP does.

There's no way to unify it given how many different moving parts are involved. Trying to fit this all within an IDE would be a project of its own...

A similar mix took me under 20 minutes to get a C++ + Rust + C# + TypeScript codebase working between VS proper and VS Code. In fact, I don't remember doing anything at all to get it working except installing damn node for TS and choosing CMake configuration in a dropdown.
How? What tools do you have that you can’t plug into any editor that supports LSP/DAP like emacs or vim?
Everyone's brain is different, but I'd bet you'd be surprised by how good you are at things you rely on an IDE for (autocomplete, go to definition). For other stuff, sed and grep will cover 90% of your needs. Source: me, and I'm pretty good at this.
Strongly disagree, but I am in a niche field, Linux kernel development. Emacs is really struggling with it's tools. But for Neovim: the plugins and good keycombos are absolutely essential to get certain functionality for my productivity.

* rg with telescope window to quickly find text in very large code basis is essential.

* Pressing spc, spc, to bring up a telescope window of my open buffers and typing in text to narrow them, very important.

* To date I still struggle to get the LSP to work the Linux kernel on VSCode, but on Neovim I got it working.

IDE's have a lot of menu clutter that I struggle to make good use of-most programmers working on user-space apps, it is likely fine, but for the kernel, we often need more control.

> Emacs is really struggling with it's tools.

First I've heard of this. As a long-time vanilla Emacs user, I'm using consult-ripgrep and rg-project for ripgrep interfaces, consult-buffer for fast buffer and file switching, Eglot for LSP integration (mainly with clangd), etc. I've also got org-mode for note taking, magit for speedy Git manipulation, etc.

And all without any visible menus or clutter.

I suspect that a power Emacs user and a power Neovim user are more akin here to each other than to VS Code users.

I mostly use kickstart.nvim in Neovim. I really like using mnemonic key bindings (which do show a menu) with the functionality above. One real issue was the lack of a telescope competitor (and I noticed you did not mention one above). I really like the quick overlay for those actions is how Telescope in kickstart is programmed. I really do not like the results smushed at the bottom of the screen like how Doom handles it.

Spacemacs got me into mnemonic key bindings, but it was too buggy and development had slowed. I got some things working with Doom Emacs, but it had a lot of bugs as well. Part of that reason is projectile also seemed to no longer be worked on. They were converting over to project.el but that seems to be slow.

Emacs is doing fine too.
I struggle to find good bundles for Emacs. Doom Emacs is struggling with migrating their plugins. Most programmers I know use Emacs with few plugins and not the better IDE like plugins in Neovim.
Most tools work at the command line, making scripting a freebie.
I probably used vim exclusively for about a decade. I've worked with a handful of developers who've only used vim and I've only known one who was anywhere near as effective with it as most IDE users. A few examples

-- debugging with print statement because they don't know how to use a command line debugger

-- using find and grep to find files/methods

-- hand-formatting files because they don't have a inline formatter or something to notify them when they've missed a semicolon or spelled a method wrong.

I strongly encourage them to move to an IDE because I can't stand looking over their shoulder and watching them code so inefficiently. There probably are vim plugins to handle many/all of these things, but if a developer doesn't put the effort in to find them than they're just hurting they're own productivity.

I'm kind of doubtful of this. Just to take print debugging as an example. While there is definitely a time and place for debuggers, i think print debugging can be shockingly efficient in many circumstances.

Besides, typing speed is usually not the limiting factor in programming speed. I think overall efficiency needs to take a broader look.

I default to printf debugging myself, but it can be an indicator that someone doesn't know their tools.
Breakpoints are likely to screw up a lot of concurrent user requests, so in prod we debug microservices by comparing pushed logs.
The typical bell curve meme: https://imgflip.com/i/9a9gm7

The fun begins when you can't debug by printf because the buffer is shared by multiple processes that change it while the printf command is running.

Yeah, network logging has latency but it does pack the messages into structs and demux them. The remaining debugger problems are:

- Do you know which service tier has the issue?

- Can you halt one thread that sees the issue, not all of them on an instance?

- When the request times out, do you have to start over and make another prod user sad?

A person not using an IDE is more likely to be proficient in command line tools, not less.
Those developers frankly sound like idiots, I don't think they should be coding at all. Also yes, all of those things are easily done in both vim and emacs.
Care to elaborate what's wrong with find and grep?
It takes seconds or more to grep for a function, especially if it has a common name. It takes milliseconds to Go To Definition / Find Usages (either with an IDE or a LSP extension for any text editor).
If they're not using fzf, ctags or LSP at all, sure. But find and grep absolutely have their place, and I tend to use them even when using IntelliJ/VSCode.
Yes, no one said find or grep are useless, far from it. The original premise was people using grep to look for a function in a code base, or find to get to a file (presumably to get to an include file or imported module by name). And they are definitely sub optimal for this - as you mention, even outside of an IDE, there are plenty of better tools to integrate with vim or nano or ed (the standard text editor!) or whatever you prefer.
And then you go full circle when the project is bigger and Find Usages no longer works across projects (specifically in the context of a typescript monorepo) and it's back to grepping for usages.
Do those miliseconds also include the time where you have to move your hand from the keyboard to the mouse to ctrl+click the function name? ;)

I see your point though. I guess I just disagree with the premise that using an IDE will increase productivity.

The developer will always have to invest some effort into learning the tools, be it find and grep or an IDE.

The premise is that using proper code navigation functions will increase productivity over grep. Not that using an IDE will increase productivity over vim, assuming you use actual code navigation tools in vim.

As for the click: all IDEs and all code navigation tools for popular text editors like vim or emacs have full keyboard support. And M-. Or F2 or whatever are much quicker to type than "grep function_name".

But this is people that use their autocomplete, F8 step through debugging and the like.

I was like that about 20 years ago, working with Eclipse and later NetBeans for Java and Visual Studio for C# .net v1 (anyone remembers whole tomato extensions?).

I needed the IDE , the autocomplete, the debugger and all that. Nowadays, I do mostly Vim and Vscode for more complex projects. I don't know why, but I "grew out" of needing an IDE.

Shudder to think that in 20 years (or less!) there will be a generation of programmers who suckled at the teat of ChatGPT and firmly believe that software is impossible to write without LLM help.
I'm already seeing this as part of my mentoring work. It's very problematic.
The weird thing about comments like these is that of course you can do all of this stuff with Emacs, you just have to figure out how.
Haha I'm a vi guy never used emacs. Not meaning to start a war.
No worries, I think maybe I replied to the wrong comment - I would have expected to reply to someone who can't see how an Emacs (or vi) user could be as productive as an IDE user.
I suspect it’s also about the type of work you do, if you don’t need a debugger.
Are you using Vim and VSCode in plain text for everything? Or do you still like the language server, syntax highlighting and the like?
Language server and plenty of plug-ins. I haven't used a debugger proper in more than 10 years I think... only ollydbg for cracking fun.
So you do like an IDE...
As someone who programs Java daily and uses Neovim daily, I don't think I could be any less productive than when programming with Java in nvim.

Some features that I do not have in nvim, but use daily in IntelliJ: Run configurations, proper debugger, SQL integration, hot reloading, and most importantly everything just working OOTB (auto complete, snippets, docs, ...). Can (n)vim do these things? Probably, but it'd take me days or even weeks to get it configured to the point where it's as seamless as IntelliJ.

I do use the IdeaVim plugin, so not all of my muscle memory is wasted.

Java is really unpleasant to program in without IntelliJ IMO. I strongly prefer NVim for Python and C++, but still use IntelliJ for anything non-trivial in Java.
one thing missed is intellij can cross-complete over several domains, like correctly showing tables in a sql statement in a java string in your project, if you also have the database added, etc.

ive never seen any vim-with-plugins setup come close to this

Vim is great but I think VSCode really is the one tool to rule them all going forward. It's extremely well designed, snappy, and I think does the correct thing of first treating everything as a text file and allowing plugins to provide semantic meaning. I never liked visual studio because it was too specific to writing software and using the GUI to do what I wanted. Editing msbuild files directly was a pain for example. If I wanted to do some shell scripting or system debugging, I had to leave that environment.

Whereas with VSCode, I really never have to leave the VSCode environment to do what I want. I can pop open a shell within VSCode and don't have to switch windows. I can easily open random files not associated with my project and VSCode does the right thing (usually). It opens images easily, renders markdown well, etc. my favorite feature is that you can pipe cli output directly to VSCode in the shell and then it opens a tab displaying that output. You'd be so surprised how often that feature comes in handy.

> Vim is great but I think VSCode really is the one tool to rule them all going forward.

I really hope you’re wrong about that. I don’t want to be ruled by another Microsoft product

I mean, nothing stops you from not using it. It's just a really well designed piece of software and it does a good job of getting out the way something a lot of IDEs don't do well (visual studio for example).
>pipe cli output directly to VSCode in the shell and then it opens a tab displaying that output

Example from VSCode Terminal: $ echo hello | code -

You can do all the things you mentioned in Vim. I also can't imagine that you would be comparing the performance of VSCode and Vim, my vim with all of its plugins and vim script starts up in 95ms. That's faster than the threshold of human perception.

I think you missed the point of my comment you are replying to. You can get things done in any editor. The point is that Vim/Emacs have been around for decades and last your whole career, VSCode has been around for a fraction of the time and killed off the previous editor, Atom, that everyone though was "the editor".

Nice try, microsoft. There’s way too many floss options to bother with surveillance capitalism tools and lock-in/e³.
In college I used exclusively plain text editors, and like 80% of my edit-compile-run cycles were wasted on noise like symbol names and the ordering of positional arguments. When I got into professional life and started using JetBrains IDEs, I felt like I was flying.
I'm one of those people that doesn't like polluting his brain with a ton of keyboard shortcuts and likes clicking with a mouse on stuff and is just more efficient with it. I've seen video clips of "efficient" terminal text editor use, and while it looks cool in a hacker way, it just isn't any faster than what I do without all of the overhead of memorizing a ton of keyboard shortcuts and editor commands.

I would definitely much rather install VSCode or an IntelliJ product on a Jr's machine, show them how to setup their terminal, get their dev environment setup, how to run and debug the app, and off they go. Edit code. Run code. Debug code. Rinse repeat.

Much more reasonable and preferable to having them spend months learning Emacs. Let's remember, they likely don't know how to use the terminal either these days.

> I've seen video clips of "efficient" terminal text editor use, and while it looks cool in a hacker way, it just isn't any faster than what I do without all of the overhead of memorizing a ton of keyboard shortcuts and editor commands.

Would that still be true if the ordering of your menus (and the items within, recursively) were randomly shuffled each day, and which side submenus opened on were also randomized? How about if the speed of your mouse or mouse acceleration behaviors varied?

I think you may be discounting memorization which benefits your workflow because that memorization is spatial rather than symbolic. Perhaps there's an argument to be made that such memorization is more natural, gradual, or easy, but there's definitely memorization involved in mousing around with any degree of efficiency or speed.

> Let's remember, they likely don't know how to use the terminal either these days.

Which is a huge issue. If all you know how to do is crank up a GUI and write code, you are easily replaceable in a world where the demand for SWEs has gone way down. The best thing I ever did in my career is invest in learning how things actually work. Learning how something like Vim works is just a litmus test for absorbing and applying information quickly. Vim is just one in hundreds of tools I've learned how to use and string together.

How can you possibly be as productive as someone working in Visual Studio? I'm asking honestly - working without the solution explorer, being able to look at any immediate variable, instruction pointer dragging, and others seems like it would slow me down immensely.
With vanilla Vim, you're right. I recently switched to NeoVim after years of using VSCode, and after about 2 weeks, I am probably back at about 90% of my productivity as VSCode. I had to spend a little time learning Lua and learning the internals of a text editor, but I wanted to learn those skills anyway so I'm glad to have had an excuse. If you have no interest in those things, then I wouldn't recommend leaving VSCode.

I am also excited by the fact that the text editor configuration is programmable in a Turing-complete language, as opposed to pure JSON configurations that VS Code offers (correct me if I'm wrong, but settings are just a JSON file right?). It means that anything is possible.

In VSCode, my biggest complaint was that, for the Vim extension, the status bar was not configurable - I wanted to make the whole page change color when in "Normal" mode, versus "Insert" mode. Not possible in VSCode, but it's only a handful of lines of Lua in Vim.

Is that a huge productivity boost? No, but it makes me happy. Just as much as I want to be productive, I also want to be happy while programming

Can you offer up a .emacs that provides the same functionality as say, PHPstorm? I've tried, and not been able to reach that level of functionality.
I'd give the opposite advice. Learning a new editor is fun and thankfully they are mostly inexpensive. You will build up a suite of editors that you use in different contexts and be able to talk about the differences based on experience and not just dogma.
I was a heavy Emacs user for just short of 10 years. I don't use it now because I am more productive with JetBrains IDEs. Your advice seems too rigid and dogmatic to me.

Just posting to balance things out for any entry level SWEs reading.

Sticking with something "for your whole career" is a very bold advice that must be taken with appropriate caution. No?
I don't even know what to say to this other than that you are right that it does sound stupid and it is stupid. A software developer should not be afraid of learning software, learning new things is fundamental in our work. Comparing an IDE with basic editor like vi, really, that may have worked out for you since you started 20 years ago when that worked, but it should not be the advice today.
I learn new tools and platforms all the time, but editing needs muscle memory and I don't want to abandon that every five years for the new hotness. IDEA is just starting to show some longevity for Scala and Kotlin.
Mainly, a seftware developer should not be afraid of creating neW tools to solve their own specific problems. Programmable editors like Vim allow you to do that, proprietary corporate IDEs do not.
The best is when you open vim/nvchad in vscode terminal.
or, if you’re feeling spicy go for Doom Emacs