On Fri, Apr 22, 2005 at 09:24:51AM +0200, Michele Dondi wrote:
: Speaking of which, I like to think of (some) adverbs in terms of cmd line 
: switches, and maybe it's just me, but I think it would be extremely useful 
: to have a full set of tricky ones providing reasonable defaults 
: (user-overridable, of course), short enough to be easy to type; e.g:
: 
: unlink :warn; # roughly equivalent to Perl5's
: # unlink or warn "Could not remove `$_':$!\n";

The problem with that approach is also evident in Unix culture.
How many different ways are there to ask for help, or to get verbose
output, or to specify the output filename?  How many different ways
are there to specify input and output delimiters?  -e means something
very different to Perl than to rpm.  Does this version of chown use
-r or -R for recursion?

Admittedly, some of these problems would have been reduced if Unix
had gone with long option names to begin with.  But a lot of these
problems come from too many people in too many places inventing too many
similar things without the benefit of a culture that encourages a
common standard without forcing one.  In Perl culture we must guard
against the extremes of central control vs anarchy, and choose a middle
path.

And some of these things can be headed off by designing the interface
differently.  We wouldn't need a recursion option on chmod/chown/cp
etc.  if Unix had a notation for "all the files under this one".
Similarly, if Perl has consistent warning and exception mechanisms
that are easy to use and properly scoped, people are less tempted to
make up one of their own.

All that being said, we did design named parameters into Perl 6 so that
an interface could have options.  But people are quick to add options
without thinking about the global consequences of name choice.  I feel
like there's a cultural solution there somewhere, but I don't know what
it is, because that's the sort of thing cultures are better at inventing
than I am.  :-)

Larry

Reply via email to