How do people from non-English speaking countries write code?

936 viewsOtherTechnology

Especially in Mandarin & Japanese speaking countries – for example: how does variable & function naming work if the language primarily consists of symbolic characters?

In: Technology

27 Answers

Anonymous 0 Comments

Most big languages let you write in other languages and it just works as aliases to the “real” commands. But also like 90% of the time people just program in roman characters and just kinda don’t care. You basically have to memorize the keywords anyway either way.

Anonymous 0 Comments

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.

Anonymous 0 Comments

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

Anonymous 0 Comments

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.

Anonymous 0 Comments

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.

Anonymous 0 Comments

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. 

Anonymous 0 Comments

Saw some coding in Chinese. They had a latin-ish keyboard, and would type in the English word (for example, “zhang”) and a little box would pop up with some Chinese options, and they would select the 张 from among the other options with the same English spelling.

Anonymous 0 Comments

I’m Brazillian and some use a mashup of portuguese and english, other use full english. It’s language dependent too, but variables,function, class, comments, and everything that is not hardcoded syntax are written in BR most of the time.

Anonymous 0 Comments

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.

Anonymous 0 Comments

I work for a Japanese company. We code in English, but the Japanese coders write comments in Japanese.

Also, we get some fun “Engrish” now and then, and we have to dutifully use the slightly-mispelled word for the rest of the project.