Editor war

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 85.225.108.194 (talk) at 21:21, 2 October 2007. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Jump to navigation Jump to search

In hacker culture, the editor war is an ongoing debate in the computer programming community about which text editor is best for general-purpose editing. The two largest camps are those favoring vi and those favoring Emacs.

Few pieces of software are more universal than text editors. Many flame wars have been fought between groups insisting that their editor of choice is the paragon of editing perfection, and insulting the others. Most participants in these arguments recognize that it is (largely) tongue-in-cheek. There are related wars over operating systems and programming languages, even source code indent style, topics that might normally be considered trivial.

Editor wars are usually fought between the devotees of vi and Emacs, the two most popular editors on Unix-like systems. Many users are familiar with both, at least enough to do basic text editing, and so feel they are well-placed to make judgment calls as to which is "better". Adding to this is the fact that both editors have a relatively difficult learning curve, which means users have invested a lot of time in getting to know the editor they use.

Differences between vi and Emacs

The most important differences between vi and Emacs are:

  • vi is a heavily modal editor (although some derivative versions, such as VIM, have an "easy mode"). Emacs relies less on modes, but makes extensive use of key chords (multiple keys pressed simultaneously, typically a Control or Meta (Alt) key plus some letter) for controlling the editor. In vi, the commands for modifying text and for moving around mostly use simple letter and number keystrokes, the same as the keystrokes used for inserting text. As a result, the user must switch into a separate mode to insert text.
  • vi is small and fast, and (traditionally at least) has limited customizability. Emacs takes longer to start up and requires more RAM, but is highly customizable and includes a large number of bells and whistles, as it is essentially a Lisp programming language execution environment which by default runs a Lisp program designed for text-editing.
  • vi was traditionally used inside of a text-mode console, having no X interface, whereas GNU Emacs, while initially designed for use on a console, grew an X interface fairly early on – modern versions of both provide various GUIs.

The difference in feature set and startup time tends to influence the way that the editors are used: vi users tend to enter and exit the editor repeatedly, and use the Unix shell for complex tasks, whereas Emacs users usually remain within the editor and use Emacs itself for complex tasks (often using an embedded shell mode when issuing shell commands).

Claimed benefits of vi-like editors

  • vi is smaller and faster than Emacs and requires less overhead, as it is not subject to creeping featurism.
  • vi is present in all Unix based operating systems, as guaranteed by the POSIX standard.
  • vi users argue that it conforms with Unix design and philosophy ("do one thing, and do it well"). Unix does not advocate building "Swiss Army knives", instead favoring the right tool for the right job.
  • vi commands are entered largely without the use of modifier keys such as Ctrl or Alt. Some users find this reduces repetitive strain injury in the wrists.
  • vi is intentionally "what you see is what you get (pretty much everywhere)". vi users generally do not customize their editor much, as opposed to advanced Emacs users who would not feel comfortable if their heavily customized profile were not available to them. [1]

Claimed benefits of Emacs

  • Emacs has a much larger set of built-in commands than vi.
  • Emacs is scriptable in a variant of the Lisp programming language called Emacs Lisp.
  • Emacs includes a vi emulation mode ("viper-mode").
  • Emacs does not require switching between "command" and "input" mode: commands are given with metakey chords. Users claim this improves the "flow" of their work by not requiring them to continually switch between modes.
  • GNU Emacs can perform computations with some calendars, such as Mayan or Discordian, which are not supported by the vi-like editors.
  • Emacs has special editing modes for a large number of programming and markup languages, including Java, Python, Perl, C, C++, Objective-C, Fortran, Lisp, Scheme and Pascal and scripting language modes for Bash and other common shells.
  • Emacs supports typing and displaying in many non-English languages, including Chinese, Czech, Hindi, Hebrew, Russian, Vietnamese as well as Western European languages.
  • Emacs can create PostScript output from plain text files[2] and has special editing modes for document presentation formats like LaTeX, TeX, and Wikipedia.
  • Emacs can be used as a shell itself,[3] and many tasks which would normally require the user to exit the editor interface can be performed from within the editor interface using plugins. This includes merge and diff functions, debugging operations, version control management, file and directory manipulation via dired, email, web browsing, and newsgroup checking (using gnus).
  • Emacs is easily extensible and modifiable in that users can simply add a mode (really a program) to the existing implementation of Emacs by taking advantage of the Emacs Lisp interpreter, whereas vi users have to resort to calling external programs; in this view (held by Eric S. Raymond among others), Emacs is not so much a program but a portable framework in which modules are added together as needed.
  • (GNU) Emacs gives the new user a helpful screen explaining how to exit (at least since the late 1980s). The typical vendor vi provided no help and was impossible for a new user to exit without external measures (e.g., disconnecting their terminal). Newer implementations of vi have fixed this problem.

(Many of these benefits are based on historic deficiencies of vi; modern versions, such as Vim, do offer some of these features, though in doing so they lose other advantages such as universal availability.)

Humor

Frequently, at some point in the discussion, someone will point out that ed is the standard text editor.

A 1984 interview with vi creator Bill Joy revealed that he himself used ed, which led Emacs proponents to the saying, "even Bill Joy doesn't use vi anymore."[4]

The Church of Emacs, formed by Richard Stallman, is a joke, and while it refers to vi vi vi (which is 6-6-6 in Roman numerals) as the "editor of the beast", it does not oppose the use of vi; rather, it calls proprietary software an anathema. ("Using a free-software version of vi is not a sin; it is a penance."[5]) It has its own newsgroup, alt.religion.emacs, that has posts purporting to support this parody religion.

Here is a typical post:

Truly, our responsibility to spread the Gospel of the Gnu is weighty.
Cleave to what is good. Remember the words the prophet Stallman
brought down from the Mount MIT, graved in Lisp on tablets of
crystalline lambda calculus.

Only this true: Emacs is pure.
All else is false.
Do not be misled by false gods like Vi, the Editor of the Beast.
Do not be seduced by Word, the Scarlet Woman of Babylon.
Do not be driven to madness by Xcode, the Blind Priest of the Children of Asherath.

When the wild winds of chaos blow, stay pure.
When the universe collapses in shards around you, stay holy.
When the gibbering hobgoblins of apostate Editors attack with shards
of broken syntax, seek the crystalline stillness within you.

Brethren, ensure that you (Meta-x-say-hallel-to-Emacs) daily for otherwise you will be lost.
When the Beast comes, only Emacs can save you.

This was brought to you as a public service by the Holy and Ineffable Church of The Mighty Emacs.
SUPPORT THIS CRUSADE WITH YOUR DONATIONS. EMAIL THE STILL BEATING
HEART OF A VILE VI USER TO emacs-highpriest@god-hates-vi-users

Stallman has jokingly declared himself to be St IGNU−cius, a saint in the Church of Emacs.[6]

vi supporters have created an opposing Cult of vi, argued by the more hardline Emacs users to be an attempt to "ape their betters".

Regarding vi's modal nature, some Emacs users joke that vi has two modes – "beep repeatedly" and "break everything". vi users enjoy joking that Emacs's key-sequences induce carpal tunnel syndrome, or mentioning one of many satirical expansions of the acronym EMACS, such as "Escape Meta Alt Control Shift" (a jab at Emacs's reliance on modifier keys).[7] Others have posited that this acronym in fact means "Eight Megabytes And Constantly Swapping" (in a time when that was a great amount of memory) or "EMACS Makes Any Computer Slow" (a recursive acronym like those Stallman uses), in reference to Emacs's high system resource requirements. The more modern humorist uses "Eventually Mallocs All Core Storage" as his or her future-proof witticism.

As a poke at Emacs’ creeping featurism, vi advocates will describe Emacs as “a great operating system, lacking only a decent editor”.

As a helpful tip for Emacs users but also as a joke, typing C-x C-c (the keybinding to exit Emacs) in Vim invokes the warning "Type :quit<Enter> to exit Vim", without actually exiting.

There is some additional humor that pokes fun at vi at http://www.dina.kvl.dk/~abraham/religion/vi-tutorial.html.

Current state of the editor war

In the past, many small editors modeled after or derived from Emacs flourished. This was due to the importance of conserving memory with the comparatively minuscule amount available at the time. These days, with a plentitude of memory, many vi-alikes, Vim in particular, have grown in size and code complexity. These vi variants of today, as with the old light Emacs variants, tend to have many of the perceived benefits and drawbacks of the opposing side.

A company which sells Vim and Emacs tutorials say the Vim one sells twice as many as Emacs. In a paint balling event, about twice as many people signed up for Vim than Emacs. [8] This has been taken by some to suggest that around twice as many individuals prefer Vim over Emacs. However, it is noted that many advanced programmers use Emacs and its various offshoots, including Linus Torvalds who uses MicroEMACS.[9]

In a recent Q&A session with nine top programmers, when asked what their favorite tools were, six of them mentioned Emacs.[10]

In addition to vi and emacs workalikes, pico and its free software clone nano and other editors often have their own third-party advocates in the editor wars, though not to the extent of vi and emacs.

References

  • The Art of Unix Programming: Raymond, Eric S (2003). The Art of UNIX Programming. ISBN 0-13-142901-9.