March 08, 2012
On 03/08/2012 02:13 PM, Nick Sabalausky wrote:
> "Alix Pexton"<alix.DOT.pexton@gmail.DOT.com>  wrote in message
> news:jja8k8$j14$1@digitalmars.com...
>> I feel compelled to point out that there is no such thing as "British
>> English". There is English, the written language with all its archaic
>> spellings and there are many spoken dialects, the most formal of which is
>> RP (Received Pronunciation) sometimes called The Queen's English (even
>> though she is German).
>>
>
> Yea, that is a good point. OTOH, it's often convenient (and common) to
> assume one particular "de facto standard" dialict unless otherwise stated.
> Here in the US, we have regional dialects too (although perhaps not to the
> same extent as how much the British dialects differ from each other), but
> when people either inside or outside the US refer to "American English",
> typically they're referring to the one that's spoken in the US mid-west and
> on TV/movies. Similarly, in the western world, "Japanese" is, by default,
> considered to be the Tokyo dialect (as opposed to Kansai or whatever other
> ones there may be).
>
> It might be different in Europe, but in the US, we think of "British
> English", unless otherwise specified, as being the London/"Queen's English"
> version. At least, those of us who are aware of the varied British dialects
> ;)
>
> FWIW.
>
I recall my theater director telling me that the closest modern dialect to "Shakespearean English" was somewhere near the south side of the state of New York...not sure how much truth there is to that, but it's a cool idea.
Regional dialects are definitely a thing in the US, but I agree that they're not always noticeable...unless you find just the right words for someone to say that accent their pronunciation, like the classic "pahk the cah in hahvahd yahd" that goes with a Bostonian accent.

>> I tolerate USian spellings
>
> I see I'm not the only one with a pet peeve that "'America' is two
> continents, not one country" :)
>
"American" does have the benefit of being more pronounceable, though...I just tried to pronounce that "oohz-ee-an", "us-ee-an", etc and they all sound odd.

>> as much as non-English speaking programmers do, because I see it as an
>> accepted "Programmer's English".
>>
>
> Being from the US I couldn't be sure, but that's what I has suspected.
>
>
To be honest, I've occasionally wondered why there aren't any (commonly used) programming languages using other human languages as bases. I mean, English doesn't exactly have the nicest syntax ever...USian here, though.
March 08, 2012
Am 07.03.2012, 15:17 Uhr, schrieb Marco Leise <Marco.Leise@gmx.de>:

> Am 07.03.2012, 07:17 Uhr, schrieb Daniel Murphy <yebblies@nospamgmail.com>:
>
>> "Derek" <ddparnell@bigpond.com> wrote in message
>> news:op.warmsnem34mv3i@red-beast...
>>> On Wed, 07 Mar 2012 03:38:09 +1100, Adam D. Ruppe
>>> <destructionator@gmail.com> wrote:
>>>
>>>> Why aren't we using real words here? Real words are easier
>>>> to remember and easier to type.
>>>
>>> Should we use American or English spelling? Color verses Colour, for
>>> example?
>>>
>>>
>>> --
>>> Derek Parnell
>>> Melbourne, Australia
>>
>> American.  Always.
>
> Whatever Java uses.

Ok, that *was* a bad idea: http://en.wikipedia.org/wiki/Java#Languages
March 08, 2012
On Thu, 08 Mar 2012 15:51:59 -0500, Ary Manzana <ary@esperanto.org.ar> wrote:

