On 11/2/05, Michele Dondi <[EMAIL PROTECTED]> wrote:
> On Fri, 28 Oct 2005, John Williams wrote:
> > But IMHO the reduction in typing for this relatively minor issue is not
> > really worth the surprise to newbies at seeing operandless operators.
> I don't buy that argument as newbies are already exposed to all sorts of
> surprises including operandless operators. Including mutating operandless
> operators. What is s/// after all? Or is there a good reason for an
> asymmetry between different classes of operators?
I think the difference comes from the Principle of Least Surprise. The
various operators being discussed in this thread are all operators
which are in languages that have common use - C, C++, Java, the .Net
stack, etc. Regexen and the various built-ins are generally considered
to be Perl-specific, so if they're weird, this is just a Perl-ism. The
PoLS doesn't apply.
Yes, from a consistency point of view, ALL operators should default to
$_ or some other sensible item ($*STDIN for <>, etc). However, the
PoLS does need to guide our decisions.