May 28, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Simen Kjaeraas | On 2013-05-28 14:58, Simen Kjaeraas wrote: > America is not a country. The country is called USA. I know that, but I get the impression that people usually say "America" and refer to USA. -- /Jacob Carlborg |
May 28, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Tue, 28 May 2013 01:05:46 +0200, Walter Bright <newshound2@digitalmars.com> wrote: > On 5/27/2013 3:18 PM, H. S. Teoh wrote: >> Well, D *does* support non-English identifiers, y'know... for example: >> >> void main(string[] args) { >> int число = 1; >> foreach (и; 0..100) >> число += и; >> writeln(число); >> } >> >> Of course, whether that's a good practice is a different story. :) > > I've recently come to the opinion that that's a bad idea, and D should not support it. I've recently come to the opinion that you're wrong - using them is often wrong, but D should support them. Various good reasons have been posted in this thread. -- Simen |
May 28, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 2013-05-28 01:34:17 +0000, Walter Bright <newshound2@digitalmars.com> said: > On 5/27/2013 6:06 PM, H. S. Teoh wrote: >> I don't find this a compelling reason to allow full Unicode on >> identifiers, though. For one thing, somebody maintaining your code may >> not know how to type said identifier correctly. It can be very >> frustrating to have to keep copy-n-pasting identifiers just because they >> contain foreign letters you can't type. Not to mention sheer >> unreadability if the inventor's name is in Chinese, so the algorithm >> name is also in Chinese, and the person maintaining the code can't read >> Chinese. This will kill D code maintainability. > > +1 -1 What's even worse for code maintainability is code that does not do what it says. Disallowing non-ASCII charsets does not prevent people from writing foreign-language code. I've seen plenty of code in French in my life in languages with no Unicode support. I've also seen plenty of bad English in code. I'd rather see a correct French word as a variable or function name than an incorrect English one. Correctly naming things is difficult, and correctly naming them in a foreign language is even more. This surely apply to languages using non-ASCII alphabets too. Of course, if you're not using English words you'll be limiting audience to programmers who understand that language. But you might widen it in other directions. I worked once with a grad student who was building a model to simulate breakages of water pipe systems. She was good enough to write code that worked, although she needed my help for a couple of things, notably increasing performance. The code was all in French, and thankfully so as attempting to translate all those terms (some dealing with concepts unknown to me) to English when writing the code and back to French when explaining the concepts would have been quite annoying, inefficient, and error-prone in our work. While French likely will always be a possibility (as it fits well in ASCII), I can see how writing code in Japanese or Russian might benefit native speakers of those languages too, especially those for who programming is only an incidental part of their job. Programming is a form of expression, and it's always easier to express ourself in our own native language. -- Michel Fortin michel.fortin@michelf.ca http://michelf.ca/ |
May 28, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | On 28/05/13 19:12, Jacob Carlborg wrote:
> On 2013-05-28 08:00, Manu wrote:
>
>> Is there anywhere other than America that doesn't?
>
> Canada, Jamaica, other countries in that region?
>
Last time I looked Canada was in America (which is a continent not a country). :-)
Peter
|
May 28, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
On Wed, May 29, 2013 at 09:33:32AM +1000, Peter Williams wrote: > On 28/05/13 19:12, Jacob Carlborg wrote: > >On 2013-05-28 08:00, Manu wrote: > > > >>Is there anywhere other than America that doesn't? > > > >Canada, Jamaica, other countries in that region? > > > > Last time I looked Canada was in America (which is a continent not a > country). :-) [...] If you say that to a Canadian to his face, you might get a hostile (or faux-hostile) reaction. :) Up here in the Great White North, we like to think of ourselves as different from our rowdy neighbours to the south (even though we're not that different, but we won't ever admit that :-P). And yes, "America" means USA up here (and "American" especially means USian, as distinct from Canadian), even though we all know that technically it refers to the continent, not the country. T -- Computers aren't intelligent; they only think they are. |
May 29, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
On 29/05/13 09:57, H. S. Teoh wrote:
> On Wed, May 29, 2013 at 09:33:32AM +1000, Peter Williams wrote:
>> On 28/05/13 19:12, Jacob Carlborg wrote:
>>> On 2013-05-28 08:00, Manu wrote:
>>>
>>>> Is there anywhere other than America that doesn't?
>>>
>>> Canada, Jamaica, other countries in that region?
>>>
>>
>> Last time I looked Canada was in America (which is a continent not a
>> country). :-)
> [...]
>
> If you say that to a Canadian to his face, you might get a hostile (or
> faux-hostile) reaction. :)
>
> Up here in the Great White North, we like to think of ourselves as
> different from our rowdy neighbours to the south (even though we're not
> that different, but we won't ever admit that :-P). And yes, "America"
> means USA up here (and "American" especially means USian, as distinct
> from Canadian), even though we all know that technically it refers to
> the continent, not the country.
Last time I was there (about 40 years ago) Canadians didn't seem that touchy. :-)
Peter
|
May 29, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Peter Williams | On Tuesday, 28 May 2013 at 23:33:47 UTC, Peter Williams wrote:
> On 28/05/13 19:12, Jacob Carlborg wrote:
>> On 2013-05-28 08:00, Manu wrote:
>>
>>> Is there anywhere other than America that doesn't?
>>
>> Canada, Jamaica, other countries in that region?
>>
>
> Last time I looked Canada was in America (which is a continent not a country). :-)
>
> Peter
America isn't a continent, North America is a continent, and Canada is in North America :P
|
May 29, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
On Wed, May 29, 2013 at 10:36:08AM +1000, Peter Williams wrote: > On 29/05/13 09:57, H. S. Teoh wrote: > >On Wed, May 29, 2013 at 09:33:32AM +1000, Peter Williams wrote: > >>On 28/05/13 19:12, Jacob Carlborg wrote: > >>>On 2013-05-28 08:00, Manu wrote: > >>> > >>>>Is there anywhere other than America that doesn't? > >>> > >>>Canada, Jamaica, other countries in that region? > >>> > >> > >>Last time I looked Canada was in America (which is a continent not a > >>country). :-) > >[...] > > > >If you say that to a Canadian to his face, you might get a hostile > >(or faux-hostile) reaction. :) [...] > Last time I was there (about 40 years ago) Canadians didn't seem > that touchy. :-) [...] Well, they are not, hence "faux-hostile". :) T -- Political correctness: socially-sanctioned hypocrisy. |
May 29, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Diggory | On Wednesday, 29 May 2013 at 01:29:07 UTC, Diggory wrote: > On Tuesday, 28 May 2013 at 23:33:47 UTC, Peter Williams wrote: >> On 28/05/13 19:12, Jacob Carlborg wrote: >>> On 2013-05-28 08:00, Manu wrote: >>> >>>> Is there anywhere other than America that doesn't? >>> >>> Canada, Jamaica, other countries in that region? >>> >> >> Last time I looked Canada was in America (which is a continent not a country). :-) >> >> Peter > > America isn't a continent, North America is a continent, and Canada is in North America :P Well, that point of view really depends from which continent you're from: http://en.wikipedia.org/wiki/Continents#Number_of_continents There is no internationally agreed on scheme. I for one, have always been taught that there is only "America", and that the terms "North America" and "South America" where only meant to denote regions within said continent. |
May 29, 2013 Re: Why UTF-8/16 character encodings? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Monday, 27 May 2013 at 23:05:46 UTC, Walter Bright wrote:
> I've recently come to the opinion that that's a bad idea, and D should not support it.
Honestly, removing support for non-ASCII characters from identifiers is the worst idea you've had in a while. There is an _unfathomable amount_ of code out there written in non-English languages but hamfisted into an English-alphabet representation because the programming language doesn't care to support it. The resulting friction is considerable.
You seem to attribute particular value to personal anecdotes, so here's one of mine: I personally know several prestigious universities in Europe and Asia which teach programming using Java and/or C with identifiers being in an English-alphabet representation of the native non-English language. Using the English language for identifiers is usually a sanctioned alternative, but not the primary modus operandi. I also know several professional programmers using their native non-English language for identifiers in production code.
Please reconsider.
|
Copyright © 1999-2021 by the D Language Foundation