The same applies to English code, such as “you can’t tell the type from the naming “,” naming may not make sense “and so on. There are also unverified” unknown error caused by Chinese code “and unfounded” slower than English code “and so on.

It is no good

A: As discussed in the previous article resonance 13 years later – Advantages and Problems of Chinese naming in code, Chinese naming is often more accurate and easier than English naming. If you think the API and internal method/variable names don’t matter. There are many articles on Readability that address this myth, such as Writing for Readability

The improved code clarity and maintainability of native naming is also illustrated by Python3’s choice to support non-ASCII identifiers.

It is not conducive for non-Chinese programmers to contribute

A: As it stands, the vast majority of contributors to open source libraries/frameworks created by Chinese developers are Also Chinese developers, even for very popular and international frameworks like Vuejs. The reasons must be manifold. Can think of:

  • Foreign open source projects with similar functions. As a foreign programmer the first choice to participate is definitely those
  • If the library is related to Chinese itself, such as stutter participle, the main users are Also Chinese developers, naturally maintenance is also

Personally, I don’t agree with 100% Chinese culture. There are definitely projects that need exchange with foreign countries. Let’s make a bold assumption: of all Chinese native speakers working on projects,90% are solo (*), and of the remaining 10%,90% have only Chinese native speakers working on them. As a result, only 1% of projects have a rigid need to write code in English. For the 1%, using English for the other 99% is not worth the cost.

Note: According to Fun with GitHub Repositories Statistics, the 1-Contributor Repository on GitHub is approximately 60%. Of course, there are many projects that are not open source. Ninety percent of the above is still hypothetical.

Of course we hope to see more foreign developers participating in Chinese start-up projects. However, apart from the prediction of whether there will be foreign developers to participate in the remaining self-initiated projects, the primary consideration is the most beneficial to their own development and maintenance of programming. Because FOR the foreseeable future, I will be the main contributor myself. If my own development and maintenance costs become unsustainable as the project gets bigger, it may die before it takes shape and can attract other developers. My personal feeling is that naming in Chinese is a more familiar and easier way for me.

Some of the most popular open source frameworks on the OSC, such as JFinal, have very few other developers contributing. Personally, one of the most important reasons is the difficulty of reading the code, and English naming is an additional barrier. Perhaps for the developers themselves, as the project develops, some of the English naming is awkward at the beginning, but for the new developers who have just received the whole code, any improper English naming will lead to confusion and waste of time. In order to attract theoretical foreign developers to participate, rather than prioritizing the programming method that is beneficial to Chinese developers around (including myself) to read the code, I think this idea is worth discussing and discussing separately.

Linus, a Finnish, writes Linux code in English instead of his native language

A: Linus is a native Swedish speaker, with 870 million users according to Wiki. The number of native speakers of Chinese (Mandarin) is 950 million. That’s a hundredfold difference. In addition, English is spoken by 306 million native speakers. What’s more, native Speakers of Chinese are mostly concentrated in China, while English is distributed in different countries. Spanish is similar. From a demographic perspective, programming in Chinese has great potential.

A Chinese note is enough

A: With regard to comments and naming, one’s first exposure to formal readability reviews is in one’s previous work environment. One impression is that auditors tend to minimize the amount of comments and emphasize the readability of the code itself (one of the most important factors is naming). Comments like “This method name is self-explaining now, annotations won’t” will occasionally appear in the audit. Although not confirmed in person, the extra work involved in writing and maintaining comments is probably one of the motivations.

Most apis, including the standard library, are in English

A: Yes, but your own classes/methods/variables usually take up no less space in your code than methods/classes that depend on libraries (including the standard library). You are welcome to provide specific statistics. Take a look at the ratio of English and Chinese code sizes here. The code changes brought about by Chinese naming are obvious. More critically, the custom parts are often the most focused and readable parts of the business logic.

If the keywords are still in English, there is no point in naming them in Chinese

A: The benefits of naming in Chinese are regardless of the programming language, and even the significant difference between English keywords and Chinese may provide additional readability. In addition, at least in the short term (5-10 years), the English keyword programming language will still occupy a significant share of the market, in this stage using Chinese naming is a small cost and relatively immediate benefits.

The programming language itself has nothing to do with English grammar

A: There are still a lot of designs with a lot of English style, although it is far from the natural language of English. For example, space as separator; for… The original meaning of “for” does not have A circular meaning, but is closer to “for”, which is more obvious in the grammar of “for (A in B)”, which corresponds to the Chinese approach to “for those A in B”. While also has no original meaning of ‘loop’. Chinese is closer to ‘as long as’ or’ when ‘. This illustrates the relevance of English programming language design to English grammar and lexical meaning. Developers who don’t speak English will have to memorize these keywords when they learn them (which isn’t a big deal), but assuming they’re in Chinese from the start will make it easier to understand and save a step in memorizing them.

Chinese input is too slow, which reduces the development efficiency

A: First of all, if you consider the naming time, for native Chinese programmers, Chinese naming should be more appropriate and faster than it is possible. Second, since the development process is only a small part of the overall software life cycle, the benefits of good readability for the rest of the software (design, debugging, testing, maintenance) far outweigh any potential loss of development efficiency. To avoid frequent switching between Chinese and English: in order to input Chinese without switching at the same time can input special symbols (){}; Wait, sogou input method supports “Use English punctuation in Chinese”

There will be a variety of Chinese character coding problems resulting in garbled characters

A: The problem of Chinese character coding is not limited to code, and the less you use it, the less likely it is to solve the problem. Most problems can be avoided by making encodings consistent, and UTF8 and GBK interconversion problems (instances) may persist for a long time. Naming them in Chinese can make these problems more prominent and facilitate their solution, rather than delay their avoidance.

Reading too many Chinese programs will affect English learning, as well as programmers’ future

A: Just like I have to read English journals when I need to do academic work, and I will read foreign websites when I have a rigid need. If that’s going to affect it, then maybe it’s not needed.

The problem of mixing Chinese and English

For example, there is an unavoidable problem in Java that the JavaBeans specification must use set/ GET for naming. Maven version number -snapshot special semantics, old junit to test methods must start with test, etc

A: It is true that in practice, people use as much Chinese as they can. For example, I think it is acceptable to use set/get mixed with Chinese. If you want to write Chinese code in Java, you can’t avoid mixing Chinese and English.

Beyond what is listed above, the significance of developing Chinese programming: Democratizing programming to help build the software industry also answers some doubts

Without precedent

A: This 2017 Quora answer (Alan Mellor’s Answer to Has any serious project been written in a non-English-based programming language?) Mentioned that Siemens (Germany)/ Ericsson (Sweden) has C/C++ projects named in their mother tongue as much as possible. And sample code in a programming book Bragg saw was also named in his native language.

There are also many open source projects. This is a natural language processing tool developed by a Taiwanese developer in Python: The Taiwan Speech Tool project was formed in 2013, with tens of thousands of lines of code visually.

Initial efforts to add Unicode support to programming languages should also be driven by developers from non-Native English speaking countries.

The 2018-07-18 update

Chinese is more difficult to understand than English

A: Suppose, for example, that the Chinese were the first to develop computers and design programming languages, would the various programming languages use Chinese characters? The problem is that Chinese is, by all accounts, the mother tongue of the Chinese, and the advantages of mother tongue have been illustrated by the previous section on “No advantages”. At the very least, even if this proposition is true, it can only be used to show that Chinese people’s use of Chinese as their mother tongue leads to poor comprehension efficiency. It does not mean that Chinese naming is not suitable for Chinese people.

The 2018-07-22 update

“We’re programming in C++, Java, Python, not English.”

A: It’s a very common saying, like here. Previous sections on “No benefit” and “Programming languages themselves have nothing to do with English syntax” have shown the direct relationship between naming and programming language syntax and natural language. If that’s not enough, maybe look at a foreign non-native English developer. “I’ve always programmed in English.” And he mentioned that programming languages are based in English. Here’s an excerpt:

Question: What language did you use in comments to Linux while you were a student? Torvalds: English. I’ve always programmed in English. All the books were in English, and the programming-languages tend to be somewhat English-based too (i.e. “while (x) { … } “).