Mandarin and Japanese speaking people who can code, also read and understand the Latin alphabet. Much coding is mathematical too, and mathematics symbols and expressions are universally understaood worldwide, even among non-coders. Most languages have a small vocabulary of reserved words for flow control that are easy to learn. The rest is just syntax, which is analogous to punctuation.
Even in countries using the Latin alphabet or Cyrillic alphabet, they still use their own language for variable names, function names, class names, comments, etc.
At the end of the day, it boils down to learning the keywords in English. There’s no two ways about it. Now luckily, English is commonly taught at least at a basic level in Asia for a foreign language class in elementary through middle schools. Enough where letters and words can be sounded out.
On top of that, much of coding doesn’t require language skills or understanding in the first place. You don’t need to know what the word for or while or catch actually means in English to know the logic. It helps for sure, but you can certainly skip the meaning of the word and go right to the part where the following clause specifies the number of times to repeat a step y’know?
And lastly, comment blocks can be written in their native language. Ive read through code written by a Korean programmer and the strings and sections were still written in Korean symbols while the logic was English keywords
There are keywords in the language that must be in English. However, variables, function names, etc, they don’t.
I previously worked somewhere where I worked with our Chinese team a lot. I would see their code and couldn’t understand a lot of it because the variables names were all in Chinese. Or if they were in English, it would be acronyms of the first pinyin character for the Chinese characters. Like home phone number would be written as “JTDHHM” for “jiā tíng diàn huà hào mǎ”
I mean, I also worked with our Brazilian team, and it would be similar with the variables named Portuguese things.
It depends on the computer language you are using. For example any language that supports unicode (like Java, C#, Ruby, etc.) you can create variables that are written in Chinese, Japanese, Arabic, etc. characters if you want. The compiler doesn’t care if you name something dog or 犬 or いぬ or even 🐕. As long as it doesn’t use a reserved character in the language it’s fair game. However its generally discouraged for code that might be used outside a given country/region as it limits the readability of code.
Plus the computer itself doesn’t care, whatever language the variables or function names are written in gets stripped away by the compiler and then further obfuscated when it gets converted into lower level code. Variable and function naming is entirely for the benefit of humans who read and write code.
You’re conflating cipher and code.
The most basic ciphers in the latin alphabet don’t make sense in an entirely symbolic language that lacks a basic alphabet. However, mandarin and japanese have alphabets.
Perhaps another way of looking at it – both English and French use the same alphabet, more or less. If I wrote this text in French, you’d likely need to decode it to understand it. This is despite not using any kind of cipher to obscure which characters are which.
With Engrish. /s
Seriously speaking, sometimes you might see pinyin / romaji in function naming but most of the time variable and function are kept in simple and perhaps slightly odd English. Comments are mostly in Japanese or Chinese unless the team have enough SEA/Indian/Western population. Programmers normally have a basic understanding of English and you just need the keywords anyway.
Source: worked with mainland Chinese codebase before, currently working in a Japanese company. Documentation-wise we use both English and Japanese and we depends on machine translation tools for people who cannot read both.
Latest Answers