August 8, 2020

Use Vim

Why You Should Use Vim in 2020

I bumped into a post titled Why Should You Learn Vim in 2020 and, while I agree with the author, I think they pulled up short. The author is correct that anyone who manipulates text files as much as they write new text will see a huge productivity boost from a modal editor. The ability to compose commands takes that to the next level.

I would suggest that you not only learn the Vim commands and how to use them in editors that support them, but that you should use Vim.

You’ll need it sometimes

Vim is ubiquitous. You’ll find yourself logged into a server and it will be the only editor installed. Being familiar with Vim is almost a job requirement. You’re going to have to scale at least part of the learning cliff, why not climb to the top?

Build a tool that works for you

As a software engineer your editor is your primary tool. The better you are with it the better you can be at your job. The less you have to think about manipulating text the more you can stay in the flow. The more you can stay in flow the more you’ll get done and the higher the quality of the software you’ll produce.

How do you become an expert with any tool? Practice over time. If you’re going to invest that time it behoves you to choose a tool that will remain available for as long as possible. The Lindy effect is a theory that for things that are non-perishable the future life expectancy is equal to its current age. If this is correct then we can expect Vim to be useful for another 28 years.

Because you can expect to be able to use Vim for a long time it makes it worth customizing and configuring for you. I’ve been using and modifying the same Vim config for (significantly) more than a decade. It’s grown and changed with me as I changed languages, frameworks, and even job roles. Through it all Vim has remained one of the few constants in my career. When I need to modify text it’s the tool I reach for to this day.

Use a tool that helps you

Modern IDEs have ample tooling and features to help you navigate complex codebases. I’ve argued for years that this isn’t helpful, it’s a hinderance. The fact that people can navigate their way through a mess means they won’t notice when they’re creating a mess.

Using any simple text editor will help you notice when you’ve begun to create a Big Ball of Mud. It will be immediately obvious because you won’t be able to remember the seven parameters to the function, or if that function was camel or kabab cased. It aligns the interests of the programmer creating the code with the programmer that will have to work on it later.

Always code as if the person who ends up maintaining your code is a violent psychopath who knows where you live.

-Code for the Maintainer

Need another great reason to write simple, readable code?

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

-Brian Kernighan

© Eric Biven 2020