Thursday, March 11, 2010

My Editorssey

My Editorssey
--------------------

I don't want to know how much time I have wasted finding the best editor for my needs. Have I found it yet? Well, not really. I am using still several editors on a regular basis depending what task I am working on or what system I am using. Was it worth the time spent to try and learn new editors? Not really. But it was fun though. Let me take you on a small journey.

Back in the days of Windows 95 I started with the built-in Notepad for tweaking system files like AUTOEXEC.BAT and CONFIG.SYS. When I booted in DOS only mode to tweak expanded memory for ancient games like Mortal Kombat and Destruction Derby I made use of the good old EDIT editor with its dazzling light letters on a just as dazzling light blue background. The basic editors were so basic that I wouldn't actually think about them at all. They were just necessary tools and came with the system.

Then in middle school I started programming. I bought the MSDN Visual Studio student edition - an Integrated Development Environment (IDE) that brought its own editor. Programming for me at that time was opening Visual Basic Studio, writing and compiling code in it. How could I know that I was just editing plain text files I could have edited with Notepad, EDIT or any other text editor as well.

After a while I realized that learning Visual Basic from a Dummy book wasn't really teaching me about the gits and guts of programming. I wanted to look behind the Draw-Your-program-Drag-and-Dropping curtain. I got started with C and C++ programming, wrote console programs and ,after I got The Petzold - the Windows API bible - for free from some stranger on the Usenet, even GUI programs. Since I edited all my code in the IDE instead of drawing them in Visual Basic I even got to understand the concepts of the Windows API.

At some point I even wanted to go more low level - assembler and hex level. I wanted to hack a latin program for vocab learning and I needed an editor that would allow me to edit binary files in Hex mode. I came across UtraEdit and I really liked it. It was way more advanced than the packaged Notepad, had syntax highlighting, a sleek and professional looking appearance to it. Using it I was eventually able to crack the time limit -- a huge feeling of satisfaction and power. I continued using UltraEdit for programming C/C++. I could tweak the editor to compile programs and even run them -- totally sufficient for the small command line programs I wrote at that time. "Who needs an IDE, anyway" I thought.

Soon I would get introduced to one again, though. In computer class in high school they made us use the Turbo C++ IDE, an DOS IDE. It reminded me of the EDIT editor having almost the same color scheme. To be honest it felt more like an editor than an IDE, maybe that was the reason why I liked it. I even used it to write and coordinate a Tank Wars game clone as president of the computer club.

I tried out Linux several times some teachers and friends swore by it. I gave up several times, either didn't get X up running or a mouse installed. But maybe the main reason was the sheer amount of text files that you had to edit and I didn't know how to use any of the unix editors at that time. Frankly, I didn't bother to learn them. I was too frustrated with Linux. It was only after Knoppix came out - a Debian based live CD that had all the drivers for my system and worked right after booting up, that I became again interested in Linux. I signed up for the LPIC exam and started with learning an editor; my book said there were two: Emacs and VI. I chose VI. How did I learn it? ":help tutor" was all it took and after around 30 minutes I mastered all the basic movement and editing commands. Linux started to be fun. Right after finishing the quick start guide I continued to read more of the manual and soon VIM turned out to be a powerful tool and captivating toy at the same time. It is not exaggerated when I say that I learned Linux by learning VIM.

When I came to university we were taught Pine and Emacs on Solaris machines; but since I already knew enough Unix, I cold-shouldered those programs and modified my environment to use mutt and VIM instead.
VIM did all the things I needed to do and it did it beautifully. Using the commands and modifiers made me feel I was more efficient doing my work than other students using Emacs or KEdit. I began tweaking VIM to become more efficient -- ignoring the time it cost to tweak VIM of course.

