Emacs rant before the tutorial

By | October 20, 2013

I originally started in Clojure using JetBrains’ IntelliJ IDEA IDE with the clojure plugins.  This was great for a few hello-world types of programs, but I felt I was missing out after reading what you could do with Emacs.  For example in IDEA I could start a REPL, but I couldn’t figure out how to compile and run stuff from the editor in the REPL, thus keeping a live running version of all my functions and variables.  I didn’t see how to get the IDE to format and manipulate  the parentheses correctly a la Paredit, etc.  There are probably ways to do this, but I didn’t take the time to figure it out, and there wasn’t much documentation available.

I realize now after having “really” used Emacs for some time that Emacs really is (currently) the best tool for lispy programs.  I could easily imagine a more modern GUI/IDE that maintains the lispy support of Emacs, but brings the tool up to the modern era. My first experiences with Emacs were in undergrad (’92-’96), and I hated it.  In fact, in the intervening ~20 years, each and every single time I ventured into Emacs for one reason or another, I really just couldn’t stand the backwards way it did everything, from nomenclature, to discoverability, to the sheer bone-headedness of the concepts involved, when compared to a modern “normal” text editor.

The smug, bearded-birkenstocked-guru “self-documenting” DNA present in Emacs is such a huge turn off that I almost want to vomit.  In fact I have never found anything “self documenting” about it; my best sources for Emacs documentation are Google and StackOverflow. As to functionality, my biggest issues were the logical-vs-physical line breaks, line numbering, text wrapping, etc.  For instance, Yes I get that you can have a hard line break, but when I hit the CTRL-N key, I really just want to move the cursor physically down one line on the screen, not logically down one line, which could be multiple physical lines, for example for a long paragraph.  Oh, wait… what?  I’m typing text? not code?  Oooh, I”m sorry sir (“brother”), you have to change modes.  Major mode?  Minor mode?  Not sure, don’t care.  I really don’t have time for this, but evidently I’m a moron for not figuring it out, and I’m a Windows fanboy if I decide I just want a normal editor with equal accessibility between mouse and keyboard ways of doing things and simple menus for choosing word wrap options.  FWIW, my favorite “normal” text editor is EditPlus.

Finally I always hated how Emacs’ “customizability” meant that there are a dozen ways to do any given thing so everyone’s always trying to send you their .emacs file which you then have to decipher and figure out what parts from it you want to use and whether what they’re doing is compatible with what you’re already doing, and to make emacs usable you really have to set it up first, rather than it just working out of the box.  For example, there have been a handful of line-numbering add-ons… really?  Every other text editor has this built-in, and  and it appears that proper line numbering (with the line numbers in the left margin) didn’t work properly until some very recent version.  I’m not an expert at all; I don’t know Emacs version numbers.  I know there are a lot of them.  This is my point of view as a user from the 21st century, not an Emacs hacker or evangelist; I have better things to waste my time on.

Anyway, now that I’ve been using Emacs for Clojure, and I finally have it setup somewhat customized, it’s not too bad.  I can navigate quite quickly within a file, compile code under the cursor, jump to the REPL, and manipulate parentheses like nobody’s business.  It’s still not as nice for some of the intelligent (ie context-sensitive or type-aware)  help you get with IDEA or Visual Studio, but I suspect this is more about the dynamic typing of Clojure vs. the statically typed languages one normally sees with IDEA (Java) or Visual Studio (C#), than about Emacs itself necessarily or the inline help that is somewhat available.

Currently I have found absolutely zero help with step-by-step debugging.  Yes there are macro tricks and libraries available, but to me it  just adds more noise to my brain.  Actually the best debugging I’ve found for lispy programs has been in PLT Scheme’s IDE, as it has a way of displaying the results of each s-exp as you step through, but I’m pretty sure this has as much to do with Clojure’s current state of development as with Emacs’ support for graphical debugging (both pretty much nonexistent).  Debugging Clojure from IDEA sorta worked, in that I could step through a program, but it would always step me through the Java source, which, while mildly entertaining, is completely useless for actually debugging a Clojure program.  This was my experience with CDT also.  I would like to see something like PLT’s method (which is similar to debugging cells in Excel), where each expression is replaced by its result as you step through.

Anyway, on to the tutorial.

Leave a Reply

Your email address will not be published. Required fields are marked *