Learning Emacs

For the past few weeks, on top of writing delightful documentation and exploring New York, I have been executing an herculean undertaking: learning Emacs.

10gen’s lead tech writer is an avid Emacs user: he uses Emacs for his email, his chat client, and, of course, for editing the docs. We write MongoDB’s docs in Docutils, and (mostly) easy to write. It helps to have a text editor that will do reStructuredText syntax highlighting, though, and those seem to be rare. My beloved Coda 2 does not appear to do it; Sublime Text’s highlighting is inconsistent, and its tabs a pain in the ass. TextMate is great, but even it sometimes fills me with rage with auto-indent behaviours that I can’t figure out / turn off.

So my colleague suggested I try out Emacs. It was lateish on a Tuesday afternoon, and I said “why not!” and promptly downloaded the GUI version of Emacs. He kindly gave me his Emacs configuration file so that I would have all his handy reStructuredText-facilitating extensions, and gave me a quick crash course. I suspect part of his enthusiasm was the prospect of being able to use Emacs on my computer when I needed his help with something, but a good deed is a good deed regardless. After a 45-minute pep talk, I was left feeling not unlike I did when my parents bought me my first iMac back in… 1998: “this is very cool, now how the heck do I turn it off?”

Aside: for those of you who do not recall, OS 9 hid the Restart / Sleep / Shutdown menu items in the “Special” menu. The first night I had my iMac, I ended up unplugging the computer in a fit of “oh god what have I done?” and having a cry because of all the money that had been spent on a computer that I had no idea how to use. I bought David Pogue’s “iMac for Dummies,” and life improved immeasurably.

On Wednesday, I remembered that Sacha Chua was an Emacs user, and vaguely recalled her posting a Beginner’s Guide to Emacs. I printed it out, propped it up on my desk, and have been adding to it ever since. Much like the purchase of Pogue’s book, this was an excellent life choice. There are a few things that bug me about Emacs: memorizing keystrokes isn’t something that I’ve ever been very good at, and I don’t like that (given my current configuration) I can’t highlight with shift and the arrow keys. As a learning experience, though, it’s been really pleasant, especially now that I’m starting to remember how to do things (I can now consistently write files, copy & paste, and move to the beginning and ends of lines!).

It sounds goofy, but I’ve always enjoyed the idea of being a person who is good at command line-y text editors. Whenever I see someone mysteriously navigating without a keyboard, typing furiously as windows pop up and disappear, I think it’s neat. Admitting this is both amusing and embarrassing: I’m forcing myself to learn Emacs because I think it looks cool.

Despite my somewhat goofy reasoning, Emacs is kind of fun! At a minimum, it’s made me realize that the way I’ve always interacted with files is not the only way, and it has made my emacs-loving colleague’s workflow is much less mysterious to me. I also really like that I can create a buffer that will execute a command for me: I like being able to generate the html version of whatever I’m working on and being able to click on links to the file if there’s an error.

If you’re just starting out and have an intense desire to look cool learn emacs, check out Sacha’s guide. I also suggest finding someone who is patient and kind, and willing to help you learn.

NY Perl Mongers

It seems I haven’t blogged since moving to New York to work at 10gen, three months ago. I guess all my writing hours have been going towards writing MongoDB’s ever-improving documentation.  Now that things are quieting down a bit, and I am only semi-weekly embroiled in a well of git/docs build-enduced despair, I’m pleased to be getting back into the swing of things.

Last night, the New York Perl Mongers meetup took place in our offices. Mike Friedman, one of my coworkers who works on MongoDB’s Perl driver, among other things, spoke about the Perl API, which apparently allows you to use C to do stuff for you more quickly, and Damian Conway gave an excellent talk on giving better presentations. While Mike is lovely, I probably wouldn’t have attended just to hear his talk – I know very little about Perl and less about C – but some of my coworkers had heard Damian speak previously at OSCON and highly recommended we attend, so attend I did.  Both Mike and Damian were fantastic speakers, and I learned a lot from both… I’m not about to start writing Perl code (let alone using the Perl API), but I took some notes from both talks, and figured they might be worth sharing.

