Re: "Humane" programmer interfaces

2006-01-02 Thread Andrew Durdin
On 1/3/06, Alex Martelli <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > if somestr[:len(needle)] == needle: > > This is definitely more readable, and the same would apply if I tested > somestr[:len('glab')] == 'glab' -- the key point being that one knows > where th

Re: "Humane" programmer interfaces

2006-01-02 Thread Alex Martelli
Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: ... > > code goo.last than goo[-1]. For an analogy, consider, in Python, > > somestr.startswith('glab') as a more readable equivalent of > > somestr[:4]=='glab' -- the "why add?" question is easily answered, > > Using constants for the example does

Re: "Humane" programmer interfaces

2006-01-02 Thread Alex Martelli
Andrew Durdin <[EMAIL PROTECTED]> wrote: > On 29 Dec 2005 09:50:57 -0800, colinwb <[EMAIL PROTECTED]> wrote: > > > > >> puts ck.first, ck[0], '*', ck.last, ck[-1] > > One of the points at issue (minimalism/monotony) relates to TOOWTDI, > which has implications for language/module design and for c

Re: "Humane" programmer interfaces

2005-12-29 Thread Andrew Durdin
On 29 Dec 2005 09:50:57 -0800, colinwb <[EMAIL PROTECTED]> wrote: > > >> puts ck.first, ck[0], '*', ck.last, ck[-1] One of the points at issue (minimalism/monotony) relates to TOOWTDI, which has implications for language/module design and for code readability. Ruby supports negative indices in the

Re: "Humane" programmer interfaces

2005-12-29 Thread colinwb
Apologies if I'm misunderstanding some points in kpd's post, but: http://www.rubycentral.com/ref/ref_c_array.html [ ] arr[anInteger] -> anObject or nil arr[start, length] -> aSubArray or nil arr[aRange] -> aSubArray or nil Element Reference Returns the element at index anInteger, or returns a s

Re: "Humane" programmer interfaces

2005-12-28 Thread kpd
list[-1] maps very well to my mental concept of list. To me 'List' brings to mind a bunch of things in a line. It's intuitive to count forward or backward. Ruby's 'last' doesn't map as well for me because I don't think of the list as having an attribute of 'last.' Java just annoys me because

Re: "Humane" programmer interfaces

2005-12-23 Thread Kent Johnson
Dave Benjamin wrote: > There's been a lot of discussion lately regarding Ruby and the notion of > a "humane" interface to objects like arrays and maps, as opposed to > "minimalist" ones. I believe the article that started the debates was > this one by Martin Fowler: > > http://www.developertesti