Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is the code written in Japanese? Are filenames in English? What about like a C preprocessor? Is that still in English? Are comments in Japanese?

Examples would be nice too.

share|improve this question

closed as not constructive by Mason Wheeler, ChaosPandion, ChrisF Feb 10 '11 at 22:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

5  
Just like programming in spanish/portuguese/whatever, code should always be written in english. –  user1827 Feb 10 '11 at 19:39
    
@M28 It's a bit different though when you have to use a foreign alphabet. Try to write a simple hello world app using the Greek alphabet for all the keywords. –  biziclop Feb 10 '11 at 19:42
2  
@M28: Just out of curiosity: are there any programming languages that have been designed for characters outside the latin alphabet? And if compilers allow for encodings other than ASCII, I guess even Java could be written with all symbols in Japanese, except for language keywords... –  FrustratedWithFormsDesigner Feb 10 '11 at 19:43
1  
@Frustrated: Whitespace comes to mind. –  Josh K Feb 10 '11 at 19:44
3  
@Frustrated: Wikipedia knows everything. –  delnan Feb 10 '11 at 19:46
show 9 more comments

2 Answers

As someone who has programmed in Japan. I can honestly say that I have seen code in all forms. Most of the cleaner code that I have seen that was intended to be supported only by Japanese programmers had all of the comments and documentation in Japanese.

As for some of the horrendous code that I have seen, I remember seeing Java and (I believe) VB code that actually used kanji or katakana for variable names.

That aside, code tends to look like this

/**
 * これはクラスのコメント
 */
public class FooClass implements Fooable {

    /**
     * オブジェクトのインスタンスを作成する
     */
    public FooClass() {

    }

    ...
}

As for a C preprocessor, I have no idea.

share|improve this answer
    
A preprocessor could be used to translate language keywords to other languages. –  FrustratedWithFormsDesigner Feb 10 '11 at 19:55
2  
So is "Foo" an actual English word like "BankClass" or or is romanized? –  Zeno Feb 10 '11 at 20:02
    
Like, would they call FooClass BankClass or GinkouKurasu? –  Panzercrisis Feb 24 at 18:55
add comment

In practice, most programming languages in active use outside of the US use keywords that resemble English, but it's important to realize that for the most part those of us who write code as native English speakers aren't really writing in "English", either.

There are a few dozen languages that actually support non-ASCII-range keywords and these are often designed to reduce the cognitive friction for non-English speakers trying to learn programming.

Additionally, some older implementations of languages that translate code into tokens (not true compiling), can spit out the same code in an editor using the, say, German equivalent

Many English-like programming languages, including C#, Java, and others, now allow variable names and method names in Japanese, as long as the source code is encoded in UTF-8 or another suitable encoding. It wasn't common to have even comments in Japanese in C, however, unless you were using a compiler that supported Shift-JIS or Unicode. String literals in C were almost always escaped using the literal encoding method unless you had an external resource file format to work with, as in Visual Studio.

In practice, many programs written by Japanese teams that don't expect to require maintenance outside of Japan are written with comments or javadoc/docstrings/etc. in Japanese. My wife generally writes code with a sort of Japanese-like English, using terms that didn't necessarily match my own use or understanding of English ("regist" for "post" or "story", regist_date for publication date), and occasional comments in Japanese or Janglish.

Most programs that have an international community around them, that originate in Japan, use some form of English naming convention. See, for example, Matz' source code for ruby.

share|improve this answer
    
What if the project doesn't know if they're going to release the source outside Japan? Like a video game developed in Japan. They sometimes don't know if an English publisher will want to release the game say in the US. –  Zeno Feb 10 '11 at 20:13
    
@Zeno - That's internationalizing character strings the user will see. That's important to do even if the code is by and for English-speakers. Comments & variable names & internal language aren't really correlated unless the code is going to be released as an API. –  Greg Feb 10 '11 at 20:21
    
Not really, often times video games published outside Japan will include more features so the code is directly changed too. Like Final Fantasy VII included new bosses (Ruby WEAPON) in the US version but not the Japanese version. –  Zeno Feb 10 '11 at 20:33
    
Are those new features language-dependent? What's the difference versus just marketing a different feature-set in Tokyo than in Nagoya? –  Greg Feb 10 '11 at 21:12
    
Like in the US, people sometimes make assumptions that their app will never be used outside of their country, and that sometimes results in code changes being necessary to release for other markets. But comments rarely need to be rewritten for localization processes if modern approaches to internationalization are used, because code is not generally touched by localizers. –  JasonTrue Feb 10 '11 at 21:35
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.