Tuesday, April 3, 2012

EMACS or: How I learned to relieve stress and rant



I'm trying to learn EMACS. I'm trying to learn it to such an extent that I'm spending precious time which I should be using to catch up on sleep (you could always use more, kind of a backup for later) or do work (you've always got some, drawn from this seemingly bottomless reservoir). In fact, I'm writing this blog post (rant, in hindsight) on EMACS, and I'm gonna upload it to the blog from within EMACS once I can script that into place. I've successfully scripted my music player (VLC, now MPlayer) into it, so I can now play my playlists without alt-tabbing, and that's an added relief.

Thing is, I've found my experience with this famed editor to be exhilarating. It has found a perfect match in me, and I in it. Change always brings euphoria, so when the dust settles I can give you a more clear-headed opinion. But I am excited, so settle down; this is going to be a long post. I believe the contemporary term for this sort of a post is a ‘rant’ now. Potato.

The first computer I ever saw was an old IBM 180 that my father bought when I was 8. I only ever saw it complete POST twice, but it was the most amazing thing I'd seen, and this little beeping machine never failed to amaze me, even while switched off. Soon I was pestering my dad for computer books, reading everything about computers I could get my hands on. Fine, looking at pictures. Soon we moved on to the systems he has at work, once he became confident enough to let me touch them, and windows 3 became 2000, and finally XP, when I was about 12. All this time, the only operating system that I'd ever seen was Windows, and when XP came out, I thought it was the best GUI I'd seen, and I'd keep trying to customize it for days, or weeks. Naturally, I knew there were others out there, I'd heard of Solaris and Unix, but I'd never actually seen one.
And then I used Ubuntu.  Frankly, I wasn't impressed. I was a little, when I saw that the boot time had been reduced, but that was it. Everything seemed harder to do, and that accentuated the dislike I had towards the brownish shade of things and lack of what I had considered interface anchors – right hand side windows controls, start buttons and whatnot. But I decided to give it try, in order to widen my horizons, so to speak.
And then I learned bash.
I've never looked back. I mean I knew dos programming, I'd gone so far as to learn to code TSRs (long story, you don't need to know in today's world anyway) which could be called the pinnacle of batch programming at the time. But the amount of control that the Linux shell gave me was virtually mind blowing. The shell was integrated into the kernel, and literally everything had a man page.
So, when I had to switch back to Windows 7 due to Microsoft Word, my heart never went with it, but the snappy and well-designed UI along with... well, Microsoft Office 2007 convinced me to change.
But I digress. The bottom line is that EMACS highlighted the problem I had (I've always had) with word processors but failed to realise: There's too much fluff. There's too much moving around with the mouse to do things.
More importantly, its extremely distracting for a writer. If you intend to write more than 100 words at a stretch, do NOT use a word processor. In fact, I tried to go back to word after EMACS, and I literally couldn't. Forgetting to put spaces after commas, spelling errors, notifications that word corrected my spelling, formatting problems, kept breaking my stream of thought. All I wanted to was to get my ideas into text, and this brief and precious window of clarity in which you know exactly what to write was lost within my first ten seconds of opening Word.

To the right you can find my emacs as I was writing this, well.. post, and you can see most of the things that are a part of your everyday workflow. Extensibility.
Almost every major application you can find today takes 'extensions', or 'apps', little bits of programming that add functionality to the program. Once upon a time, I would give anything for the functionality that today’s apps and scripts provide. In fact, I actually remember writing a separate application for my family to watch movies since Windows Media Player (no VLC then) would not allow continuous playing of .DAT files (the kind you found on Video Discs). However, the problem with this sudden outburst of small (or large) developer communities for the development of accessories for each application has been that there is virtually no semblance of coordination or even communication.
Every program out there, Firefox, Chrome, Eclipse, you name it, has a number of dedicated 'fans' out there who use it for everything, from reading email to playing games to watching porn to drying their hair. In its essence, all these programs become tiny little operating systems (just occurred to me that virtual machines would be more appropriate terminology) within themselves, managing threads, killing unresponsive ones, starting new ones, performing memory management, almost everything your OS does, except inside an existing OS using additional memory, and with less efficiency and panache than your OS, whichever it is.
Google sort of caught on to this trend and actually made an operating system with their browser, and I thought it'd be a cool idea to get one, for a while. However, even though their product, though quite exciting from the specifications, and the general idea itself, was bound to fail. Here's why: There was no way for a customer to try it. The only way to actually have a hands-on experience with the OS was to buy one of their netbooks, and there weren't enough reviews out there to make me. It woulda been fine if everybody had one, or if I was a millionaire, but since neither of that is true, I wanted to try it. Only, I couldn't. Not easily anyway.
Anyway, lesson is, it’s not a bad idea to have one of your programs do most of the things you usually do without leaving the interface. Scripting provides this capability, only most of the apps out there are still working on it. From experience, without naming any, I can say that most get almost as slow as a full blown OS when loaded with a lot of apps. That said, the functionalities offered by EMACS have been around for a long time, and are as perfect as they could get.
Finally, it’s cross platform, and this can be an issue if you can only use a particular kind of processor without looking like a chimp with wooden blocks. All those MS Office users out there, heck everyone, I'm talking about you. Mac and Windows does not make you cross-platform. Soon enough, all these mobile OSes, Linux and other systems ARE going to intrude into your world, however sheltered it may be. I've warned you.

Truth is, it’s really not that bad. Once you know how, you can code anything you want into the editor and then activate it with a key press of your choice. So once you've used it for a while and you've begun the process of developing muscle memory for different actions inside the browser, you can find your life getting easier every time you use your system. Of course, for the first week, (or month depending on your level of commitment,) things are gonna be harder than they used to be, since looking up and pressing the key to open a new file would take more time than picking up your mouse, clicking the open button, typing in the name and pressing enter, but its gonna get easier and easier until you realise you're actually doing things faster that you used to.
I have.