January 16, 2004
"Robert" <no@spam.ne.jp> wrote in message news:btttpv$n3j$1@digitaldaemon.com...
> Though normally the Japanese uses Shift-JIS character set in Windows and Macintosh, EUC-JP in Linux, Shift-JIS or EUC-JP in UNIX, and JIS in
E-mail,
> Windows XP's "notepad", "Hidemaru editor" (shareware), etc. support
unicode
> text.
>
> But why I (or we?) don't use Japanese for identifiers is not due to text
> editors.
> It's because it is trouble to input text that ASCII characters (keywords,
> operators, and English identifiers of libraries) and Japanese characters
are
> frequently mixed.
>
> In Japanese (and probably many other language not using alphabet) IME,
> there are two input modes.
> In one mode, one can input ASCII characters.
> In another mode, one can input Japanese characters.
> If now in Japanese mode, in order to input ASCII code one must switch the
> input mode or convert input characters to ASCII character.
> Of course, both ways can be done by pressing a key, but they hinders
smooth
> programming.
>
> So, I'm afraid that it's good enough that Japanese characters can be used
in
> comments or string/character literals.
> The Japanese are used to it.
> (But, Unicode identifiers are maybe useful for The French, German, etc.
> using only alphabet and a few accent or umlaut)
>
>
>
> Windows95/98/Me support only 'A' (local) APIs (e.g. CreateWindowExA),
don't
> support 'W' (Unicode) APIs (e.g. CreateWindowExW).
> In order to use 'CreateWindowEx' in Windows95/98/Me, we must use
Shift-JIS,
> not Unicode.
>
> So  for the international support, even if one must write the source codes itself only in Unicode, the program should handle MBCS (Multi-Byte
Character
> Set) IMO.
>
> For instance:
>
>     extern(Windows) {
>         // lchar denotes local character set
>         BOOL SetWindowTextA(HWND, lchar);
>         BOOL SetWindowTextW(HWND, wchar);
>     }
>     version(CharTrait_Local) {
>         alias lchar tchar;
>         alias SetWindowTextA SetWindowText;
>     } else version(CharTrait_Unicode) {
>         alias wchar tchar;
>         alias SetWindowTextW SetWindowText;
>     }
>
>     tchar[] text = "...Japanese...";
>     SetWindowText(wnd, text);
>
> "wcstombs/mbstowcs" C functions, "WideCharToMultiByte/MultiByteToWideChar" Windows APIs, or "iconv" library will help for you to impliment it.

I think I understand now.

> BTW, is it fixed? http://www.digitalmars.com/drn-bin/wwwnews?D/19978

Yes.


January 16, 2004
"davepermen" <davepermen_member@pathlink.com> wrote in message news:btutlc$2cvh$1@digitaldaemon.com...
> and the next.. what if linux would've been coded by the language of the developers? there we have finish, there we have french, there we have
japanese,
> there we have swiss-german, there we have klingon, there we have
raetoromantsch,
> there we have polish, etc..
>
> how about staying in english?

The need to support international characters in strings is clear, and in comments as well. For identifiers, it's arguable. But it's easy enough to make it work in D, and many people want it.


January 17, 2004
even for comments, i don't agree. we have a product at work on wich our company system bases on. and its been written in the netherlands. just guess how good we are at reading netherlandish comments in switzerland?!

espencially a word read like it would mean dismiss in german actually means accept. rather irritating:P

no. you should always code in english. its todays babilon-language. just as latin was a while ago.

In article <bu9lcu$1vps$1@digitaldaemon.com>, Walter says...
>
>
>"davepermen" <davepermen_member@pathlink.com> wrote in message news:btutlc$2cvh$1@digitaldaemon.com...
>> and the next.. what if linux would've been coded by the language of the developers? there we have finish, there we have french, there we have
>japanese,
>> there we have swiss-german, there we have klingon, there we have
>raetoromantsch,
>> there we have polish, etc..
>>
>> how about staying in english?
>
>The need to support international characters in strings is clear, and in comments as well. For identifiers, it's arguable. But it's easy enough to make it work in D, and many people want it.
>
>


January 17, 2004
I don't know if anyone's addressed the point yet, but I think it's important to note how well, and how easily, it is to provide user-defined casts in C++ that fit into the normal syntax. I recently had occasion to ask BS whether he'd anticipated that when he created the template syntax, and he observed that it might have crossed his mind ;)

