Why Vim?
Have you ever thought why people are using Vim at work? The answer is easy: for money, of course!
How come? Well, this is pretty simple. Now I am going to connect all of the dots for you.
What is important in a software engineer’s career?
Skills. This answer comes to my head as the first one. Which one exactly? Contractors are mostly hired because there is a shit to do. People in a company are too busy or lazy. Because of this, such clients require expertise and performance. You have to do things so quickly and well that no one will notice before you run away with money.
Joke… Have you never considered such option? Wink, wink.
It’s different for long-term employers though. They are in this shit with you together. If they are doing a real business (I don’t mean gov ones) they count on expansion to other markets, constant development of their skills and possibilities. The same bar is raised for employees. You need to invest your time in self-development, being more performant, exploring new things and essentially being better every single day or, otherwise, you will get your notice period sooner than you expect - it isn’t something that I will wish you for.
Chad Fowler (my beloved writer and a programmer) wrote a book called The Passionate Programmer. He was quite strict about self-development: you have to plan your career and your learning in order to be better.
Do you want to get a raise? Learn something important!
But what exactly?
What are you doing all day?
Oh, I love short answers: staring at the screen and typing! Well, you probably are going to attend some important meetings (do not underestimate them though, everyone that is saying they are absolutely stupid mind their brains as well).
So typing. Keyboard. Interaction with text. Keystrokes. That’s what you are doing, no? Apart from the thinking, I can’t see when people are doing that.
Consider that: you are sitting in front of the modern typewriter. Programs are text. Your outcome is a text. It has to have a structure, meaning and stuff like that, however, it is still a text. Keep this thought and compare it to being a writer. You are one, no? Writing down the truth (with the bugs as well)!
Well, not even close. Writers are writing text, you are editing it. Imagine that books are going to be released in the same manner as your software is: in my “The Lord of The Ring v1.1.12” a dwarf Fido is going to destroy The Hammer of Sacrifice along with Galbal The Doctor. Is yours different, huh? Oh, it is before an update, maybe.
So we are editing text a lot.
Martin Fowler (and others) wrote a book about editing a code - Refactoring: Improving the Design of Existing Code. Of course, refactoring itself is not only about editing text, but this is an inevitable part you have to do.
How is Vim improving anything?
If you used Vim already, you probably noticed a difference. In Vim, you can edit entire words, sentences, blocks in one keyboard click. The normal (which is not for non-Vim users at all) mode is full of jumps across these types of abstract things in text. Which is awesome - you are now doing things in two clicks (like remove sentence, replace a word, etc.) which impacts performance significantly.
The second thing is Vim has a really important rule: fuck mice! This makes Vim entirely keyboard-based and shortcuts are not only optional but mandatory to learn therefore there is only one way to use it (and learn!). As far as I know, many people tend to “mouse over” things which don’t require any learning but it’s taking longer especially done many times a day. Vim wins in this competition by saying no-no, use the keyboard, Luke. It’s making things harder at the beginning although quite faster afterwards.
Plugins and macros (used wisely) are really improving regular work, especially when implemented for a specific (and large) multi-lang project. Multiple plugins are out there and they are very useful to make an IDE-like experience. Learning how to write these is not for beginners although it’s worth to check out how are they done and fix it if needed.
There is a thing that is really popular across developers and already proven working: pair programming. Vim helps with that because of its nature: it’s absolutely console-based interface, so using with tools like tmux makes pair programming experience very smooth and right, comparing to regular screen sharing and even remote desktop control. Although, it’s of course hard to do if one of the programmers are not familiar with Vim at all.
Connect the dots
Right, we already know that:
- it’s worth to improve personal performance
- Vim is helping with improving it
But is it all about Vim only? Of course not! What I want you to do is to just sit down some evening, rethink how you are using your IDE and text editors, are you using a mouse a lot? Are you using backspace 10 times when deleting a word? How many keystrokes are you doing to get to a specific point of source code?
I am using Vim for like 4-5 years. Because mostly what I am doing is Java development, I normally install Vim plugin in IntelliJ but was also working for some time with eclim (headless eclipse, which is really awesome as well). Everyday Vim is giving me an opportunity to learn or implement something new, but essentially I have noticed a significant improvement in my performance because of doing more abstract text editing and navigation that is not that natural for regular Word/Notepad users. I strongly encourage people to use Vim in regular work and even writing such blog posts.
Are you a good programmer today? Be better tomorrow!