I even started to do my homework and write letters with VIM writing everything in LaTeX. The postscript results were beautiful and I thought I would never need another text processing program again in my life. I looked for a Windows VIM version for my first laptop and installed the Cygwin environment on my Windows computer (Linux didn't run it sufficienty enough). I disregarded Emacs and never thought that I would bother learning it until I had to write my master thesis. Maybe in an act of procrastination I began learning Emacs because somewhere on the Internet I read that the AucTex mode was the ne plus ultra for editing LaTeX documents. So I learned Emacs meticulously - with all its cryptic key combinations, and strange major and minor modes and with Elisp - the Emacs programming language. I tweaked and wasted more time time than anticipated - days, a week - before I was somewhat confident in speaking "Emacs". Oh yeah, of course, I had to pimp the look and appearance of my Windows Emacs installation too, before I could begin writing my thesis. I always told myself that the LaTeX typeset output was worth it and that it was more safe to Edit plain text files than write in Word of OpenOffice. I told myself that the write feeling on Emacs was just different and actually let me write more and better; I still have the feeling that typing in Emacs just feels different from VI - I don't mean the key combinations or shortcuts, but actually the feeling of typing (Anybody feel the same?). Emacs felt more like a text processor -- so I felt it was the right choice for my master thesis.

I eventually finished my thesis with Emacs and stayed with it, even for programming - at least for my personal stuff. At work I had to use Eclipse because everyone else used it and it was just best to use it I was told. I was shocked that my colleagues were so conservative and myopical, considering Eclipse the only way to program Java just like I did with Visual Studio back in the days. Finally I reluctantly submitted to their request to use Eclipse. It certainly was more convenient than writing Ant or Maven by yourself, or converting all the Eclipse projects that they dilettantishly commited as a whole into their CVS. For them Java seemed to be Eclipse - that was my annoyance, not Eclipse itself.

Around that time I also had started to write Web applications with Ruby on Rails. Not being satisfied with neither Emacs nor Eclipse for that task, I went with the Netbeans IDE. With its sleeker and cleaner interface it just seemed to suit the lean and smart Rails paradigm better.

The Netbeans interface was also more Mac-like. I converted to Mac with a Macbook Pro, my second notebook. Everyone seemed to praise Textmate -- the über-editor for the Mac. And the editor of choice for many Rails developers.  It certainly looks nice, but I never bothered to learn it as meticulously as VIM or Emacs because I thought: "What's the point if you can only use it on a Mac?" So I tried out all major Emacs distributions (Aquamacs, Emacs.app, Carbon Emacs). After all Mac OSX is an Unix system under hood.

Yes, Emacs with its cryptic key strokes, modes and Lisp dialect, the almighty text editor that does all and everything for its disciples had even became a religion as noted by its inventor Richard Stallmann. But being an all-in-one device comes at the price of complexity -- some call Emacs an operating system. Recapitulating I don't like the steep learning curve and the huge and messy configuration files, that one accumulates over time. Even on my dual core Macbook Pro booting the beast up felt sluggish at times.

Yesterday I decided I needed a modern editor, something newer than the 35 year(!) old Emacs or VI. After some googling I realized that there simple was nothing as powerful and ubiquitous as those two classic editors. But sine I wanted a change, I went back to VIM. I installed the MacVIM distribution from macports and I'm liking it. It feels fast, sleek and clean and editing files in it is pure fun. You don't need thousands of lines configuration to start typing and navigating away quickly. Using the right color theme (desert at the moment), you even get a Textmate look. VIM is a relief from Emacs. And not only my pinky thanks me for it. Old memories from my first Unix day become lively. Storm and stress, programming for fun. Just the right mood I need for learning some Python these days. Compiling VIM with the +python feature I can even extend the editor with Python and avoid the arcane Vimscript.

My editor Odyssey is certainly not over yet. While I have wasted a lot of time for learning different editors and IDEs so far, I have also learned a lot of new things during that progress. It is true, that sometimes I have spent more time tweaking my editors than doing actual work. But tweaking isn't that what constitutes the excitement about computers anyway? At the moment I am using OpenOffice for word processing, Netbeans for Rails programing, Eclipse for Java and VIM for all other editing tasks. There is no swiss army editor for all my writing or editing tasks. So "religious" statements from fanatic editor disciples about extensive economics when learning a new editor are far more than dubious.

Colophon: This blog entry was written with aforementioned MacVim with linebreak (:help linebreak) set, mapping of the cursor keys to move by visible rather than "physical" lines (:help 25.4) and spell checking enabled (:set spell) so that it almost feels like a real word processor ;)

No comments: