On Thu, May 31, 2007 at 05:10:57PM -0700, Darren Duncan wrote:
: I decided to bring out this Hash->Dict topic in a different thread 
: from the thread on Synopsis r14407 about Object->Universal since I 
: consider them separate though tangential matters that should be 
: argued on their individual merits.
: 
: In the interest of that Perl data types are better off being named 
: primarily after their meaning rather than their implementation, 
: probably the current worst offender is Hash.

Nope.  Hash is mostly about meaning, and very little about implementation.
Please don't assume that I name things according to Standard Names in
Computer Science.  I name things in English.  Hash is just something
that is disordered, which describes the associative array interface
rather nicely, distinguishing it from the ordered Array interface.
The fact that it *might* be implemented using a hash algorithm is
merely a nice association with some mnemonic value for CSish folks.

Likewise, if I say Object I'm referring not to a CS object so much as
an English object, which is just something that is fairly discrete
and can be handled and treated as a single thing, even if it happens
to contain multiple things.  About the only nod to CS here is that
you can call the .HOW method on any Object.  Anything beyond that
is the fault of the metamodel.

In general I'm much more interested in the natural linguistic feel
of Perl than in matching up with any particular standard CS terms.
That's why you have "given" and "when", not "switch" and "case".
That's why you say "next" and "last", not "continue" and "break".
That's why we have "state" rather than "static", "my" rather than
"var" or "decl", "contend" rather than "atomic", "maybe" rather than
"orElse", "has" rather than "attr", "role" rather than "interface",
and so on.

Of course, it's possible to pick words that have too much overloading
in the CS literature, but I don't think either Hash or Object really
fall into that category, in the case of Hash because hash algorithms
are a fairly minor thing, and in the case of Object because people are
already used to all different kinds of Object systems, some class-based,
some prototype-based, so generalizing to a kind of object that gives
you both is not really a problem.

And as I said before, part of the reason for using Object is political,
because it means we're Really Doing Real OO™.

And maybe part of the reason for *not* using Universal is also
political, insofar as Perl 5's UNIVERSAL has been sorely abused in
various ways, and I don't want people to have that mental association.
(Kinda like the fact that Captures resemble anonymous typeglobs but
we're *not* going to call them that...)

Larry

Reply via email to