Vim: the rockband for software professionals

Published on August 18, 2012 by Toran Billups

I was playing rockband with my son this morning when the worlds greatest analogy hit me. This 'ah-ha' moment inspired me to share not only how the analogy fits in with my vim journey but why I decided to learn a text editor to begin with.

Like most people my first interaction with vim could only be described as 'less than ideal'. I still remember looking down at the screen thinking 'what is this recording thing all about, I just want to close the damn window'. So why would anyone want to actively learn something that felt like the worst piece of software on earth you ask?

In the beginning I think the motivation was twofold. Part of me was intrigued simply because a large majority of the software engineers I looked up to were using vim/emacs/textmate so something must be awesome about these 'text editors' I thought. In addition to the basic curiosity about 'what I might be missing', I also felt that learning vim was a challenge.

If you search for 'learning vim' on google you will find a handful of great posts about the experience. Undoubtedly you will find a comment about how difficult or time consuming it was to become generally proficient with. And like many other things that are difficult I tried several times before I truly had what it took to stick it out and become productive.

But that last part about having what it really took didn't happen just because I found it interesting or challenging. I actually made the switch this year because my right elbow started to bother me and reaching for the mouse felt like a real tax on my health. (cue the dramatic music please). And as weak as that sounds it became a real problem for me in April of this year.

It was at that moment when I realized I would need to make a serious change if I planned to write code for the foreseeable future. Months later I can gladly say my elbow is now a non-issue. And with that outcome alone, the switch to vim was well worth the effort.

So that just about describes my journey into vim, but what about that awesome blog title? Oh yeah -the analogy (explained)

The people playing expert have all the fun

A friend of mine introduced me to rockband a few years back and what got me really interested was simply watching him play guitar on expert. If you have ever seen the game you know that expert mode is moving at a much faster pace and it requires the user to hit a lot more notes to complete the song. The energy level is usually cranked up to 11 and it really makes you feel as if the plastic instrument in your hand is a real one (so long as you don't look down that is).

Compare this with the easy mode, where you have very few notes and they move at a snails pace. If I was told I needed to start at easy and work my way up I would have said 'no thanks'. That mode is boring and without a doubt one you don't tell your friends about.

The same thing can be said about vim. You always see a very seasoned software developer flying through some screencast and you think to yourself 'whoa this guy/gal is getting stuff done!'. What they fail to mention in that screencast however is that you will need to start on 'easy' and it will be slow going for a while.

But because the excitement has you ready to code you open up vi/vim and try to write something quick like the developer you just watched in that screencast, only to find out you don't know where to start.

The best advice I've seen about learning vim comes from Tim Ottinger. To paraphrase a bit, start using vim to edit basic text files. Don't start by adding 20 random plugins and assume you will knockout 1000 lines of code in 2 hours. I finally took this advice myself after failing to learn vim the first/second/third time around, and with this confidence you build upon your knowledge of how vim works /etc.

The time required to become an expert will vary

I still remember starting on easy and slowing moving up to medium and then hard. All along the way I thought 'I don't think I'll ever be able to play on expert, that's for people with no life'. But sure enough, after just a few months of playing hard I found the switch to expert a no-brainer.

I just assumed my son would need about the same amount of time to work his way up from easy but within just a few weeks he was already owning some of the more basic songs on the expert setting.

The same idea applies to learning vim (or anything really). Try to spend 15 minutes a day with it at first, and over time you will work your way up to a full 8+ hour work day. I found that if I was thrashing for even 5 minutes it was time to quit for the day and go back to my IDE. After just a few months I started to think in vim, so when I would jump back into my IDE or browser I would start typing 'j/k/esc' (sorta funny the first few times this would happen).

Playing easy sucks when everyone else plays expert

When I started playing expert my son was just picking up the bass to see if he could hang with his old man. He quickly got started playing on easy but within a few minutes he would see my screen just flying by full of notes when he had nothing to do.

He would become frustrated after watching me play expert and often we had to quit after just a few songs. I decided to let him rise through the difficulty ranks alone so he wouldn't feel like he was behind the norm.

I'm a big fan of pair programming and quickly found that trying to use a tool that your pair doesn't know will only lead to waste. If I'm working alone or driving (w/out any navigator backseat driving) I'll work in vim. But if I find myself navigating the session or my pair and I co-drive I'll stick to what they know best. I'm yet to pair full-time with anyone who feels proficient in vim but maybe one day I'll live the dream.

You can use your new skills on different platforms

The biggest problem with rockband or any of the plastic rock games is that you can never have enough fresh content to play. I had a friend bring over guitar hero 2 and guitar hero 3 recently to play a variety of different music. What I loved about guitar hero is that I immediately felt at home. The mechanics of the game are, for all intensive purposes, identical. I don't own a PS3 but I imagine the idea is the same as the instruments are nearly the same once you start playing along.

This was perhaps the most attractive part of vim. I was making the career switch from the microsoft stack to linux and always found myself ssh'd into some ubuntu machine. And the default editor of choice is usually vim in that environment. But now that I'm comfortable in vim this means I actually feel at home.

This also applies to my developer machines. I work in Ubuntu at my day job, OSX outside of work and windows 7 on occasion. In all 3 environments I get the same experience (though windows doesn't always support some plugin I'm using).

If you don't use it, you lose it

One of the best and worst qualities about me is my addictive personality. When I started playing rockband it was all I wanted to do. I played a good 2 hours a day for a while and this is in part why I got so good so quickly.

But like anything you eventually burnout a little and take some time off. That happened a few months after we bought rockband and every expansion under the sun. I recently got back into it and found I couldn't even finish a song on hard. It took a good week to get my muscle memory and confidence back to the point where I could play everything on expert again.

At my day job I write python web apps on a small team. We do a fair amount of pair programming and most of the developers on the team feel most comfortable in pycharm. And because pairing works best when both people feel like they can think out loud, I try to do the right thing and open pycharm instead of vim when I'm working with another developer on my team.

I should mention that working in pycharm isn't some horrible torture like event that has me hating every moment. I just prefer vim and when given the option to use one or the other on a solo project I'll always pick vim of course. But at work I understand that we are solving problems together and it's worth working in pycharm to achieve success via pair programming.

All that said, I do feel a little drop in my vim velocity after working in pycharm for a week without having the chance to do any coding in vim. So as with my rockband example, you find yourself re-learning the muscle memory to get your speed back to the level it was at before you took some time off.

And this muscle memory is a large part of why I decided to learn vim in the first place. I plan to use this text editor for many years and throughout that process I'll be putting in a great deal of time to make sure I'm productive day in and day out. That time is well spent in my opinion because it pays large dividends over time.

Throughout my vim journey I had moments when I thought 'this just isn't worth it', but after months of hacking away (and failing) I'm glad I put in the man hours to become productive in vim.