The why of why people use vim has been covered fairly extensively, so I thought I would spend a little time explaining why I teach vim to my high school students, even in 2020.
It all began when I was assigned a mixed class of ninth through twelfth grade students in computer science just after the financial collapse on 2008. Well, the financial collapse first brought me to teach Intro to Programming using VB 6.0 and Windows thin clients, which was an experience unto itself (thanks in part to the Conficker virus). That experience is worth a separate blog post and is a good part of why one of my specialties is teaching computer security.
So here I am with all levels of student, including AP CS A (read: AP CS Java), and obsolete Windows PCs (at least the thin clients were gone). I couldn’t install any software, wanted to teach C, had to teach Java, and had very few options (these were the days before online web based IDEs).
I had experience with the UNIX command line, primarily Sun Workstations, thanks to my wonderful education at UCSC, so that wasn’t an issue. I had played with Linux in the 1990s to a bit of success, but hadn’t touched it for almost a decade. So I found an old Pentium 2 carcass in the the garbage outside my condo complex, installed a hard drive, and tried this new (to me) flavor of Linux called, strangely, Ubuntu.
I quickly realized this machine could have all the students coding at one, discovered the wonder that is putty.exe (it doesn’t require any installation to run!) to connect the obsolete PCs to the server and soon my students were off and coding.
Why did I teach them vim? I wish I could say I agonized over all the options at the time and decided vim was the best pedagogical solution, but the reality of the situation was that vi was what I used in college because my father taught me vi. You see, I am lucky to have a father who worked in the industry and is even somewhat of a footnote in text editor history. So I taught vi (later vim) because it is what I knew. A running theme in many computer science teacher’s trials by fire… teaching something because it is what they know. I will go as far as to argue that it is more important that the teacher knows the editor, and especially the programming language, rather than assigning any importance to one correct editor or one correct language that all teachers should teach.
Years later, though, I still teach vim and the command line. So here is how I justify my decision, even if only to myself.
It just works. Every time I go to a new school, it takes time to get the software installed necessary to run IDEs. I remember walking into one school in which the AP CS A class was flailing away with Eclipse on Mac OS X because the students needed, and didn’t have, administrator access. I have an amazing tech department at my current job, but even here it took us weeks to figure out how to deploy Visual Studio Code on the student’s MacBook Airs and then we had to figure out how to deploy Python3 and Java. So there’s no confusion, I teach vim along with many IDEs and I fully believe it is my responsibility to teach multiple platforms and multiple IDEs, but the CLI and vim are always my safety net.
My students can program in any number of of languages on a now cloud based CLI Linux machine (thank you Linode and Digital Ocean – both of whom offer a $5/month plan – just. happy customer!). By using the CLI, I can support literally any type of computer connecting (including iPads, although the lack of a virtual esc key drives me batty as a vim user, and ChromeBooks). Students can connect from anywhere in the world and things just work. All of this became infinitely important in the remote and hybrid learning experience of the pandemic. And this is all possible because the students use vim.
I keep track of as many of my students that major in CS and a running theme is they all profusely thank me for teaching them vim and the CLI. Too many colleges start CS1 with an IDE and then throw the CS2 students into the deep end with the CLI. Not everyone is as lucky as I was in regards to having a father well versed in the CLI.
And yes, there are online IDEs these days, but I’ve found those to be full of their own pitfalls, privacy issues, and costs and find doing any advanced work using them to be very difficult if not impossible.
Also, to be clear, both nano and Emacs work quite well in the context of CLI Linux and I don’t make any claim that teachers should use vim over those equally acceptable command line text editors except for one small argument. Most people agree, computer security pretty much requires knowledge of the command line and a text editor. I always tell my students that the one editor they are likely to find already installed on a machine is vim and it is a bad day when you have to install another editor. Maybe just an issue for students interested in ethical penetration testing…