From: Simon Schuster Date: 2007-10-23T18:50:23+09:00 Subject: Re: pop/push, shift/unshift *yawn* oh, what? people have been using these terms for a long time? oh wow, yeah, clearly important. *ahem* but what about the idea that it's four points of inter-related methods? I guess that's not as important as tradition... *ahem* .... I mean, tradition and mathematics, they're key. just look at edison and tesla. :D On 10/22/07, Robert Klemme wrote: > On 23.10.2007 05:53, Simon Schuster wrote: > > the inconsistency in naming bothers me. :P I would imagine that it > > comes from push/pop being older, and shift/unshift being added later > > (probably I would guess that both of these are pre-ruby programming > > ideas. I know I've seen push/pop before.) > > > > I would like to see either push/pop changed to be > > something/unsomething, or shift/unshift changed to be um, visualish > > ideas of what's going on (or whatever push/pop is.) my preference > > would be push/pop changed to something/unsomething. or maybe > > front_add, front_del, back_add, back_del. > > > > just trying to get a gut-grip on these four array processes, and I'm > > pushing and popping and shifting and unshifting left and right (and > > back and forth?) and it's taking a surprising amount of time to "grok" > > them. does anyone think this is a naming convention that could benefit > > with some change, or am I just being strange? > > I think you just should get used to the terminology. Whatever naming is > choosen it is artificial - you can always argue about whether the end > (highest index) or the beginning (lowest index) of the Array is the top > or bottom of the stack etc. So not changing is definitively the better > choice - just think about all the confusion created by all those people > who use this regularly. Also keep in mind that changing these would > break a hell lot of code. > > Why don't you just create yourself a simple test script that uses all of > those methods and invoke it whenever you need to remind yourself of the > proper wording? > > Kind regards > > robert > >