One of the problems with having previously worked with some of the best minds in the games industry is that the bar on blog quality is pretty high. My brother and erstwhile business partner has been hard at work talking about his new game and other philosophical musings. Elsewhere one former mentor posts quite regularly on his current projects and musings, and another former colleague has been busy releasing some extraordinary work on C++ reflection as a side-project. These people are extremely talented, and what they write is impressive.
So, I approached this posting with a fair amount of trepidation. I had to choose a topic very carefully, so that I could compete with the level of quality of my peers, and so that I wouldn't alienate a potential audience with my very first post. With that in mind, I finally decided to talk about something very personal to me.
I'm going to talk about Emacs.
A 30 year old text editor with an arcane scripting language that I like far less than C# or Python, with text editing facilities that aren't quite as good as vi's, with key combinations that, I think, are largely responsible for the extreme pain I've been feeling in my left arm. Mind you, as I discovered the other day, if you tell people that you've just started working from home and have also recently started experiencing wrist pain, the assumption always seems to be that you've been spending your time on some kind of all-day onanistic rampage.
Anyway. Emacs. Despite its flaws I find myself returning to it again and again, like some sort of fascinating, disease-ridden whore. I use it to edit simple text files. I've written a custom mode to help format BBC radio-plays correctly (don't ask). I've started using it to write emails. I'm using it to write and compile C# code for Unity3D projects, even though Unity already provides a rather nicely integrated solution in the form of Monodevelop. Common Sense is standing in front of me, angrily yelling into my face that I'm clearly an obsessive compulsive mentalist, and still I fall back into the Lispy embrace of Emacs.
So, why do I keep going back to it? There are lots of legitimate reasons to love Emacs. For example:
- For coders, you can edit pretty much anything. Most new languages appear first in Vim and Emacs.
- It's lightweight, fast, reliable, and runs on anything with a keyboard.
- org-mode.
- It's consistent. Once you realise that you *can* edit anything in Emacs, it becomes something of a chore having to change editor and relearn all those keys.
- For editing text, it's very good. It's not Vim, but all those keys to navigate and delete things make you significantly faster than you are in most editors.
- It's so damned elegant. All data is text, and all functionality is a function bound to a key, or runnable from the minibuffer. For coders, this all just makes sense.
- Everything is customisable. This isn't Visual Studio or Eclipse where you have a strict API that allows you to do specific things. Emacs is largely written in the same language you script it in, so you can patch into nearly anything.
- It has a fairly steep learning curve and not alot of people use it. This immediately gives you a sense of superiority over others. It's the same sense of misplaced yet comforting smugness I get when I talk to people who watch the X-Factor.
With Emacs, if I hit an annoyance or a feature gap, I know I can fix it (or more likely, that someone else already has). Now, this doesn't mean that I *should* fix it. Unfortunately, with the compulsion to improve things comes the side-compulsion of just "fiddling with shit because it's there". You type something, Emacs responds, type something else, check the result, you wait, trying to resist the urge, type something else, run it, check it, ooh that's interesting, type again... It's like Twitter for the socially retarded.
Of course, there's plenty to put you off in Emacs-land as well:
- Lisp. Honestly. For its day it was pretty extraordinary, and many people today still opine that one Lisp dialect or another is going to save mankind. Others maintain that functional programming languages generally are the true path to productivity. Sod that. For me, after a few years of trying to get used to it, Emacs Lisp still annoys the hell out of me, with its impossible to remember looping structures, strange list nomenclature (car, cons, cdr), and, to the casual observer, (apparently random ((use of ((braces)))))). It looks like an explosion in a boomerang factory.
- Strange defaults. I spent years getting Emacs to behave sanely, it's not wonder people don't flock to it.
- The iconic creator and his strange eating habits.
Anyway, a side-effect of this obsession is that I've ended up with a fair amount of Emacs lisp code that I should probably share with like-minded individuals. If either of you are reading, I've just uploaded two small projects to bitbucket:
- Project.el is a system for managing small collections of files into a project in Emacs. I use it every day when working with Unity3D.
- Shaderlab-mode is a major mode for working with Unity3D's shader files.
And that's that! Next week I shall attempt to swell my readership by writing about winter lawn care, reviewing 7 different types of sock for comfort and ergonomics, as well as giving you my tips for keeping yourself regular as you approach middle age.
Ta!
Simon