Would anyone seriously invent a modal interface today
OK, by saying this, you more or less triggered my rant on vi being a "modal" editor, so here goes.
Think of text editors (at least, keyboard-oriented ones) as tools that take commands in a language. Every editor command is a sentence in that editor's formal language.
Most, if not all, editors' languages have a grammar such that there are times when typing certain keystrokes radically influences the meaning of the following keystrokes. Examples:
In emacs, if you type the M-x terminal symbol in the language, you enter a production rule that you could write like: "M-x" MetaCommand "Enter". If you type "doctor", it will either be interpreted as a command or as text, depending on whether you typed M-x first.
In emacs, when you type C-u N, you are entering a production rule that could probably be written something like: "C-u" NUMBER Start (where "Start" is the start production rule, i.e. this can serve as a prefix for any command).
In vi, when you type the "i" terminal symbol in its language, you enter a production rule that could write like: "i" LiteralTextToInsert "ESC".
In most GUI editors, when you type the Ctrl-F terminal symbol in its language, you enter a production rule that you could write like: "Ctrl-F" SearchString "Enter"
Now, notice that your previous history of keystrokes puts you in a different mode, where what you type means something different than if you had typed it without entering that mode. In that sense, these editors are all modal. Note the similarity between the meta production rule in emacs and the insert production rule in vi: both require a special key to enter the mode and both require a special key to leave it.
So what's the real difference here? The thing that trips people up about vi is not that it's modal, because people happily deal with modal features in other editors. The thing that trips people up about vi is that you have to use modes to insert text. Or another way to put it is that the Start rule in vi's grammar doesn't immediately expand to rules for every printable character to self-insert. Or to put it in really, really simple terms, the thing people don't like about vi is that it violates the "I should be able to just start typing" assumption.
People find vi frustrating at first because they don't understand that assumption or can't/won't shed that assumption. It doesn't really have a lot to do with hardware limitations. It's just a different way of thinking about the formal language of editor commands.
View all comments
Show parent comment
5
u/adrianmonk Feb 27 '14 edited Feb 27 '14
OK, by saying this, you more or less triggered my rant on vi being a "modal" editor, so here goes.
Think of text editors (at least, keyboard-oriented ones) as tools that take commands in a language. Every editor command is a sentence in that editor's formal language.
Most, if not all, editors' languages have a grammar such that there are times when typing certain keystrokes radically influences the meaning of the following keystrokes. Examples:
Now, notice that your previous history of keystrokes puts you in a different mode, where what you type means something different than if you had typed it without entering that mode. In that sense, these editors are all modal. Note the similarity between the meta production rule in emacs and the insert production rule in vi: both require a special key to enter the mode and both require a special key to leave it.
So what's the real difference here? The thing that trips people up about vi is not that it's modal, because people happily deal with modal features in other editors. The thing that trips people up about vi is that you have to use modes to insert text. Or another way to put it is that the Start rule in vi's grammar doesn't immediately expand to rules for every printable character to self-insert. Or to put it in really, really simple terms, the thing people don't like about vi is that it violates the "I should be able to just start typing" assumption.
People find vi frustrating at first because they don't understand that assumption or can't/won't shed that assumption. It doesn't really have a lot to do with hardware limitations. It's just a different way of thinking about the formal language of editor commands.