Mike Friedman: Perl API for the Mortally Terrified

“Using C gives you a better appreciation of how powerful dynamic languages are.”

I must admit that this talk went well over my head: not knowing much of anything about Perl, other than that it was another programming language in the family of Python and Ruby and such, I certainly missed some of the more nuanced points. Nevertheless, Mike listed a number of reasons why the Perl API might be something you should look into, which boiled down to:

  • you can make things faster by writing bits of your program in C
  • the Perl API lets you work with the myriad of C libraries that people have already helpfully written
  • the Perl API  lets you do fancy stuff that would be hard/impossible in Perl

He then spoke about the Perl API itself and how you work with it. I did not take notes on that, but I did draw a very confused thought bubble that said “Why are none of these function names actually meaningful?” If you’re a Perl developer and you’re interested in starting to use the Perl API, Mike suggested you check out Practical C Programming by Steve Oualline and the infamous K&R C Programming Language book… so I suggest that too.

Damian Conway: Instantly Better Presentations”

I had no idea who Damian Conway is. I googled him during the pause between Mike’s talk and his, and it seems he’s a well-known Perl developer, and an extremely well-known speaker. I cannot speak to the first thing, but I can say he is, indeed, an excellent speaker. I like to think that I give a pretty decent presentation – I was always well reviewed when presenting in school, at least – but as a person early on in my career who has (no longer) secret aspirations to speak at conferences and share my knowledges with the world, it seemed like it would behoove me hear what he had to say.

Without diminishing things, I have to say that his tips are not earth shattering. They were, however, incredibly well-packaged and well-delivered, which truly hammered home the need to focus on preparing a talk. His approach to choosing topics is incredibly practical, and he provides a strategy that a stressed, slightly panicked speaker-to-be might follow gratefully. He advocated spending 20 hours of prep time per hour of speaking time, though confessed he usually spends more like 100 hours. So that’s certainly something to think about.

According to Damian, being a good presenter boils down to 7 things:

  1. Talk about what you know and are passionate about. If you’re passionate, other people will listen, even if they don’t care about what you’re talking about
  2. Tell a story – either historical, procedural, or anecdotal. This helps to ground the talk and make sure it has good flow
  3. Don’t search for topics: select them. This was a big one for me – Damian advocates writing down everything you can think of about a topic on a piece of paper. A big ol’ brainstorm. Then when you’re ready to figure out what to talk about, you can winnow it down to the core topics
  4. Less decoration, more focus. Almost all of Damian’s slides had five or fewer words on them, in a nice large, easy-to-read font, with a plain background. No extra junk. Slides should emphasize what you’re saying, not distract your audience.

    “The use of a laser pointer will convert your primate audience to a feline audience.”

  5. Manage questions. Appear keen to take them, but make sure they happen when you want them to happen.
  6. Animate code demos. This one was pretty cool. Damian went through some elaborate Perl grammar thing and it made complete sense to me while he was explaining it. The parser tree was revealed incrementally, and then the groups in the tree moved around to map to their equivalent code blocks, and it was very cool. For normal code presentation though, simply highlighting segments as you go through is a great way to keep people from getting confused or lost in your explanation. This was the highlight for me.
  7. Harness your anxiety. I’m not a terribly nervous speaker, but I am a worrier, so this one resonated. Funnelling one’s anxiety and nervous feelings towards productive ones is, apparently, as simple as telling yourself over and over that the feeling of terror is actually a feeling of excitement. Eventually, he says, you’ll start to believe it, and your anxiety will overflow as enthusiasm and audiences will love you forever.

Damian provided the link to his talk’s handout, which you can find at damian.conway.org/IBP.pdf. I highly recommend it, and if you have the chance to see him speak, I would jump at it.