> On 3/8/12 8:55 AM, Steven Schveighoffer wrote:
>> On Wed, 07 Mar 2012 21:14:34 -0500, Ary Manzana <ary@esperanto.org.ar>
>> wrote:
>>
>>> The problem is not mistaking it with something else. The problem is
>>> when you want to write it. In Ruby my mind works like this:
>>>
>>> Mind: "How would I get a span for 5 seconds?"
>>> Mind: "Let's try 5.seconds"
>>> Mind: "Wow, it works!"
>>>
>>> I'm trying to remember cases when I just wrote what my mind thought it
>>> was correct and I was *so* surprised it worked out of the box in Ruby.
>>> Like writing array.last, and get it to work, instead of
>>> array[array.length - 1]. But in D, from the docs
>>> (http://dlang.org/arrays.html )
>>>
>>> bar[$-1] // retrieves last element of the array
>>>
>>> I read: bar dollar minus one wait what??
>>
>> array.back;
>>
>> http://dlang.org/phobos/std_array.html#back
>>
>> This is the issue with "intuition". It's easy to say, "hey I guessed
>> right in Ruby! Ruby must be more intuitive!". But if you were someone
>> who knew the range interfaces, wouldn't you try array.back in Ruby and
>> say "well, obviously D is more intuitive, it knew what I wanted without
>> even looking up the docs!"
>>
>> You are never going to come up with something that's *perfectly*
>> intuitive for everyone in every situation.
>
> Thanks, I didn't know that function.
>
> The problem is, you don't go saying "Hey, I want the back of an array", (or the back element of an array) you usually say "I want the last element of an array" (or range, whatever). I can't understand why "back" was used instead of last.

I think front and back were used for two reasons.  One, to avoid confusion with first and last as it applies to list-based languages.  Two, because STL uses those terms.

This is when it was decided: http://forum.dlang.org/post/gltq4k$93i$2@digitalmars.com

There was much discussion before that thread, look around to see what was said.

-Steve
March 08, 2012
On 08/03/2012 18:55, Nick Sabalausky wrote:
<snip>
> As you've noticed, trying to get a person to hear the difference often
> doesn't work (And even if they can hear it, that doesn't necessarily give
> them enough info to actually pronounce it). I think the right thing to do,
> at least in cases where it actually matters, is to instruct them on the
> actual mouth movements involved. Then they can "feel" the difference, and
> start to hear themselves making the different sound. "Hearing" it can
> naturally follow from that.

Yes, it seems that people's ears are tailored to the language they speak.  But then again, even native English speakers have trouble with sounds that are distinguished by others; a consequence is that the distinction between the "w" and "wh" sounds has largely been lost.

On the Royal Institution Christmas Lectures last year, there was a bit on speech perception.  Two sound samples both sounded like "duck" to typical English ears, but the Hindi speaker in the audience heard them to be different (it's probably down to short-breath and long-breath consonants, which we would transliterate as "d" and "dh").

<snip>
> A similar thing is the "tsu" sound in Japanese. The "TS" combination is very
> intimidating for most English speakers, and I doubt many English speakers
> can easily hear it. But as my class's instructor pointed out: It's exactly
> like the "ts" at the end of "boots". So just say that and folow up with a
> "u". Now I can say and hear it just fine (At least, I *think* I can - a
> native Japanese speaker would have to be the real judge).

Indeed.  But English speakers aren't used "ts" occurring at the beginning of a word, and so might drop either the "t" or the "s".  There are a number of initial consonant clusters in African languages that, likewise, occur only in the middle or at the end of a word in English, and so an English speaker will find these African words hard to pronounce.

Stewart.
March 08, 2012
On 08/03/2012 19:29, H. S. Teoh wrote:
<snip>
> Another thing is, I can't roll my R's. My tongue as stiff as a stick and
> just refuses to roll anything, no matter how hard I try.
<snip>

I can't roll my tongue either.  I'm told it's genetic. :)

But anyway, to me, rolling Rs seems pretentious....

Stewart.
March 08, 2012
On 08/03/2012 13:45, Jacob Carlborg wrote:
> On 2012-03-08 02:22, Stewart Gordon wrote:
<snip>
>> My utility library has, for consistency, DateValue.now, TimeValue.now
>> and DateTime.now.
>
> Cool. Why the "Value" suffix?

As far as I can remember, DateValue was named to avert confusion with the Date struct in Phobos.  TimeValue was named analogously.

OTOH, there wasn't anything called DateTime in Phobos at the time, and DateTimeValue was unnecessarily wordy, so I just stuck with DateTime.

Steawrt.
March 08, 2012
Le 07/03/2012 01:25, Jonathan M Davis a écrit :
> You don't write much code in functional style, do you? If you chain functions
> much, then long names very quickly result in long lines, which makes the code
> harder to read, and can quickly lead to expressions having to be multiple
> lines, simply because the symbol names involved were overly verbose.
>

You read way more code than you write. By way more I mean WAY WAY MORE !

Additionally, this make the task harder for any new dev. This is nonsense, and a recipe for failure. D has enough in it to scare beginners. No need to add some more.

BTW, I'm not aware of any successful recent language using a lot of abbreviations in its standard lib. That is not a proof, but definitively should be looked at.
March 08, 2012
Le 08/03/2012 07:15, Jonathan M Davis a écrit :
> On Thursday, March 08, 2012 00:52:57 Nick Sabalausky wrote:
>> "Ary Manzana"<ary@esperanto.org.ar>  wrote in message
>> news:jj94mb$1i7v$1@digitalmars.com...
>>
>>> Here's something I wrote today:
>>>
>>> parent_ids = results.map{|x|
>>> x['_source']['parent_ids']}.flatten.uniq.compact
>>> Hash[Site.find(parent_ids).map{|x| [x.id, x]}]
>>
>> When you format it like that (that is to say, when you *don't* format it),
>> yea, it's unreadable. Which is why I do such things like this:
>>
>> parent_ids =
>>      results
>>      .map{|x| x['_source']['parent_ids']}
>>      .flatten.uniq
>>      .compactHash[
>>          Site.find(parent_ids).map{|x| [x.id, x]}
>>      ]
>
> I actually tend to find code like that hard to read, because all of the
> operations are inside out in comparison to normal. But since the only
> difference between his example and yours is the formatting, I agree yours is
> easier to read. Still, I'd much prefer if such code didn't use UFCS, since I
> find it much harder to read that way. It's just so backwards.
>
> - Jonathan M Davis

You got tricked by your experience. You are used to read backward. The function are written in the order they are executed in the example above. This isn't very traditional, and may be the reverse order of what people expect due to previous experience, but definitively is the forward way.
March 08, 2012
Le 08/03/2012 12:55, Steven Schveighoffer a écrit :
> On Wed, 07 Mar 2012 21:14:34 -0500, Ary Manzana <ary@esperanto.org.ar>
> wrote:
>
>> The problem is not mistaking it with something else. The problem is
>> when you want to write it. In Ruby my mind works like this:
>>
>> Mind: "How would I get a span for 5 seconds?"
>> Mind: "Let's try 5.seconds"
>> Mind: "Wow, it works!"
>>
>> I'm trying to remember cases when I just wrote what my mind thought it
>> was correct and I was *so* surprised it worked out of the box in Ruby.
>> Like writing array.last, and get it to work, instead of
>> array[array.length - 1]. But in D, from the docs
>> (http://dlang.org/arrays.html )
>>
>> bar[$-1] // retrieves last element of the array
>>
>> I read: bar dollar minus one wait what??
>
> array.back;
>
> http://dlang.org/phobos/std_array.html#back
>
> This is the issue with "intuition". It's easy to say, "hey I guessed
> right in Ruby! Ruby must be more intuitive!". But if you were someone
> who knew the range interfaces, wouldn't you try array.back in Ruby and
> say "well, obviously D is more intuitive, it knew what I wanted without
> even looking up the docs!"
>
> You are never going to come up with something that's *perfectly*
> intuitive for everyone in every situation.
>
>> Now, in D I try:
>>
>> 5.seconds
>>
>> and it doesn't work. I have to write this very unintuitive:
>>
>> dur!"minutes"(5)
>>
>> Was it really necessary to implement it that way?
>
> No, nothing is ever necessary to implement a certain way. But there are
> practical concerns. For example, assuming UFCS worked in D, you *could*
> possibly do 5.seconds. However, this means you need a module-level
> function:
>
> Duration seconds(long n) {...}
>
> But the way D's overload resolution works, this precludes having
> 5.seconds work, and also having a member named 'seconds' in your
> class/struct.
>
> The nice thing about dur!"seconds" is that only one module-level symbol
> is introduced (dur), and it's unlikely to conflict with local symbols
>
> It may not be as intuitive, but it's certainly readable, and not too
> verbose to type.
>
> -Steve

the shorter the symbol, the higher the probability of collision. This is math. Definitively an argument in favor of not abbreviating.
March 08, 2012
On Thu, Mar 08, 2012 at 10:29:05PM +0000, Stewart Gordon wrote:
> On 08/03/2012 19:29, H. S. Teoh wrote:
> <snip>
> >Another thing is, I can't roll my R's. My tongue as stiff as a stick and just refuses to roll anything, no matter how hard I try.
> <snip>
> 
> I can't roll my tongue either.  I'm told it's genetic. :)
> 
> But anyway, to me, rolling Rs seems pretentious....
[...]

Well, it's pretentious in English, but quite mellifluous in Russian. :-) Though I'm told that even for native Russian speakers, it's one of the last sounds acquired, so it must be pretty difficult. (And to make things worse, they have *two* rolled R's, one palatized, one not. As if one R isn't hard enough already.)


T

-- 
Doubt is a self-fulfilling prophecy.