ch-ch-changes

Bill Baxter wbaxter at gmail.com
Wed Jan 28 14:01:07 PST 2009


On Thu, Jan 29, 2009 at 5:31 AM, Yigal Chripun <yigal100 at gmail.com> wrote:
> Bill Baxter wrote:
>>
>> On Wed, Jan 28, 2009 at 6:07 PM, Nick Sabalausky<a at a.a>  wrote:
>>
>>> Isn't "tail" the standard counterpart to "head"? ("toe" just doesn't
>>> sound
>>> good)
>>
>> Tail has a history of being used to mean "everything but head" in
>> functional programming languages like Haskel and ML.
>>
>> So of  back, last, end, tail, rear, foot, toe, it seems every one has
>> some strike against it.
>>
>> back - could be mistaken for an action
>> last - doesn't pair well with "head", and "first" sounds too much like
>> item #1 overall
>> end - in C++ usually means "one past the end"
>> tail - in FP langs means "everything but head"
>> rear - makes Walter thing unhappy thoughts
>> toe - sounds silly, doesn't make so much sense for a range that
>> represents a tree structure.
>>
>> Toe is sounding pretty ok.
>>
>> Actually I think the critique that it doesn't make sense for a
>> non-linear range should be thrown out.  Linearizing is the whole
>> purpose of a range.  So even if it wasn't linear before, a range
>> effective is providing a linearized view of it.
>>
>> So that leaves "it sounds silly", which is a pretty weak subjective
>> argument against.
>>
>> --bb
>
> I disagree with the above reasoning. "Language X has different meaning for
> word Y" is not a valid argument IMO. One of D's stated goals is to break
> backward compatability when needed in order to get a better language design,
> yet we constantly keep getting back to " but in C++ ...".
> if people want to use a backward compatible language they already have C++
> for that, and they don't need D. I for one, prefer to change when the change
> makes sense and brings more clarity. Yes, it'll be initially confusing for
> former C++ programmers, but IMO it's worth it in the long run.
> head/toe is not just silly, it's also non intuitive for non-English
> speakers. (I'd be confused by this, had i seen this for the first time)
> When I write D code I think in D, not any other language and I'm sure that
> applies to most people. making the switch to "D mode" is easier IMO than
> trying to remember confusing terms, just because some other language has
> slightly different meaning for the deafult terms.
>
> Hack, I don't even know haskel, why should I care about haskell's
> definitions?

If you port code from C++ or Haskell to D it will become an issue.  I
ported a largeish C++ library with lots of iterators and it was only
natural to use the same terminology as C++ there (begin/end).  If D
co-opted those terms I'm not sure what I'd call the ported C++ ones to
differentiate, and it would just end up being confusing to both D and
C++ users.  I think making it easy to port C++ code is a good goal.

Not so sure about Haskell, though.  D may never be functional enough
for porting Haskell to make much sense.

> I already asked in a previous post - would a chinese programmer intuitivly
> think that toe is the last item in a range?

Does it really matter if it's used everywhere and consistently
throughout D?  It's like saying "char" is unintuitive.  Yeh, it is
unintuitive, but once you know it's short for "character" it's easy to
remember.  Surely a Chinese programmer once he learns toe is the last
item will have no problem remembering what it means, given the
relationship between head and toe on a person's body.

--bb



More information about the Digitalmars-d mailing list