Dan Brian writes:
> If there's a willingness to rename shift/unshift, why not consider 
> going a bit further (and offend shell heritage) to note that pull/put 
> aren't really linguistically opposed either (unlike push/pull). Why not 
> rename pop to pull, and use something like put/take for shift/unshift? 
> Having push and pull operate on opposite ends of an array strikes me as 
> more confusing than even shift. When it comes to adding and removing 
> elements, shouldn't there be semantic opposition for functions that 
> operate on the same end?

I don't think that's a good time.   It kills the array-as-stack idiom,
which, well, everybody uses all the time.

I don't mind the linguistic nonopposition of pull/put.  The main thing I
don't like is the alliteration between push/pop.  That makes for very
difficult mnemonics.  Obviously, the CS-literate can just remember that
they're the nonstack ops, but many Perlers are Shellers and Adminers,
without being CSers.  

I've actually been happy with shift/unshift.  But what we'd really like
to do is: given the user knows what push/pop do, what would they *guess*
to mean shift (I tend to think that this is a very good technique for
naming).

And, well, I'm thinking pull.  So it's a toss-up between shift/unshift
and put/pull.

Luke

Reply via email to