Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about input Japanese identifers when programming #2

Open
nobodxbodon opened this issue Feb 16, 2021 · 8 comments
Open

question about input Japanese identifers when programming #2

nobodxbodon opened this issue Feb 16, 2021 · 8 comments

Comments

@nobodxbodon
Copy link

Hi Mr. Hiroyuki, I'm a contributor of an VS Code extension that allows programmers to input Chinese identifiers without switching to Chinese input method. I've a related question as I found you were using Japanese identifers in sample codes for your book "初めてのJavaScript 第3版"。I should have opened this issue in ljs3 repo but I didn't find "issues" section there.

May I ask how you input Japanese identifers when programming? For example in your sample code below:
Screen Shot 2021-02-16 at 2 56 33 PM
When you input line 24, do you type in "if(" in English, and then switch to Japanese input method, input "今", and then select "今回の賭け金の合計" in the auto-completion popup?

I'm asking this to see if there's a need for a similar extension as we built for Chinese identifiers.

Thanks and looking forward.

@mushahiroyuki
Copy link
Owner

Hi!

When you input line 24, do you type in "if(" in English, and then switch to Japanese input method, input "今", and then select "今回の賭け金の合計" in the auto-completion popup?

Yes. I do switch to Japanese input method.

I rarely use VS code, so I do not know about auto-completion popup in VS code, however,
it seems that Japanese identifiers do not popup when I type in Japense in VS code.
So it might be helpful for Japanese users, too, if auto-completion popup appears when we use Japanese identifiers.

Hope it helps.

BTW, Hiroyuki is my first name... :-)

@nobodxbodon
Copy link
Author

Sorry! Mr. Musha. Thanks for the quick response.

Interestingly when I type "今" using Chinese input method, auto-completion does appear in my VS Code even without our extension, as you see in the screenshot. I'm not sure why it didn't work for you.

Our extension actually provides auto-completion of Chinese identifiers even if programmer types in Chinese pronunciation in English letters. Thus it saves user from some switching to Chinese input method.

Take your sample code above as example, if "今回の賭け金の合計" is spoken as "Konkai no kake-kin no gōkei" in Japanese, a Japanese version of our extension in my mind would provide auto-completion as below, when user types in "kon":

Screen Shot 2021-02-16 at 7 12 24 PM

As I haven't used Japanese input method before, I wonder if this looks right to you? Do you think this type of extension would be helpful?

BTW may I ask which IDE you use?

@mushahiroyuki
Copy link
Owner

Yes, this looks quite helpful. (Do you have Japanese pronunciation dictionary of some kind?)

One of the problems of using Japanvese identifiers is that programmers (especially novice ones)
often input Japanese space characters ("ZENKAKU" spaces) instead of ascii ("HANKAKU") spaces.
With the extension, they need not to change the input method, which would avoid inputing Japanese space charactars.

I use emacs (it is not IDE...).

@nobodxbodon
Copy link
Author

I haven't looked for Japanese pronunciation dictionary yet. For our extension, we used this API to get pronunciation for Chinese, which doesn't rely on any online web service. Do you know of similar JavaScript API for Japanese?

Actually this extension would save many input method switching but you may still need to use Japanese input method when you type in a new identifer the first time.

About the special characters like {}() and spaces, many Chinese input methods have an option "use English punctuations when typing Chinese", so this issue is not that troublesome when using Chinese identifiers when programming in English programming languages.

As I'm not familiar with Japanese language, do you know anyone that could be interested in working on such an extension together?

I saw you were giving JavaScript classes all along. May I ask if you use Japanese identifiers while teaching? And do students use emacs in the classes too?

@mushahiroyuki
Copy link
Owner

you may still need to use Japanese input method when you type in a new identifer the first time.

This is true, but "first time only" is far better.

do students use emacs in the classes too?

Never!!! They are beginners and I recommend VERY simple editors.

The API includes Japanese sound "kon" for "今," you mean... I see...
Then, it does not work every time for Japanese...
"今" can be pronounced as "ima" in Japanese, for example.

free (?) Japanese (pronunciation) dictionary might be available from the following site, I think.
http://www.freewnn.org

--
Sorry, I do not think I can help you on other points for now...

@nobodxbodon
Copy link
Author

Thanks a lot for sharing.

It's exciting to see more practice of naming identifiers in native language in Japan. We also see more such practice among Chinese developers. For example this similar plugin that assists Chinese identifier auto-completion for IntelliJ IDEs is getting close to 90K downloads.

@mushahiroyuki
Copy link
Owner

Especially for beginners, it is easier for them to program , if they can use native words for identifiers, I think.
Some of them are not good at English.

Good luck for your project!

@nobodxbodon
Copy link
Author

Interestingly quite some beginners have an impression that identifiers have to be written in English. Using sample codes with Japanese identifiers like your book definitely helps to correct that wrong impression. Hope to see more such programming books.

Good luck to your programming courses!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants