On Sun, Oct 18, 2015 at 8:44 AM, Ciaran McCreesh <ciaran.mccre...@googlemail.com> wrote: > > But the big gain for everyone is in replacing a weird, overly clever > and highly fragile collection of weirdness that's designed to mostly > accept any dodgy input, with one that just gets you to give it a sane > input to begin with. >
See also: http://cr.yp.to/qmail/guarantee.html > 5. Don't parse. > > I have discovered that there are two types of command interfaces in > the world of computing: good interfaces and user interfaces. > > The essence of user interfaces is parsing: converting an unstructured > sequence of commands, in a format usually determined more by > psychology than by solid engineering, into structured data. > > When another programmer wants to talk to a user interface, he has > to quote: convert his structured data into an unstructured sequence > of commands that the parser will, he hopes, convert back into the > original structured data. > > This situation is a recipe for disaster. The parser often has bugs: it > fails to handle some inputs according to the documented interface. The > quoter often has bugs: it produces outputs that do not have the right > meaning. Only on rare joyous occasions does it happen that the parser > and the quoter both misinterpret the interface in the same way. When you have programs talking to programs it makes far more sense to just spell things out correctly vs having the receiving program try to guess what the calling program meant. -- Rich