We should have the same facility in D. Not being enough of a D templatist yet, I can't say exactly how it should look, but I think we would be foolish to not avail ourselves of the same power and expressiveness as C++ in this regard.

Walter, since you're the BS of D, do you have any thoughts on this?


"Matthias Becker" <Matthias_member@pathlink.com> wrote in message news:bu8g1u$1q3$1@digitaldaemon.com...
> This all hasn't changed my mind. The 'as' is still my favorit.
>
> String text = message as String;
>
> This looks very natural and intuitiv to me.
>
>


January 17, 2004
I don't agree.
Indeed, English comments may need in Europa.
But IMHO you'd better write it also in your own language,
especially for long comments.
Because at least the persons who use the language can read it
and they are easier to read it than English comments.
And more, some persons will write wrong English.
Wrong comments are very evil...
If they are written in two languages,
someone can check it.

And, should we use english for comments in private programming?
Should we use it when nobody else Japanese reads it.
I think It's nonsense.



"davepermen" <davepermen_member@pathlink.com> wrote in message news:bua0t9$2i5r$1@digitaldaemon.com...
> even for comments, i don't agree. we have a product at work on wich our
company
> system bases on. and its been written in the netherlands. just guess how
good we
> are at reading netherlandish comments in switzerland?!
>
> espencially a word read like it would mean dismiss in german actually
means
> accept. rather irritating:P
>
> no. you should always code in english. its todays babilon-language. just
as
> latin was a while ago.
>
> In article <bu9lcu$1vps$1@digitaldaemon.com>, Walter says...
> >
> >
> >"davepermen" <davepermen_member@pathlink.com> wrote in message news:btutlc$2cvh$1@digitaldaemon.com...
> >> and the next.. what if linux would've been coded by the language of the developers? there we have finish, there we have french, there we have
> >japanese,
> >> there we have swiss-german, there we have klingon, there we have
> >raetoromantsch,
> >> there we have polish, etc..
> >>
> >> how about staying in english?
> >
> >The need to support international characters in strings is clear, and in comments as well. For identifiers, it's arguable. But it's easy enough to make it work in D, and many people want it.
> >
> >
>
>

January 17, 2004
I'm in the Kernighan/Pike/Dewhurst/etc camp that say that comments are often unnecessary and are, by and large, misused.

Given that D supports DbC as a language feature, and that most people are happy writing auto-documentation in their code, is there much need for comments in the code itself?

I'd be interested in seeing some examples from you both, demonstrating your points of view.



"Robert" <no@spam.ne.jp> wrote in message news:buaq0f$s4l$1@digitaldaemon.com...
> I don't agree.
> Indeed, English comments may need in Europa.
> But IMHO you'd better write it also in your own language,
> especially for long comments.
> Because at least the persons who use the language can read it
> and they are easier to read it than English comments.
> And more, some persons will write wrong English.
> Wrong comments are very evil...
> If they are written in two languages,
> someone can check it.
>
> And, should we use english for comments in private programming?
> Should we use it when nobody else Japanese reads it.
> I think It's nonsense.
>
>
>
> "davepermen" <davepermen_member@pathlink.com> wrote in message news:bua0t9$2i5r$1@digitaldaemon.com...
> > even for comments, i don't agree. we have a product at work on wich our
> company
> > system bases on. and its been written in the netherlands. just guess how
> good we
> > are at reading netherlandish comments in switzerland?!
> >
> > espencially a word read like it would mean dismiss in german actually
> means
> > accept. rather irritating:P
> >
> > no. you should always code in english. its todays babilon-language. just
> as
> > latin was a while ago.
> >
> > In article <bu9lcu$1vps$1@digitaldaemon.com>, Walter says...
> > >
> > >
> > >"davepermen" <davepermen_member@pathlink.com> wrote in message news:btutlc$2cvh$1@digitaldaemon.com...
> > >> and the next.. what if linux would've been coded by the language of
the
> > >> developers? there we have finish, there we have french, there we have
> > >japanese,
> > >> there we have swiss-german, there we have klingon, there we have
> > >raetoromantsch,
> > >> there we have polish, etc..
> > >>
> > >> how about staying in english?
> > >
> > >The need to support international characters in strings is clear, and
in
> > >comments as well. For identifiers, it's arguable. But it's easy enough
to
> > >make it work in D, and many people want it.
> > >
> > >
> >
> >
>


January 18, 2004
as matthew stated, too, there isn't much need in real comments.

and yes, i code 100% in english. and english is my 4th language actually.

even at home, private stuff.

coding should be in a language about everyone understands. about everyone capable of coding understands english.

what if i'd ask you to send me some of your private code.. say you have a function i'd like to use. you send it to me, and it's in japanese. then i realise, i should modify it a bit. will get rather difficult.

no. you should code in english. and you should never comment except if it's needed. wich is about never :P

In article <buaq0f$s4l$1@digitaldaemon.com>, Robert says...
>
>I don't agree.
>Indeed, English comments may need in Europa.
>But IMHO you'd better write it also in your own language,
>especially for long comments.
>Because at least the persons who use the language can read it
>and they are easier to read it than English comments.
>And more, some persons will write wrong English.
>Wrong comments are very evil...
>If they are written in two languages,
>someone can check it.
>
>And, should we use english for comments in private programming?
>Should we use it when nobody else Japanese reads it.
>I think It's nonsense.
>
>
>
>"davepermen" <davepermen_member@pathlink.com> wrote in message news:bua0t9$2i5r$1@digitaldaemon.com...
>> even for comments, i don't agree. we have a product at work on wich our
>company
>> system bases on. and its been written in the netherlands. just guess how
>good we
>> are at reading netherlandish comments in switzerland?!
>>
>> espencially a word read like it would mean dismiss in german actually
>means
>> accept. rather irritating:P
>>
>> no. you should always code in english. its todays babilon-language. just
>as
>> latin was a while ago.
>>
>> In article <bu9lcu$1vps$1@digitaldaemon.com>, Walter says...
>> >
>> >
>> >"davepermen" <davepermen_member@pathlink.com> wrote in message news:btutlc$2cvh$1@digitaldaemon.com...
>> >> and the next.. what if linux would've been coded by the language of the developers? there we have finish, there we have french, there we have
>> >japanese,
>> >> there we have swiss-german, there we have klingon, there we have
>> >raetoromantsch,
>> >> there we have polish, etc..
>> >>
>> >> how about staying in english?
>> >
>> >The need to support international characters in strings is clear, and in comments as well. For identifiers, it's arguable. But it's easy enough to make it work in D, and many people want it.
>> >
>> >
>>
>>
>


January 18, 2004
davepermen wrote:

>as matthew stated, too, there isn't much need in real comments.
>
>and yes, i code 100% in english. and english is my 4th language actually.
>
>even at home, private stuff.
>
>coding should be in a language about everyone understands. about everyone
>capable of coding understands english.
>
>what if i'd ask you to send me some of your private code.. say you have a
>function i'd like to use. you send it to me, and it's in japanese. then i
>realise, i should modify it a bit. will get rather difficult.
>
>no. you should code in english. and you should never comment except if it's
>needed. wich is about never :P
>
>  
>

>no. you should code in english. 


Here's a rant about this issue.
http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=16664


I disagree, that's like saying everybody should speak English.  You need to be able to code in a way that has meaning to yourself.  If your coding for the main stream, then of course make the visible interface English but the inner-workings, variable names ect... use what every makes the most sense to you and your team (and potential maintainers)..

-Anderson

January 18, 2004
In article <budqgj$2oei$1@digitaldaemon.com>, davepermen says...

>coding should be in a language about everyone understands. about everyone capable of coding understands english.
>
>what if i'd ask you to send me some of your private code.. say you have a function i'd like to use. you send it to me, and it's in japanese. then i realise, i should modify it a bit. will get rather difficult.
>
>no. you should code in english. and you should never comment except if it's needed. wich is about never :P

If comments are unnecessary for you, you could simply ignore the japanese comments (or strip them) and read only the code... Everyone is happy. I don't think the compiler should check for invalid characters in comments (same for strings). What if I want to put a class diagrams in a comment... (cool idea for an advanced IDE)


January 18, 2004
qw wrote:

>What if I want to put a class diagrams in a comment... (cool idea for
>an advanced IDE)
>  
>

Yeah, I can't wait to to HTML documents come part of the D IDE's