Sunday, October 7, 2007

Consistency in Software: Case #3841-22

chrome $ unzip --help
UnZip 5.52 of 28 February 2005, by Info-ZIP. Maintained by C. Spieler. Send
bug reports using; see README for details.

Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
# 2 dozen lines of helpful info omitted

chrome $ zip --help

zip error: Invalid command arguments (no such option: -)
chrome $

There's a very logical explanation for this, similar to why certain words in English are spelled in apparently arbitrary, inconsistent ways. For example, while it might seem maddening to remember which adjectives end in "able" and which end in "ible", all you have to remember is whether the Latin word the adjective is derived from ends in "abilis" or "ibilis". Another very useful cue, which I currently can't come up with a concrete example for, is knowing in whch rough century a word entered the English language. Knowledge of the fashion at the time could help remembering, for example, whether the spelling of a trade would end in "er" or "or".

It's similar in software. Sometime around the turn of the century the GNU Coding Standard calling for "--help" for command-line help options was adopted nearly universally. Before that common ways of accessing help were "-h", "-?", or programs often left the help to the man page[2].

The link program I run has a 2005 copyright on it, while the zip program was last compiled in 1999.

So obviously to be a fluent user of a system you need to know when the various tools you use were last compiled. Chances are, if you knew that, you wouldn't need the online help -- there's enough in your head already.

Any utility that supports "--help" and doesn't have a "-h" option, and is unlikely to ever need one, might as well map "-h" to "--help". And if there is a logical meaning for a "-h" option, if it doesn't make sense when it's the only argument, treat it like "--help". Doing otherwise leaves the impression of the inflexable software writer mocking the incapible user.

was dropped


[3] Typos in the last sentence are metonymical.

1 comment:

Tib said...

You are such a geek :)

On another note, I have booked a car for Saturday morning. So lets hope the weather stays dry.

I'll call you when we have more weather data available...