日本語のC++ (Japanese Language C++)

I came across something that I thought was cool, though not something I would ever use. It was a set of C++ defines for Japanese language coders that let’s them write in C++ using Japanese words in the place of various C++ control statements and key words. The repository for this project can be found at https://gist.github.com/HerringtonDarkholme/2dbb2a1ec748a786f54908320447b3dd. Here are a few lines from the code.

#define  エスティーディー std
#define アイオーストリーム <iostream>
#define  ユージング using
#define イフ if
#define インクルード #include
#define イント int

You can probably guess what is going on here, but I will explain. The Japanese characters here are Katakana. They are commonly used to phonetically spelling out words from other languages. The very first define here is kind of clumsy. It spells out how we would say std. As in ess-tee-dee. The rest of the defines spell out the English pronunciations of the words. I found out about this by way of the following tweet, which showed some C++ written using a substantial amount of Japanese.

While it looks cool, I have a preference of minimizing my use of defines in my C++ code. But I’m also not a native 日本語 speaker. I imagine this provides some advantages for someone that is.


Posts may contain products with affiliate links. When you make purchases using these links, we receive a small commission at no extra cost to you. Thank you for your support.

Mastodon: @j2inet@masto.ai
Instagram: @j2inet
Facebook: @j2inet
YouTube: @j2inet
Telegram: j2inet
Twitter: @j2inet

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.