Sunday, January 27, 2008

A Tough Pill to Swallow

The Flame

If there was one email that I wish I had retained a copy of, it would be the flame that humiliated me into what would become a decade-long love affair with VIM.

I was working as a lowly help-desk tech and had recently become enamored with UNIX. In typical fashion, I had begun my pursuit of all-encompassing knowledge in this field with a tenacity and zeal that could only be described as utterly irritating to anyone that had to deal with me. All mundane details aside, I had inadvertently made mention of Emacs to a UNIX admin that I knew at the time on an email thread. Big mistake.

His attack was swift. His attack was ferocious. His attack scarred me in a way that only the most severe childhood beatings have on the nastiest bullies you've ever met. To this day, I can't recall any of the details of what was actually said - only the scathing heat of the public lashing remains with me, along with the mental image of him foaming at the mouth as he hit "send", and the vast legions of those cc'd on the thread laughing uproariously at my incomprehensible stupidity.

So it began.

The Infidels

Fast forward about 10 years. I'm older. I'm a professional software developer. I'm also a VIM zealot. I do everything I can in VIM, from coding to note-taking. I have a .vimrc approaching 1000 lines long. I find joy in reading anti-Emacs rhetoric. Hell, I even have this picture outside of my cube. Unfortunately, I'm also surrounded by Emacs zealots. Well, not really surrounded - I've simply established two critical relationships with Emacs users that play a part in this story, so we'll just act like I'm surrounded, and you won't argue with me. Names have been changed to protect these bastards.

Bob is one of my closest friends, a long-time Emacs user, and the silver-back developer that seems to live only for the moments of revelation where people own up to the fact that they should have just listened to him in the first place. I have had these moments frequently enough to cause me physical pain. I don't like them. No, I don't like them at all. They make me bitter, and him exceedingly happy (thus my bitterness). I have accused him of callous inhumanity many times over the years during these moments, and he oft reminds me that such an accusation would imply that he was, in fact, at some point a living human being...possibly even one with what we refer to as a "soul". Far be it from me to argue such a point. He refuses to budge in his stance of Emacs' superiority, and - even more irritating - he won't even really discuss the issue because, well, there's simply nothing to discuss. He has His Opinion. I have my Meaningless Drivel. Such is my friendship with Bob.

On the other hand we have Jim. Jim and I alone have kept The Holy War alive and well for the past several years. We've affectionately referred to each other as "Emacs Whore" and "VIM Bitch" for so long that I have to put thought into recalling his real name (which isn't Emacs Whore). We've battled over the superiority of our respective editors for so long, I have almost nothing else to talk to him about. This debate is the foundation of our association. We're like oil and water, red and green...my calming yin to his raging yang. There is simply nothing that can be done about this reality...and we love it. It's the most mutually-beneficial, utterly abusive association I've ever had with a co-worker, and I couldn't ask for anything more.

One of my favorite moments was stopping by his cube only to have him say "Can VIM do this...?". I was intrigued. Surely he would show me something that would cast doubt on my beloved VIM. Surely he would, once and for all, prove that I really was as stupid as Bob makes me feel (with that seeeeeedy little look that drives me from his cube). Surely he would. Then I watched him Meta-X Control-Foo Meta-Gobblety-Goo his way around...okay...then he...reached for the mouse?...interesting...

Then he proceeded to draw a fucking smiley face in Emacs. I laughed and guffawed, snickered and pointed, insulted and walked away. I think I even threw in a jab at his pansy-ass grey/pink/purple color scheme for good measure. I had been vindicated. This is supposed to be your editor. Not your email client, not your ASCI drawing program, not your all-in-one blogging tool and not your way to make fresh almond cookies and catch up on the latest celebrity gossip while you wait.

It's only a text editor. Nothing more. Right?

The Moments of Doubt

I firmly believe in the philosophy of "One Tool. One Job.", followed shortly by what Eric Raymond summed up nicely in his Rule of Composition. I'm also inherently lazy. If I can spend hours of my life finding a way to make a task that I know I'll have to repeat as simple as possible, I'll do it for the sake of being lazy later. This is really "efficiency", but that's 10 letters long, compared to the 4 in "lazy". See?

Anyways - after years of use, I started to see a failure in the way that VIM adhered to the first two philosophies, and in the way that my fellow zealots in the community defended it's implementation according to it. "It's a text editor. Nothing more." - fair enough. But that doesn't address the 3rd point. You see, I'm so fucking lazy that I don't even want to switch to another window to do work. Really. There are SO many things that my time would be better spent on than cycling through application windows. Not to mention the fact that the expense of context-switching is drastically compounded when you have the attention span of a retarded goldfish on coke.

For all of the haranguing Jim and I have done to each other over the years, the one thing I envied was the fact that while I did everything I could in VIM, Jim did everything in Emacs.

I had VIM for almost all of my coding tasks (Python, Objective-C, shell, etc.), note-taking and any quick editing task. Then I had my separate terminal with a GNU Screen session, containing multiple terminals and isql/sqlplus sessions. Then I had Eclipse for Java development. I've tried to use VIM for my Java development. It simply doesn't play nicely with, well, pretty much any enterprise-level Java development tasks. More on this shortly.

Jim? He had a text editor. He had his precious little JDEE for Java development. He had his spiffy, home-brewed Emacs mode for keeping track of his consulting hours. He had his Emacs email client. He had a terminal in an Emacs buffer. He had his SQL mode for database access. Hell, he even had an Emacs IRC client from which to trawl #sleazy in a discrete buffer for cheap entertainment.[1] Seriously.[2]

No matter how effectively I managed to stay hidden behind my grizzled, VIM-hacking exterior, there was a heinous, bitter truth coming to light. That truth is that I was being consumed by a deep-seated rage. An unthinkable envy. A blasphemous jealousy. You see, I have long been seeking my idea of harmony with the Universe as a software developer, and that harmony will be realized and marked by a day of what I'm going to refer to as Transcendent Laziness. This will be the perfect moment. A moment to make all others before it completely insignificant. At that moment, I will know that I can do almost everything I want in the most egregiously lazy way possible. But this one goal, this one cause, this one elusive moment of enlightenment I have struggled so hard to attain was now showing itself to be further away than I had ever imagined...and, of all things, it was my beloved VIM that was impeding on my dreams of slothy perfection.

Nothing made this more obvious to me than the predicament I found myself in as both a dedicated VIM nut and professional Java developer. Try as you might to argue the point, I have come to the following dreadful conclusion, and only after a frustratingly devoted pursuit of evidence to the contrary:

These two communities are surprisingly incompatible.

Feel free to follow in my footsteps, but even a preliminary search of "java vim" or even "j2ee vim" comes up with essentially nothing useful to someone with more than, say, 3 weeks worth of time invested into VIM. In fact, I'm such a nice guy that I'll do you a favor - I will provide you with the single most comprehensive resource on using VIM for Java/J2EE development that currently exists on planet Earth. I will save you hours of your life, and you will thank me profusely for it.

Here you go.

Ungh. I know. That's my point. This is, quite literally, the best collection of information for utilizing VIM for Java development.

Quick Fix. Folding. Tag files. Abbreviations. Auto-Indent.

Are. You. Fucking. Kidding. Me.

The...Molestered

Do you remember that episode of South Park where all of the kids claimed that they were "molestered"? And in the end, South Park was full of nothing but 3rd graders? Under the leadership of Cartman?

Yeah. I've been to that town before. It's called #vim on freenode.

With the little hope I had left, I began a desperate search for information. Surely, with the hordes of devoted VIM users inhabiting our little blue planet, I could easily find at least one that has blazed this trail before. Forced into Java. Constantly deleting "j" and "k" in any given IDE. Hungry to prove to the world that an experienced VIM wizard can work effectively in a J2EE shop using his magical little editor. Actually finding a way to work effectively in a J2EE shop using his magical little editor. Surely I could find this person. I'm resourceful. I'm moderately intelligent. My meerkat nuts are fuzzy. I will succeed.

Well, I searched. I found nothing. This person doesn't exist. This person has never existed. If this person did exist, they left no record of their struggle, and you're just as fucked as I was. I'm sorry. Take comfort in the fact that your search is over.

While I don't have the logs to prove it, I had almost identical conversations with three different geniuses on #vim, which I now present to you below as a fictionalized summary of all three encounters. I see it as a testament to not only the brotherhood that exists in the VIM community, but to the astounding lack of quality within it, as well. When it's not some green-ass n00b asking how to reformat a block of code, or extolling the virtues of using VIM's recent advances - like tabs - this is the level of talent that I have personally encountered:

Snoo: @nerdtron: right, but how do actually save the file?
Yummers: but all i see are a bunch of this: ~
GrumpyMeerkat has joined the room...
GrumpyMeerkat: anyone here actively using vim for enterprise-level java development?
LordBarf: @Yummers: color schemes for what? vim?
phUkh3d: JAVA SUX BAAAAAALLLLLLSSSSSSSSSS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
GrumpyMeerkat: that's great, kid.
GrumpyMeerkat: unfortunately, my employer is not as wise and experienced as you are, which means i must code in java - and i would rather use vim than eclipse for my daily work
puUkh3d: oh, MAN....i wish i could get paid to code
Yummers: that would be so totally cool
StankBung: @GrumpyMeerkat how did u get ur job?
Snoo: sorry - didn't notice that i could go to "file" > "save"
HamSandwich: @yummers: scheme? why not code in c?
GrumpyMeerkat has left the room...

Absolutely. Fucking. Useless. Each and every one of them. If they were kittens, I would stuff them into a burlap bag and drown them. However, my struggle has served a greater purpose, for I now understand why the person I sought so desperately has never existed. I could have very well have been that person....but it is as if I have opened my eyes for the first time and, in doing so, come face-to-face with the collective intelligence of the VIM community at large. And it looks like this.

This is what we call "The Tipping Point"...

The Promise

Back to that heathen fuck, Jim. At one point, Jim has moved out of state and I no longer work for the same company, but we stay in touch for 3 logical reasons:

1. I have converted him to Python, from Perl. Go Python. Go Grumpy.
2. I have shown him the light of using OS X, instead of Linux. He's lazy, too.
3. We have a Holy War to keep alive. Fuck Jim.

Good reasons, if you ask me. I win 2/3 of the time, and insult him for the remainder. I like it.[3]

Unfortunately, Jim is also a really bright guy, and has managed to weasel himself into my subconscious (however inadvertently): He has actually admitted defeat of two of these issues. He has eaten his crow. He has taken not one, but two, for the team - my team. He has swallowed his pride and actually called me up to seek help from me on a couple of occasions.

No matter how much I enjoy his suffering, or hearing him choke back the bile while admitting defeat, he has doubtless been a worthy opponent. Even with his pansy-ass grey/pink/purple color scheme. I may benignly ask him to repeat a newbie question, feigning a brief moment of shitty reception just to hear him ask the question again, but cruel I am not. I feel that I owe him at least the pleasure of knowing that I am willing to act like I have considered the idea of contemplating the notion of thinking about the remote possibility that he may, in some alternate reality, in a galaxy far, far away - be right, too. So I make him The Promise.

I will use Emacs, and only Emacs, for an entire month.

The Pill

No viper mode. No crutches. No hand-holding. Deep-dive, right into it. I actually go through the tutorial. 3 times. Really.

Notice that I say nothing to Jim of my raging, internal struggle and my rapidly growing disgust with the VIM community. This would simply give him too much pleasure. And I'll simply disembowel myself before breathing a word of the matter to Bob - that sadistic fuck would eat my pride in front of me just to barf it back up on my shoes.

I force myself to remove VIM from my daily workflow. Then I remove both the menu bar and tool bar from Emacs to ensure that I have no crutches to lean on. Then I learn the help system. Sweet. Then I learn how to fly around in the buffers. Necessary. Then I learn how the shell mode works. Cool. Then I learn how to use plsql mode. Where has this been all of my database-loving life? Then I discover org-mode. Spank my ass and call me Sally. I can't even describe how amazing this one tool is for putting my professional life in order, especially compared to the suffering involved with keeping notes in vim-help format. It was like popping a boil.

Then I noticed my behavior changing. Two weeks in - just two weeks - and I discover that I'm getting excited every time I fire up Emacs. It's not a chore: I've gotten past the urge to hit escape all of the time and am growing comfortable with a modeless editor. It's no longer a struggle: I've gotten quite fluent with the core set of functionality that I need on a daily basis. And it's no longer simply a self-imposed challenge with the added benefit of getting Jim to shut the hell up.

I've become rabidly addicted to Emacs.

And I must own up to it.

I email Jim to break the news. I really don't think it's quite sunk in, even to this day. I go from being repulsed by Lisp to being completely enamored with it.[4] It's even interrupted my Erlang studies. I actually called him to own up to that one. Go figure. He loved it. But I tell him to keep his face hole shut about it, because I have have yet to do the thing I'm dreading most: I must tell Bob that, yet again, he was right and I should have just listened to him in the first place. I really hate this part of my friendship with Bob.

The Climax

I wish it was something marvelous. It's not. Bob is an evil, soul-less man that I will tell made up stories about to my children with great embellishment in a completely self-absorbed attempt to make him uncomfortable when they cry at the sight of him. My confession to him of my conversion to Emacs was to be a monumental moment in my life. I thought about it. I was disturbed by the thought of it. I prepared for it for days. Days. Leave it to Bob to irritate me with his nonchalant dismissal of this pivotal moment. I hope you're as disappointed with it as I was.

GrumpyMeerkat: i have a confession to make to you, you bastard
Bob: this should be earth-shattering
GrumpyMeerkat: are you ready?
Bob: whatever
GrumpyMeerkat: seriously, man
Bob: whatever
GrumpyMeerkat: ...
Bob: i don't have all day
GrumpyMeerkat: i told jim i'd use only emacs for a month. i'm completely addicted.
Bob: /faint
Bob: i think i hear...what is that?
Bob: yes
Bob: yes, that's it
Bob: it's the scream of another vim user dying
Bob: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhh!!!!!
Bob: i win.
Bob is offline

Sigh...Long live Emacs.



[1] I made this part up because I find it amusing.
[2] Yeah - more lies.
[3] Okay - I genuinely like the guy, but that makes for a boring story.
[4] I know you can script VIM in Python. But it still sucks. Please don't bring up vimscript - I'll turn hostile.

2 comments:

Anonymous said...

I'm disappointed that you were barely able to capture the essence of my soullessness and utter disdain for your technical skills.

Oh well, what is one to expect from a mere "programmer" anyways?

Bob

P.S.-Don't forget, I learned from the best (no, not you, you clueless n00b). Oh, and I Win. ;)

Anonymous said...

Okay, you make a compelling point about emacs. Shell mode is a big deal. I have to admit I'm a bit reluctant to relearn everything (especially the screen commands) but I'll give it a shot.