Answers.Body: <p>You didn't mention what programming language(s) you're working with, but the way <a href="https://en.wikipedia.org/wiki/PowerShell" rel="nofollow noreferrer">PowerShell</a> names things might be helpful here.</p>
  <p>Functions have names like <a href="https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Get-Process" rel="nofollow noreferrer"><code>Get-Process</code></a>, <a href="https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/clear-itemproperty" rel="nofollow noreferrer"><code>Clear-ItemProperty</code></a>, <a href="https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Get-Process" rel="nofollow noreferrer"><code>Write-Host</code></a>, etc.  They're all of the form &quot;verb dash noun&quot;.  There's a predefined <a href="https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands" rel="nofollow noreferrer">list of verbs</a> that they encourage you to use whenever possible.  When naming function parameters, they have predefined <a href="https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/standard-cmdlet-parameter-names-and-types" rel="nofollow noreferrer">lists of common parameter names</a> along with their standard meaning.</p>
  <p>PowerShell does this for the sake of consistency, but an approach like this could help a non-native speaker as well.  Those lists of words can be augmented with a description in their native language.  Naming something consists of selecting the relevant noun and verb from the list (substituting a native language word when needed).  Over time, the students will learn the vocabulary and not need the lists any more. Since they're using the same standard words as the built-in system functions, they're also learning how to interpret those functions without needing to look up and translate their documentation.</p>
  <p>I'm not necessarily saying that you should teach them using PowerShell (that sounds quite awful, actually).  You can follow a similar idea and create a naming convention for whatever language you're using.  You'll have to build your own noun/verb lists, but you'll have the opportunity to fine-tune them based on your specific curriculum and assignments.</p>
  <p>Standard library functions frequently have cryptic names, but you can create a helper header/library that provides wrappers around the relevant functions using the common naming convention. My CS teacher actually did that for us even though there wasn't a language issue. It helped focus on <em>concepts</em> instead of a specific language's library syntax, simplified many interfaces, and gave the instructor a place to inject helper code that made grading easier or that simulated errors.</p>
  <p>You can strip back the layers in a more advanced course, after they're comfortable with the fundamentals.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T02:11:29.363Z
Answers.Text: Thanks for the information. I think I will try that. BTW, it also reminds me of my Objective-C days. Apple has some guidelines for naming  https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T03:55:23.567Z
Answers.Text: This [comment](https://cseducators.stackexchange.com/questions/7757/non-native-english-speakers-struggle-to-come-up-with-decent-variable-names-and-f#comment21210_7758) above is worth noting
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T18:34:34.787Z
Answers.Text: (Many of the common PowerShell cmdlets [also have aliases](https://pvm-professionalengineering.blogspot.com/2019/10/powershell-aliases-and-missing.html), e.g., `ps` for [Get-Process](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Get-Process) (like on Linux/Unix))
Answers.UserDisplayName: Peter Mortensen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T16:55:08.977Z
Answers.LastActivityDate: 2023-06-02T01:11:25.500Z
Answers.LastEditDate: 2023-06-02T01:11:25.500Z
Answers.UserDisplayName: bta
Answers.Body: <h1>Some simple rules.</h1>
  <ul>
  <li>Design the code to be readable
  <ul>
  <li>Use the language of the domain: use the business language and natural language of the project. Most languages support unicode. e.g. <code>火出口</code> (it says fire exit in very bad Chinese: literally file exile mouth).</li>
  <li>When naming things consider how they are used, over what they do: Consider what how they will look when used: e.g. <code>if cat.height &gt; 3*meters then direction.set(away from cat), run(fast)</code></li>
  </ul>
  </li>
  </ul>
  <p>To help with this:</p>
  <ul>
  <li>Actions should have verb-phrases for names. e.g. <code>run</code>, <code>stop</code>, <code>open</code>.</li>
  <li>Booleans, and functions returning a boolean should have an adjective-phrase. e.g. <code>is running</code>, <code>is open</code>.</li>
  <li>Non boolean objects, and functions returning such, should have noun-phrase names. e.g. <code>cat</code>, <code>door</code>, <code>big cat</code>.</li>
  <li>Sometimes you will need enumerations to pass in to a procedure, these will often be adverbs. e.g. <code>quickly</code>.</li>
  </ul>
  <p>Most of this is general advice. However back to the non-English and English speaker. So if they can type their native language, then do that. I cannot think of a language that does not support Unicode names. E.g. these do support it: <code>C</code>, <code>python</code>, <code>rust</code>, <a href="https://scratch.mit.edu/" rel="nofollow noreferrer"><code>scratch</code></a>, …</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T18:32:16.863Z
Answers.LastActivityDate: 2023-06-03T17:43:39.950Z
Answers.LastEditDate: 2023-06-03T17:43:39.950Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>As others say, good naming is hard even for native English speakers.</p>
  <p>I don't think there is a straightforward curriculum to follow that makes one good at naming, or a simple criteria against which to measure success.</p>
  <p>At the stage of learning programming, when there is still plenty to learn, it might not be important for chosen names to always be great names.</p>
  <p>However, I would suggest having regular discussion about the importance of naming, and have examples of good naming schemes for pupils to consider and absorb.</p>
  <p>A pre-requisite for naming in English is to be deeply familiar with English. Exposure to a large amount of vocabulary, and examples of existing software naming schemes are also useful.</p>
  <p>To become skilled at naming, a person generally has to be interested in language, to some degree for its own sake.</p>
  <p>Some others here have also said names don't matter too much in programming. That can be true in limited cases, but as a general statement nothing could be more preposterously false.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T04:50:02.290Z
Answers.Text: Good points! As to importance of naming: Naming is about *best-practice.* Beginning students have a hard time knowing that `else` goes with `if` not `while` (unless you're in Python!), that conditions must be parenthesized (C family) or terminated by ':' (Python).  Zillions of such minor points that experienced programmers have struggled understood internalized *and forgotten the struggle*.
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T04:50:12.717Z
Answers.Text: In that context a foreign unfamiliar language is a heavy gratuitous burden. In short: naming is fundamental to *software engineering.* But theres a big gap noob-programming↠ SE. See my [pianist-analogy](https://cseducators.stackexchange.com/a/6164/8837)
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T08:14:45.170Z
Answers.Text: @Rusi, the "while-else" is an exemplar of dreadful English naming! But yes, even with English itself, there is a process of schooling in which children learn alphabetic symbols and punctuation and all the rest of it. Meanwhile, vocabulary and word choice is largely learned from everyday listening and reading.
Answers.UserDisplayName: Steve
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T10:47:00.317Z
Answers.LastActivityDate: 2023-05-31T10:47:00.317Z
Answers.UserDisplayName: Steve
Answers.Body: <p>The point of good variable/function/class naming is to express problem semantics to readers, including the programmers. If your readers are primarily French speakers, use good French naming for everything.</p>
  <p>Unfortunately, most programming environments don't support Chinese and Japanese (or Navajo or ...) characters directly, or it would be proper to use those. But students should be encouraged to find names in their own language that correctly represent the intent of the program item and then, if the programming system won't directly support it and will only accept, say, Latin style alphabets, then a system like pinyin should be fine.</p>
  <p>I'm assuming, however, that a reader, reading pinyin will associate the word(s) with the right concept and that the translation doesn't lose too much actual meaning.</p>
  <p>Maybe the problem is yours if you aren't a native (-ish) Chinese speaker. But I shouldn't have to use French words unless I were writing for a French speaking audience.</p>
  <hr />
  <p>Caveat: If a language can be written with unicode characters then large subsets of Chinese and Japanese and some others can be directly used. Java is an example. IIRC, though, keyboard entry is complicated.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-29T17:39:38.377Z
Answers.Text: Contrary to the practiced opinion of native English-speaking programmers, English is _not_ the language of programming. Allow, even encourage, the students to use the pinyin-ised names for what things are, or do in the language of the programmer. It would do my heart much good to have all our "languages" localised as well. I'd love to see a yóuyú or zeon loop in some clean code.
Answers.UserDisplayName: Gypsy Spellweaver
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T16:38:11.310Z
Answers.Text: Speaking of French, that reminds me of a project ([Framadate](https://framadate.org/abc/en/)) that was abandoned. Much of the source code is written in French. That makes it almost impossible to find a maintainer now. (-- While looking at the homepage again, it seems they changed their licensing and are trying to find some funding for it to continue development)
Answers.UserDisplayName: Thomas Weller
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T18:17:57.540Z
Answers.Text: While I, as a German software developer who's been in the industry for 40 years, strongly disagree with using anything but English in "real" code, I think there is a difference between learners and professionals. Learning to find good variable/method names is much more important than learning to find English names, and switching from good Chinese to good English is much easier than switching from bad names to good names. Don't rate them on their English skills, only check if the name they come up with is a good description of what the thing is used for.
Answers.UserDisplayName: Guntram Blohm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T06:53:17.163Z
Answers.Text: @GuntramBlohm In my company we deliberately use German names for variables and functions in our code. A precondition is that the code will only ever be read by German speakers but if that is satisfied this approach has the advantage that one can immediately distinguish which functions are internal to our code and which come from some external library or similar source.
Answers.UserDisplayName: quarague
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T17:31:39.710Z
Answers.Text: @quarague As my employer realizes quite painfully, predictions are difficult, especially when they concern the future ;-). If your code base lives longer than a handful of years, chances are it will be maintained by people who don't speak German at all but read English well enough to understand English code. Note that this may well happen on German soil (as if that had any relevance these days, but still). Your company is myopic.
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T18:33:04.360Z
Answers.Text: Since this is the most upvoted answer its good you've added the caveat at end. A comprehensive conspective lineup of Unicode vars in languages is [here](https://rosettacode.org/wiki/Unicode_variable_names).  Right here [my answer](https://cseducators.stackexchange.com/a/7779/8837) gives examples of Python and C and a smattering of Haskell.
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T00:35:14.900Z
Answers.Text: I was told twice quite strongly to write comments, variable names, function names in German, and each time I ended up translating everything into English.
Answers.UserDisplayName: gnasher729
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T01:29:47.243Z
Answers.Text: @gnasher729 That's just the nature of the risk and reward involved. Cater to your local language skills or get access to significantly larger pool of English resources.
Answers.UserDisplayName: Nelson
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T03:54:16.210Z
Answers.Text: @GuntramBlohm excellent distinction! I've referred to it in a couple of comments below/elsewhere. Ppl unable to get your point are not teachers, almost certainly not *experienced* teachers. When one has taught for decades (and are generally regarded as a good teacher) one knows willynilly how many students have fallen through the cracks because of sundry neglected reasons.
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T06:14:01.910Z
Answers.Text: @Peter-ReinstateMonica Of course no one can make perfect predictions of the future and you have to balance the possible advantages and disadvantages of either approach. But precisely because of that calling a company myopic without knowing any context about what they do is unnecessarily harsh and I'm quite confident wrong in my specific case (there are legal reasons the code will only ever be used in a German context and knowing German is required to understand what the code is used for).
Answers.UserDisplayName: quarague
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T08:52:15.850Z
Answers.Text: @quarague Yes, it was harsh, but warranted based on the available information. Legal reasons the code will only ever not only be used in a "German context" but also by German speakers (which is not the same) are exceedingly rare. In that case the company may not be overly myopic (although the legal frame may shift to a European level in our lifetime, conceivably).
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T08:56:05.643Z
Answers.Text: @quarague I'll give a contrasting example: A German company produces trains with German workers in Germany for DB following German regulations. They are audited by TÜV and Eisenbahnbundesamt. 20 or 30 years later they are producing trains for a world market following European regulations with an internationally distributed team, and parts of the code base and documentation are in German. Perhaps not such a big deal in the great scheme of things, but: The default should *always* be English unless legal requirements forbid it ;-).
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T21:39:55.943Z
Answers.Text: I don't think that it's correct to say "Unfortunately, most programming environments don't support Chinese and Japanese (or Navajo or ...) characters directly", as right now almost all programming environments *do* allow identifiers in non-Latin Unicode alphabets, as modern compilers and editors support this even for older languages like C, C++, Perl, Prolog; and of course languages like  JavaScript, Python, Go, Java, Ruby, etc have supported that for ages or even from day 1. So if you choose (for whatever reason) to use non-Latin identifiers, the tools will allow you to do that.
Answers.UserDisplayName: Peteris
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T23:57:51.353Z
Answers.Text: I've written code with identifiers in Esperanto in PHP as well as Java 15 years ago. Worked fine back then. (Looks a bit strange, as all the standard library functions and keywords are in English.)
Answers.UserDisplayName: Paŭlo Ebermann
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-29T15:45:36.653Z
Answers.LastActivityDate: 2023-05-31T17:26:28.507Z
Answers.LastEditDate: 2023-05-31T17:26:28.507Z
Answers.UserDisplayName: Buffy
Answers.Body: <p>Why not use Chinese directly?</p>
  <p>Here's a Python 3 script with normal ASCII, Devanagari (Hindi) and Chinese. This is both in identifiers (variables, function names) and also in strings.</p>
  <h2>Table</h2>
  <p>Ive used google translate used to make this table since I know exactly zero Chinese!</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>English (ASCII)</th>
  <th>Hindi</th>
  <th>Chinese</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td><code>fool</code></td>
  <td>बेवकूफ</td>
  <td>傻子</td>
  </tr>
  <tr>
  <td><code>name</code></td>
  <td>नाम</td>
  <td>姓名</td>
  </tr>
  <tr>
  <td><code>unknown</code></td>
  <td>अजाना</td>
  <td>未知</td>
  </tr>
  <tr>
  <td><code>Hello</code></td>
  <td>नमस्ते</td>
  <td>你好</td>
  </tr>
  <tr>
  <td><code>x</code></td>
  <td>एक्स (transliteration)</td>
  <td>x (as is)</td>
  </tr>
  </tbody>
  </table>
  </div><h2>Multilingual code</h2>
  <p>Note the code below is rather poor on many counts! It's just a couple of lines to demo Python doing multilingual strings and identifiers.</p>
  <pre class="lang-py prettyprint-override"><code># ASCII
  def fool(unknown): #  fool is to make foo translatable!
                     #  normally I'd use x for unknown
      name = input()
      for x in range(4):
          print(&quot;Hello %s %d %s&quot; % (name, x, unknown))
          
  # Devanagari
  def बेवकूफ(अजाना):
      नाम = input()
      for एक्स in range(4): # literal transliteration of x
          print(&quot;नमस्ते %s %d %s&quot; % (नाम, एक्स, अजाना))
  
  
  # Chinese
  def 傻子(未知):
      姓名 = input()
      for x in range(4): # Ive no idea about transliteration!!
          print(&quot;你好 %s %d %s&quot; % (姓名, x, 未知))
  
  </code></pre>
  <p>Here's a session showing ASCII and Chinese usage</p>
  <pre><code>&gt;&gt;&gt; fool(42)
  rusi
  Hello rusi 0 42
  Hello rusi 1 42
  Hello rusi 2 42
  Hello rusi 3 42
  
  &gt;&gt;&gt; 傻子(42)
  习近平
  你好 习近平 0 42
  你好 习近平 1 42
  你好 习近平 2 42
  你好 习近平 3 42
  </code></pre>
  <hr />
  <h3>Note 1</h3>
  <p>There are reasons for having strong reservations for how unicode has been adopted (but not adapted!) into Python -- and for that matter most modern languages.</p>
  <p>Here's a Python (3 only) program.<br />
  Note: Its Python 3 only not 2 which will immediately give syntax error on the 2nd line!</p>
  <pre class="lang-py prettyprint-override"><code>#! /usr/bin/env python3
  A = 1
  Α = 2
  А = 3
  # The 1 and 2 should be overwritten by the 3 right??
  print(&quot;And now the miracle [A, A, A] is %s&quot; % [A, Α, А])
  </code></pre>
  <p>And a run:</p>
  <pre class="lang-py prettyprint-override"><code>~:$ python3 unipython.py 
  And now the miracle [A, A, A] is [1, 2, 3]
  </code></pre>
  <p>So Python has A being 1,2, and 3 <strong>at the same time</strong>?!?!</p>
  <p>Strange aint it?</p>
  <blockquote class="spoiler">
  <p> Well they are not 3 A's but one Greek alpha, one Russian (Cyrillic) A and one good ol ASCII A!
  
  Who'd have guessed?!</p>
  </blockquote>
  <h3>Note 2</h3>
  <p>As pointed out in other answers and comments unicode identifiers is the norm not the exception nowadays.</p>
  <p>Here's C (gcc). Seems to work well enough</p>
  <pre><code>#include &lt;stdio.h&gt;
  int foo(int x)
  { return x + 1;}
  
  int फू(int अ)
  { return अ + 1;}
  
  int main()
  {
    printf(&quot;Hello %d\n&quot;, फू(42));
  }
  </code></pre>
  <h2>Note 3</h2>
  <p>As said above the norm nowadays is that languages support unicode source code.  However the nuances across languages is a veritable worm-can.</p>
  <p>Eg in Python <code>ﬂag</code> and <code>flag</code> are the same.<br />
  In Haskell they are different</p>
  <h2>More Philosophical objections</h2>
  <p>Ive shown above that Python (and many other languages) will allow <strong>user-defined variables/functions/classes</strong> to be from a vastly wider character set than ASCII.</p>
  <p>What about builtin functions/types/classes?</p>
  <p>Well you could introduce a 'translation-library' that maps Chinese versions of the 50 most used library entities into Chinese.</p>
  <p>Laborious but doable</p>
  <p>But then what about keywords — if,while,def,class...??
  More laborious — recompile Python with all these keywords localized.</p>
  <p>Does it stop here?  What will you do when your kids need to progress beyond your classes to reading the docs?</p>
  <p>All of this is possible but as you go further afield from my toy examples above it quickly gets tedious and intractable.</p>
  <p>OTOH none of these are rhetorical questions. With 1.4 billion population, China could dedicate a couple of thousand to heavy-lifting the localization effort.</p>
  <p>So at a single individual level you need to think through where you draw your lines...</p>
  <h2>Personal Note</h2>
  <p>At a more personal level I strongly believe that <strong>beginning</strong> students should not be made to break their heads over large ugly real world languages like Python/C++/Java but learn to experience the richness of programming in a controlled baby nursery — which in your case would mean not burdening your kids with programming <em>and</em> a foreign language <em>simultaneously</em>.</p>
  <h2>Full Languages List</h2>
  <p>Apart from Python, C, Haskell that Ive talked of above what of the dozens of other languages?  Rosetta code has a <a href="https://rosettacode.org/wiki/Unicode_variable_names" rel="nofollow noreferrer">conspective list</a></p>
  <h2>References</h2>
  <p>Here are some Python 3 references that may be useful</p>
  <ol>
  <li><a href="https://docs.python.org/3.11/reference/lexical_analysis.html#identifiers" rel="nofollow noreferrer">Python identifiers lexical structure</a></li>
  <li><a href="https://peps.python.org/pep-3131/" rel="nofollow noreferrer">The Python Design Document</a></li>
  <li><a href="https://docs.python.org/3/howto/unicode.html" rel="nofollow noreferrer">General Python Unicode Howto</a></li>
  <li><a href="https://mail.python.org/pipermail/python-3000/2007-May/007524.html" rel="nofollow noreferrer">The mailing list discussion</a> (started by a French-Japanese-English trilingual)</li>
  <li><a href="https://unicodebook.readthedocs.io/unicode.html#categories" rel="nofollow noreferrer">Unicode letter categories</a> — not Python specific</li>
  <li><a href="https://www.hieuthi.com/blog/2021/07/22/unicode-categories-cjk-ideographs.html" rel="nofollow noreferrer">Unicode categories and CJK ideograph complications</a></li>
  <li><a href="http://blog.languager.org/search/label/Unicode" rel="nofollow noreferrer">My own thoughts on programming using unicode</a> — can be whimsical!</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T10:22:37.633Z
Answers.Text: The thought never occurred to me.  I need to do some research first
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T10:35:08.737Z
Answers.Text: Ive added some links/references that you may find useful @Qiulang邱朗
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T09:44:44.903Z
Answers.Text: Speaking of homoglyphs ("AΑА"), it is Unicode to be blamed that identical characters are duplicated with distinct codes.
Answers.UserDisplayName: Trang Oul
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T11:32:01.130Z
Answers.Text: @Qiulang邱朗 Are the characters in my answer 'Hanzi'? Since I've no idea what's hanzi, simplified, pinyin and what not I just left the vague 'Chinese'. If Hanzi is more accurate I'll change accordingly
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T11:35:44.753Z
Answers.Text: @TrangOul *Unicode blamed for homoglyphs*. Lets grant that. What will you do? What do you do about war, disease and death? As the saying goes "Sun, moon and taxes" is fait accompli. Likewise unicode. OTOH I don't think blaming unicode makes sense. ASCII was made by techies *for techies*. Unicode was made by techies and linguists etc *for the world*. At **3-4 orders of magnitude gap** from ASCII to unicode, expecting the same (techie) attitude to work will not. Specifically, prog. languages should *opt out by default, opt in with explicit decl/pragma* — like html's charset declaration
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T11:48:17.987Z
Answers.Text: @Rusi Sorry hanzi is the pinyin of the **Chinese Character**. And yes the characters in your answer are 'Hanzi'
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T18:06:38.737Z
Answers.Text: [GCC allegedly only caught up in mid 2020](https://stackoverflow.com/questions/12692067/and-other-unicode-characters-in-identifiers-not-allowed-by-g/42158646#42158646) ([version 10](https://gcc.gnu.org/releases.html)). A lot of folks are still using [Turbo C++](https://www.quora.com/What-are-some-bitter-truths-about-engineering-in-India/answer/Adhokshaj-Mishra) (often forced to) or similar old versions (incl. GCC).
Answers.UserDisplayName: Peter Mortensen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-02T00:31:40.357Z
Answers.Text: Tnx for the heads up @PeterMortensen. But I'm not sure what your point is. Some people are forced to learn programming without minimal English background, some with obsolete software.  Lots of ppl, lots of handicaps! Is there a case for "Lots of Turbo C++ in Chinese academia? After all Unicode is decades old,  but unicode  everywhere OS is still a developing subject... More pragmatically Still lot of Python 2 (and academically it's better)
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-02T06:48:51.250Z
Answers.Text: @PeterMortensen   Also if some hapless 12 year old is being subjected to C(++) in 2023, theres a bigger problem right there as compared to whether the specific C version is Turbo C!
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T08:10:55.890Z
Answers.LastActivityDate: 2023-05-31T19:22:41.950Z
Answers.LastEditDate: 2023-05-31T19:22:41.950Z
Answers.UserDisplayName: Rushi
Answers.Body: <p>I'll be provocative: English is the <em>lingua franca</em> of computer science. Ideally, every CS professional should be able to understand basic English technical texts. At a minimum, a software engineer should be able to write and read programs with English variable names and basic comments.</p>
  <p>I understand that the vocabulary of your students is limited; it is the job of the institution at which they learn to improve it to the minimum described above. If possible, the programming course should be accompanied by a 1-or 2-hours/week language course providing the specific vocabulary needed for the programming tasks. If that's not possible, fill the gap yourself. Simple English is incredibly simple, certainly from a Chinese perspective. Your students can already read the Latin alphabet. What's needed on top are a few dozen words, plus a few words of the respective problem domain for each programming task. Modern IDEs even have spell checkers.</p>
  <p>I also understand that I may be narrow-minded and have it backwards: I may live to see Chinese programmers making the same claim with respect to Chinese. But we ain't there yet, so do your students a favor and require English names for variables and functions.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T15:52:57.737Z
Answers.Text: English is simple?!?! [See](https://twitter.com/tweetsauce/status/1132719589203169280). More seriously, I don't dispute that every programmer in the world of 2023 will be better off for better english.  I dispute that it needs to be an added burden to 10-12 yearolds
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T16:00:34.337Z
Answers.Text: @Rusi 10-12 yearolds, no. University students using their native language when working with established codebase (written by me, not an English native) that uses only English - absolutely. (true story)
Answers.UserDisplayName: Vladimir F Героям слава
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T16:01:49.470Z
Answers.Text: @VladimirFГероямслава don't get (parse!) your second sentence.  Absolutely what?
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T16:27:10.363Z
Answers.Text: @Rusi Middle school ranges from 10 to 16, I think. True, it would be wanted much for 10 year olds, but perhaps not for 14 or 15 year olds (they would really profit from a few words of English, not only in CS).
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T16:29:16.160Z
Answers.Text: @Rusi As to your humorous Twitter link: None of the words are needed for programming (unless they appear in the subject domain), and pronunciation (the topic of the post, and problem for many learners) is irrelevant in any case.
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T17:26:40.040Z
Answers.Text: This German speakers [comment](https://cseducators.stackexchange.com/questions/7757/non-native-speakers-struggle-to-come-up-with-decent-variable-names-and-function#comment21210_7758) says it all succinctly
Answers.UserDisplayName: Rushi
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T15:50:53.223Z
Answers.Text: _"Simple English is incredibly simple, certainly from a Chinese perspective"_, not really. If you grew up learning both, then probably. But not if you're a Chinese student, the two just isn't comparable.
Answers.UserDisplayName: Passer By
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-02T00:29:41.710Z
Answers.Text: If your students [can't] already read the Latin alphabet, then they're SoL. +1. I'm assuming this isn't really a problem with French or Germans, but if your alphabet is in Cyrillic or straight up pictures that don't load for me because I'm missing a font, then that's going to be a problem. *People with low command of the language unable to name things?* Correct.
Answers.UserDisplayName: Mazura
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T15:09:19.007Z
Answers.LastActivityDate: 2023-05-31T15:09:19.007Z
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.Body: <p>Not an educator but a CS student, reading your description of the challenges your students face when it comes to naming variables and functions resonated with me. As a non-native English speaker myself, I have experienced similar situations as a student.</p>
  <p>I am originally from Slovenia and moved to Seattle to pursue a major in Computer Science. English not being my first language, I initially struggled with expressing my thoughts effectively in programming. However, one of my professors shared a valuable insight that I believe might apply to your students as well. They emphasized that as long as the code is <strong>logically sound</strong> and the <strong>purpose</strong> of variables and functions is <strong>clear</strong>, the exact choice of names becomes <strong>less crucial</strong>.</p>
  <p>Given the limited vocabulary of your students, it may seem challenging to encourage them to use meaningful names. However, it is important to emphasize the logical clarity of their code rather than solely focusing on the names. Encourage them to use naming conventions that make sense within their context, such as pinyin in the case of Chinese students. While it may sound unusual, it serves its purpose of conveying meaning within their linguistic capabilities.</p>
  <p>Furthermore, you can gradually introduce additional vocabulary to expand their options for naming. Incorporating activities that promote vocabulary development and discussing the importance of meaningful names can help them gradually improve their skills. Might be a shot in the dark but you could potentially introduce them to <a href="https://en.wikipedia.org/wiki/Metasyntactic_variable" rel="nofollow noreferrer">Metasyntactic variable names</a></p>
  <p>One possible solution could be documenting code, nothing too fancy but just adding a comment above. Its purpose is to explain what it does. Note that programmers might go for a different style of documenting their code. I would suggest not &quot;dumping&quot; everything on them at once (speaking from experience I hated it at first, but now I see why it's important), but introduce them to a simple one-line comment. Later on, you can tell them to list <code>pre</code> and <code>post</code> conditions and even <code>invariants</code></p>
  <p>Example:</p>
  <pre><code>void swap(int *num_1, int *num_2)
  {
      int temp = *num_1;
      *num_1 = *num_2;
      *num_2 = temp;
  }
  </code></pre>
  <p>Now the code above is pretty much self-explanatory, it takes in two integer pointers and swaps them. It arguably needs no documentation.</p>
  <p>Now let's look at this example:</p>
  <pre><code>void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  </code></pre>
  <p>This is still somewhat self-explanatory but without prior <code>C++</code> or programming knowledge someone wouldn't know what's going on. To solve this problem we could simply do something like this:</p>
  <pre><code>// {Zamenja 2 stevili} (Slovenian)
  // {Translates to: Swaps 2 numbers}
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  </code></pre>
  <p>Or something like this:</p>
  <pre><code>// {
  // desc: Zamenja 2 stevili (Slovenian)
  // param: a -&gt; pointer na prvo stevilo
  // param: b -&gt; pointer na drugo stevilo
  //
  // English translation:
  //
  // desc: Swaps 2 numbers
  // param: a -&gt; pointer to the first integer
  // param: b -&gt; pointer to the second integer
  // }
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  </code></pre>
  <p>Or if you want to be fancy and use <code>doxygen</code></p>
  <pre><code>/**
   * @brief Zamenja 2 stevili (Slovenian)
   * @param a pointer to the first integer
   * @param b pointer to the second integer
   */
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  
  </code></pre>
  <p>Now this results in some code that is a little more readable and someone else might have a better idea of what's going on.</p>
  <p>On that note I would like to add that naming variables like <code>s</code> or <code>r</code> and so on is considered bad practice, this is the stuff they do in <code>code-golf</code> and <code>dynamic programming</code>, what I presented is only a shorthand solution and not a long term one.</p>
  <p><strong>Edit:</strong> I'm assuming you all speak the same language and there is no language barrier.</p>
  <p>Best of luck in your teaching career.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T06:12:54.960Z
Answers.Text: Thanks for sharing your story, as for you I would recommend using github copilot, one of its selling points is to [help non-native speakers](https://github.blog/2022-09-14-8-things-you-didnt-know-you-could-do-with-github-copilot/#1-assisting-non-native-english-speakers) to come up with good names. lol
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T06:55:13.510Z
Answers.Text: I dislike Co-Pilot, yeah it's good in the industry (Software developers) and has many great applications, but it also violates academic integrity and basically does all the work for you, which means you don't learn anything...not to mention it also costs a decent amount. I appreciate the feedback tho
Answers.UserDisplayName: I_throw_but_dont_catch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T16:43:43.093Z
Answers.Text: I don't see why you can write "swap" in the comment but not as the method name. You still use pointers instead of references? Please, dear student, learn modern C++, not C.
Answers.UserDisplayName: Thomas Weller
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T18:25:35.503Z
Answers.Text: Sorry, but I don't like this at all. What if you have 576 different functions, with names from `aa` to `zz` - how many of those names can you remember, and how often will you confuse them? (This reminds me of the old days when I wrote CATIA V4 macros, with a library of several  hundred function names, all of them some 6 character abbreviation because that's what the linker was restricted to). The name of a method should be clear enough so you can infer what it does when you read the calling line without having to resort to any documentation.
Answers.UserDisplayName: Guntram Blohm
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T20:30:05.897Z
Answers.Text: @GuntramBlohm I agree and I said "*short-term solution and not ideal*" and I am also assuming these kids are not writing some super complex programs with 600 functions defined all over the global namespace (Introducing namespace could also arguably be a +). I believe that with 10 functions, things like that are manageable.
Answers.UserDisplayName: I_throw_but_dont_catch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T20:34:47.837Z
Answers.Text: @ThomasWeller Also --> I am assuming they would write "swap" in **Chinese/their own language**, **not English** since the question stated they lack **English** vocabulary.
Answers.UserDisplayName: I_throw_but_dont_catch
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T13:45:53.407Z
Answers.Text: The point about short variable names is overrated to some extent. Code should be readable, and if it is, then the choice of variable name matters far less. Using `i` as a loop index is perfectly fine for example, and I would similarly not consider your `a`/`b`/`c` example to be poorly written _provided the function has a descriptive name_ and is documented properly (because it’s so short and simple, there is little to no mental overhead in tracking the variables in that context).
Answers.UserDisplayName: Austin Hemmelgarn
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T15:41:23.770Z
Answers.Text: @ThomasWeller Despite some similarity in their names, C++ is not the up-to-date C or even a newer version of C. C is a perfectly good language in its own right.
Answers.UserDisplayName: Rosie F
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T21:04:48.833Z
Answers.Text: @RosieF: sure, I know. The term C++ is used in the answer. I just cited it and compared that declaration to the code associated with that label.
Answers.UserDisplayName: Thomas Weller
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-30T05:09:32.230Z
Answers.LastActivityDate: 2023-05-31T00:32:41.940Z
Answers.LastEditDate: 2023-05-31T00:32:41.940Z
Answers.UserDisplayName: I_throw_but_dont_catch
Answers.Body: <p>Native English-speaking computer science students also have trouble coming up with good names!</p>
  <p>In my opinion using <em>pinyin</em> is fine. In some ways it will be helpful for new students as they will get a clue of what their code is and what language keywords and 'Base Class Library' functions, etc. are.</p>
  <p>You could look and see if there is another programming language, you could use, which supports Unicode characters in variable names.</p>
  <p>I know this is possible in C#. See <em><a href="https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names" rel="nofollow noreferrer">C# identifier naming rules and conventions</a></em></p>
  <p>Sometimes you may need to start a variable with a Latin printable character for the first 'letter'. Something like an underscore.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T02:11:41.473Z
Answers.LastActivityDate: 2023-06-01T23:58:24.133Z
Answers.LastEditDate: 2023-06-01T23:58:24.133Z
Answers.UserDisplayName: Darcy Thomas
Answers.Body: <p>Names should be descriptive for the audience of the source code. If everyone who looks at that code understands Chinese, there is nothing wrong with using Chinese names, and if you use a programming language that struggles with Chinese characters (do such languages still exist?), you can always transliterate to latin characters.</p>
  <p>Alternatively, they can use English. In the age of machine translation, translating a term doesn't take much time. Even before machine translation, online dictionaries were a thing. Open the website, type your word, press Enter, and behold a set of translations to choose from :-)</p>
  <p>It can also make sense to mix these approaches. In many programs I have written, I used English for IT concepts, and German for business concepts (the requirements document was in German, but the software libraries we used were in English). It may look weird to mix languages, but it worked very well. After all, the purpose of naming is to clearly convey information, not dazzle the audience with your mastery of the literary arts.</p>
  <p>(What one shouldn't do in professional code is mix languages arbitrarily, switching seemingly at random. The same thing should have the same name throughout the entire source code)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-31T01:27:27.130Z
Answers.LastActivityDate: 2023-05-31T01:34:02.083Z
Answers.LastEditDate: 2023-05-31T01:34:02.083Z
Answers.UserDisplayName: meriton
Answers.Body: <p>In my experience, it is in general hugely unreasonable to expect non-native middle schoolers to have any decent vocabulary of English. Granted, the English used in programming is not English in its entirety but it is still a lot to learn. Pinyin works fine for now, let them be.</p>
  <p>To put things in perspective, non-native middle schoolers may be tested on 1000~2000 English words. Obviously not everyone will know all of them, and even less of them well. Even if English used in programming is very limited, there might still be a few hundred words that is commonly used. Asking the students to know them well is too much.</p>
  <p>But make no mistake, English is the <em>de facto</em> standard language, and it should be made clear to them they should learn some English if they want to pursue programming further. The reasons why are innumerable</p>
  <h3>Official documentation, books and tutorials</h3>
  <p>Not knowing the vocabulary will limit the resources available to you. It is simply a fact that English resources are currently the best.</p>
  <h3>Googling and Stack Exchange</h3>
  <p>The fact that you're asking <em>here</em>, instead of say zhihu, is proof that knowing English is a great advantage. If you google in English, you get Stack Overflow. You'd be surprised how many people googled the wrong keywords, found nothing and gave up.</p>
  <h3>Standard libraries and builtins</h3>
  <p>These are not changeable and all of them relies on English. For example, in C++ it is <em>required</em> that your member functions are <code>begin</code> and <code>end</code> to enable range based for loops.</p>
  <h3>Tooling</h3>
  <p>There are tooling that relies on how English works. For example, pytest uses <code>test_*</code> and <code>Test*</code> as a signature that the objects are items for testing purposes.</p>
  <p>The list goes on. As you might imagine, software <em>really</em> <strong>really</strong> cares about consistency.</p>
  <p>Using Unicode characters is even worse for tooling:</p>
  <ul>
  <li>Regex support for non-ascii characters is usually poor to non-existent.</li>
  <li>Go (the language) uses uppercase letters to indicate exported names.</li>
  <li>The way whitespace plays with different languages is hugely variable.</li>
  <li>Languages going from right to left is likely impossible to work with for many tools.</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T18:34:13.453Z
Answers.Text: Sometimes I wonder why everything is in English. Then I realise, the non English stuff does not come up in by searches.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-02T01:32:18.293Z
Answers.Text: The only thing I can add is to these words "The fact that you're asking here, instead of say zhihu..." I asked here instead of zhihu or quora is because I am an active user of SE and I think it is the best, say far better than quora, although I hate close-vote and down-votes without any comments.
Answers.UserDisplayName: Qiulang 邱朗
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-01T15:46:37.493Z
Answers.LastActivityDate: 2023-06-01T19:21:25.193Z
Answers.LastEditDate: 2023-06-01T19:21:25.193Z
Answers.UserDisplayName: Passer By
Body: <p>The students I teach at a middle school in Beijing normally have a limited vocabulary. They struggle to come up with decent variable names and function names. Most of the time they just name variables as a, b, and c, and function names as ab, ac, and ad. Considering their vocabulary, telling them to use a meaningful name seems pointless.</p>
  <p>Sometimes kids will use <a href="https://www.twinkl.com.tw/teaching-wiki/pinyin" rel="nofollow noreferrer">pinyin</a>,  a system to spell Chinese Characters with the Latin alphabet based on their pronunciation, to name the function, e.g. <code>fabs</code> in Chinese pinyin is &quot;jueduizhi&quot;, so instead of <code>fabs(x)</code> they call it <code>jueduizhi(x)</code>. That seems to be a workable solution although it looks strange at first.</p>
  <p>I am a non-native English speaker myself but I have forgotten how I got through this obstacle. But I know naming may be hard for native English speakers too, otherwise, there wouldn't be the <a href="https://martinfowler.com/bliki/TwoHardThings.html" rel="nofollow noreferrer">two hard things</a> joke. The answer given by <a href="https://cseducators.stackexchange.com/a/7784/9884">@bta</a> gives me valuable input and also reminds me of my Objective-C days that Apple has some <a href="https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html" rel="nofollow noreferrer">guidelines for naming</a>, e.g. &quot;<em>The use of 'get' is unnecessary, unless one or more values are returned <strong>indirectly</strong>.</em>&quot; But that is another topic.</p>
  <p>Does anyone have a similar situation to mine (not necessarily Chinese)? Any suggestion on how I teach these students to name their variables and functions better? Or does it not matter at this stage (when they try to learn the basic programming concepts)?</p>
  <p>P.S. I would like to add this article as an anecdote to my question: <a href="https://thoughtbot.com/blog/learning-japanese-the-rubyist-way" rel="nofollow noreferrer">Learning Japanese the Rubyist way</a>. And it would be interesting if I can get someone from Japan to answer this question.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-29T15:11:24.037Z
Comments.Text: What is wrong with pinyin? The names make sense to them if they are descriptive of the semantics of the program. English speakers don't need to be mollified.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-29T15:23:44.017Z
Comments.Text: A, for starters, just some smart kids come up with this idea and I am not sure if it Is worth promoting the idea. B, it is not easy to use pinyin to name them in a consistent way, e.g. loop can have several translations in Chinese, then each with a different pinyin. C, some function/variable names we have gotten used to like worker/manager/factory, when translate to Chinese really sound strange in code. In a word I am not sure if it is a good idea.
Comments.UserDisplayName: Qiulang 邱朗
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-30T09:25:25.793Z
Comments.Text: I switched from my native Danish to English in my code many years ago, because (1) when you look up solutions they will often be in English; (2) standard designs (patterns) come with a well-defined English vocabulary; (3) libraries are all in English, mixed with other languages the code becomes hideous. Solution: Use ChatGPT or similar. E.g. ask it "What is a common term for a worker in a bank".
Comments.UserDisplayName: Niels Holst
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-31T02:34:38.960Z
Comments.Text: @Buffy: Coming from a non-English-speaking culture myself, there is generally a hard push for English to be used in code. Exceptions exist but they are exceedingly rare. Code written in my native language is often lower in quality - but this is a correlation, not a causation, i.e. people who avoid writing English are generally less confident with the language and therefore tend to not rely on English resource materials as much, which dramatically impacts their learning. [..]
Comments.UserDisplayName: Flater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-31T02:35:42.847Z
Comments.Text: @Buffy: [..] A general drive for English in code as a matter of making developers confident in the language that pretty much all online resources are written in, is in my opinion a good push. Maybe not for the technical validity of the code itself but it keeps the technical language closer to the online source material, which is an argument not too dissimilar from the benefits of ubiquitous language.
Comments.UserDisplayName: Flater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-31T04:10:27.313Z
Comments.Text: @Flater I agree with what you said but my question is about middle/high school kids, and does the naming matter at this stage when I try to teach them how to program(which I don't know)?
Comments.UserDisplayName: Qiulang 邱朗
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-31T04:14:21.187Z
Comments.Text: @Qiulang邱朗: It depends. If you are investing in their long term ability to learn how to develop software, then teaching them to get familiar with the lingua franca of the software development world is going to make it significantly easier for them to access learning resources. If this is an introductory class for students who have not yet committed to wanting to learn software development, then needing to get familiar with English is an unnecessary hurdle to understanding a very basic introductory principle of software development. The context of your curriculum matters.
Comments.UserDisplayName: Flater
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-31T15:51:36.873Z
Comments.Text: Consider that you also have comments.  So some additional options develop: pinyin identifiers with English comments, English identifiers with pinyin comments, English identifiers with full Unicode in comments
Comments.UserDisplayName: Ben Voigt
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-05-31T22:40:09.760Z
Comments.Text: Tell your students not to be so lazy! They should call it juéduìzhí, not jueduizhi. So everybody can understand it.
Comments.UserDisplayName: TonyK
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T01:27:03.587Z
Comments.Text: @TonyK I've never seen accented pinyin even in government documents.
Comments.UserDisplayName: Nelson
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T02:03:23.290Z
Comments.Text: @TonyK I can't tell if you were joking, but we seldom add tone to our pinyin. Most of the Chinese input methods can give you character/word candidates based on pinyin without tone.
Comments.UserDisplayName: Qiulang 邱朗
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T05:55:54.313Z
Comments.Text: The usual informal way I see of writing accented pinyin is with numbers to indicate the tones (eg. hao3) but I've never seen any kind of official accented pinyin on street signs etc. It would be cool if the students could just write the program with hanzi comments and variable names and pipe it through a filter that strips or translates in an appropriate manner the unicode characters before feeding it to the compiler, if that's what is required.
Comments.UserDisplayName: Spehro 'speff' Pefhany
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T06:20:34.910Z
Comments.Text: @SpehroPefhany I would rather them write hanzi comments but still use English names for variables and functions.
Comments.UserDisplayName: Qiulang 邱朗
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T12:43:57.903Z
Comments.Text: What is `fabs`?
Comments.UserDisplayName: Toivo Säwén
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T13:38:28.243Z
Comments.Text: @ToivoSäwén: Fabricated Stuff. More seriously, Floating Abs. Mathematical abs...
Comments.UserDisplayName: user21820
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T13:56:04.460Z
Comments.Text: Native speakers struggle as well ;)
Comments.UserDisplayName: Macario
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T13:57:22.597Z
Comments.Text: I think there is a difference between English proficiency and knowing specific mathematical abbreviations. It's offtopic to the question but why not use `floating_absolute`?
Comments.UserDisplayName: Toivo Säwén
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-01T14:52:25.997Z
Comments.Text: @ToivoSäwén It's a standard C function recognized in great many places. Changing its name does more harm then good, which ties in nicely to the point about using English to be consistent if not anything else.
Comments.UserDisplayName: Passer By
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-02T00:35:10.407Z
Comments.Text: Lesson ideas? No. *entrance exam*. Or passing grade in English 102.
Comments.UserDisplayName: Mazura
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-02T03:13:00.147Z
Comments.Text: @Mazura thanks for noticing that. Actually when I chose the tags for my question I found that none of the existing ones were close.
Comments.UserDisplayName: Qiulang 邱朗
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-02T16:20:18.070Z
Comments.Text: @PasserBy if it's a standard function, why would they reimplement it or redefine it as `jueduizhi(x)`? I think the answers to the question will differ if you are considering standard functions in the language or implementing new functions.
Comments.UserDisplayName: Toivo Säwén
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-06-03T03:47:47.897Z
Comments.Text: @ToivoSäwén because I just give them the very basic idea of programming, what is a function, you give it some input and then you get your output.
Comments.UserDisplayName: Qiulang 邱朗
Tags: <lesson-ideas><secondary-education>
Title: Non-native English speakers struggle to come up with decent variable names and function names
ThreadText: # Non-native English speakers struggle to come up with decent variable names and function names
  
  (Asked by: username_0 on 2023-05-29)
  
  The students I teach at a middle school in Beijing normally have a limited vocabulary. They struggle to come up with decent variable names and function names. Most of the time they just name variables as a, b, and c, and function names as ab, ac, and ad. Considering their vocabulary, telling them to use a meaningful name seems pointless.
  
  Sometimes kids will use [pinyin](https://www.twinkl.com.tw/teaching-wiki/pinyin), a system to spell Chinese Characters with the Latin alphabet based on their pronunciation, to name the function, e.g. `fabs` in Chinese pinyin is "jueduizhi", so instead of `fabs(x)` they call it `jueduizhi(x)`. That seems to be a workable solution although it looks strange at first.
  
  I am a non-native English speaker myself but I have forgotten how I got through this obstacle. But I know naming may be hard for native English speakers too, otherwise, there wouldn't be the [two hard things](https://martinfowler.com/bliki/TwoHardThings.html) joke. The answer given by [@username_13](https://cseducators.stackexchange.com/a/7784/9884) gives me valuable input and also reminds me of my Objective-C days that Apple has some [guidelines for naming](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html), e.g. "*The use of 'get' is unnecessary, unless one or more values are returned **indirectly**.*" But that is another topic.
  
  Does anyone have a similar situation to mine (not necessarily Chinese)? Any suggestion on how I teach these students to name their variables and functions better? Or does it not matter at this stage (when they try to learn the basic programming concepts)?
  
  P.S. I would like to add this article as an anecdote to my question: [Learning Japanese the Rubyist way](https://thoughtbot.com/blog/learning-japanese-the-rubyist-way). And it would be interesting if I can get someone from Japan to answer this question.
  
  **Tags:** lesson-ideas, secondary-education
  
  > **Comments:**
  > **username_1**: What is wrong with pinyin? The names make sense to them if they are descriptive of the semantics of the program. English speakers don't need to be mollified.  
  > **username_0**: A, for starters, just some smart kids come up with this idea and I am not sure if it Is worth promoting the idea. B, it is not easy to use pinyin to name them in a consistent way, e.g. loop can have several translations in Chinese, then each with a different pinyin. C, some function/variable names we have gotten used to like worker/manager/factory, when translate to Chinese really sound strange in code. In a word I am not sure if it is a good idea.  
  > **username_2**: I switched from my native Danish to English in my code many years ago, because (1) when you look up solutions they will often be in English; (2) standard designs (patterns) come with a well-defined English vocabulary; (3) libraries are all in English, mixed with other languages the code becomes hideous. Solution: Use ChatGPT or similar. E.g. ask it "What is a common term for a worker in a bank".  
  > **username_3**: @username_1: Coming from a non-English-speaking culture myself, there is generally a hard push for English to be used in code. Exceptions exist but they are exceedingly rare. Code written in my native language is often lower in quality - but this is a correlation, not a causation, i.e. people who avoid writing English are generally less confident with the language and therefore tend to not rely on English resource materials as much, which dramatically impacts their learning. [..]  
  > **username_3**: @username_1: [..] A general drive for English in code as a matter of making developers confident in the language that pretty much all online resources are written in, is in my opinion a good push. Maybe not for the technical validity of the code itself but it keeps the technical language closer to the online source material, which is an argument not too dissimilar from the benefits of ubiquitous language.  
  > **username_0**: @username_3 I agree with what you said but my question is about middle/high school kids, and does the naming matter at this stage when I try to teach them how to program(which I don't know)?  
  > **username_3**: @username_0: It depends. If you are investing in their long term ability to learn how to develop software, then teaching them to get familiar with the lingua franca of the software development world is going to make it significantly easier for them to access learning resources. If this is an introductory class for students who have not yet committed to wanting to learn software development, then needing to get familiar with English is an unnecessary hurdle to understanding a very basic introductory principle of software development. The context of your curriculum matters.  
  > **username_4**: Consider that you also have comments.  So some additional options develop: pinyin identifiers with English comments, English identifiers with pinyin comments, English identifiers with full Unicode in comments  
  > **username_5**: Tell your students not to be so lazy! They should call it juéduìzhí, not jueduizhi. So everybody can understand it.  
  > **username_6**: @username_5 I've never seen accented pinyin even in government documents.  
  > **username_0**: @username_5 I can't tell if you were joking, but we seldom add tone to our pinyin. Most of the Chinese input methods can give you character/word candidates based on pinyin without tone.  
  > **username_7**: The usual informal way I see of writing accented pinyin is with numbers to indicate the tones (eg. hao3) but I've never seen any kind of official accented pinyin on street signs etc. It would be cool if the students could just write the program with hanzi comments and variable names and pipe it through a filter that strips or translates in an appropriate manner the unicode characters before feeding it to the compiler, if that's what is required.  
  > **username_0**: @SpehroPefhany I would rather them write hanzi comments but still use English names for variables and functions.  
  > **username_8**: What is `fabs`?  
  > **username_9**: @username_8: Fabricated Stuff. More seriously, Floating Abs. Mathematical abs...  
  > **username_10**: Native speakers struggle as well ;)  
  > **username_8**: I think there is a difference between English proficiency and knowing specific mathematical abbreviations. It's offtopic to the question but why not use `floating_absolute`?  
  > **username_11**: @username_8 It's a standard C function recognized in great many places. Changing its name does more harm then good, which ties in nicely to the point about using English to be consistent if not anything else.  
  > **username_12**: Lesson ideas? No. *entrance exam*. Or passing grade in English 102.  
  > **username_0**: @username_12 thanks for noticing that. Actually when I chose the tags for my question I found that none of the existing ones were close.  
  > **username_8**: @username_11 if it's a standard function, why would they reimplement it or redefine it as `jueduizhi(x)`? I think the answers to the question will differ if you are considering standard functions in the language or implementing new functions.  
  > **username_0**: @username_8 because I just give them the very basic idea of programming, what is a function, you give it some input and then you get your output.  
  
  ---
  
  ## 10 answers
  
  ### Answer by username_1 on 2023-05-29. Score: 19
  
  The point of good variable/function/class naming is to express problem semantics to readers, including the programmers. If your readers are primarily French speakers, use good French naming for everything.
  
  Unfortunately, most programming environments don't support Chinese and Japanese (or Navajo or ...) characters directly, or it would be proper to use those. But students should be encouraged to find names in their own language that correctly represent the intent of the program item and then, if the programming system won't directly support it and will only accept, say, Latin style alphabets, then a system like pinyin should be fine.
  
  I'm assuming, however, that a reader, reading pinyin will associate the word(s) with the right concept and that the translation doesn't lose too much actual meaning.
  
  Maybe the problem is yours if you aren't a native (-ish) Chinese speaker. But I shouldn't have to use French words unless I were writing for a French speaking audience.
  
  ---
  
  Caveat: If a language can be written with unicode characters then large subsets of Chinese and Japanese and some others can be directly used. Java is an example. IIRC, though, keyboard entry is complicated.
  
  > **Comments:**
  > **username_18**: Contrary to the practiced opinion of native English-speaking programmers, English is _not_ the language of programming. Allow, even encourage, the students to use the pinyin-ised names for what things are, or do in the language of the programmer. It would do my heart much good to have all our "languages" localised as well. I'd love to see a yóuyú or zeon loop in some clean code.  
  > **username_19**: Speaking of French, that reminds me of a project ([Framadate](https://framadate.org/abc/en/)) that was abandoned. Much of the source code is written in French. That makes it almost impossible to find a maintainer now. (-- While looking at the homepage again, it seems they changed their licensing and are trying to find some funding for it to continue development)  
  > **username_20**: While I, as a German software developer who's been in the industry for 40 years, strongly disagree with using anything but English in "real" code, I think there is a difference between learners and professionals. Learning to find good variable/method names is much more important than learning to find English names, and switching from good Chinese to good English is much easier than switching from bad names to good names. Don't rate them on their English skills, only check if the name they come up with is a good description of what the thing is used for.  
  > **username_21**: @username_20 In my company we deliberately use German names for variables and functions in our code. A precondition is that the code will only ever be read by German speakers but if that is satisfied this approach has the advantage that one can immediately distinguish which functions are internal to our code and which come from some external library or similar source.  
  > **username_22**: @username_21 As my employer realizes quite painfully, predictions are difficult, especially when they concern the future ;-). If your code base lives longer than a handful of years, chances are it will be maintained by people who don't speak German at all but read English well enough to understand English code. Note that this may well happen on German soil (as if that had any relevance these days, but still). Your company is myopic.  
  > **username_14**: Since this is the most upvoted answer its good you've added the caveat at end. A comprehensive conspective lineup of Unicode vars in languages is [here](https://rosettacode.org/wiki/Unicode_variable_names).  Right here [my answer](https://cseducators.stackexchange.com/a/7779/8837) gives examples of Python and C and a smattering of Haskell.  
  > **username_23**: I was told twice quite strongly to write comments, variable names, function names in German, and each time I ended up translating everything into English.  
  > **username_6**: @username_23 That's just the nature of the risk and reward involved. Cater to your local language skills or get access to significantly larger pool of English resources.  
  > **username_14**: @username_20 excellent distinction! I've referred to it in a couple of comments below/elsewhere. Ppl unable to get your point are not teachers, almost certainly not *experienced* teachers. When one has taught for decades (and are generally regarded as a good teacher) one knows willynilly how many students have fallen through the cracks because of sundry neglected reasons.  
  > **username_21**: @username_15-ReinstateMonica Of course no one can make perfect predictions of the future and you have to balance the possible advantages and disadvantages of either approach. But precisely because of that calling a company myopic without knowing any context about what they do is unnecessarily harsh and I'm quite confident wrong in my specific case (there are legal reasons the code will only ever be used in a German context and knowing German is required to understand what the code is used for).  
  > **username_22**: @username_21 Yes, it was harsh, but warranted based on the available information. Legal reasons the code will only ever not only be used in a "German context" but also by German speakers (which is not the same) are exceedingly rare. In that case the company may not be overly myopic (although the legal frame may shift to a European level in our lifetime, conceivably).  
  > **username_22**: @username_21 I'll give a contrasting example: A German company produces trains with German workers in Germany for DB following German regulations. They are audited by TÜV and Eisenbahnbundesamt. 20 or 30 years later they are producing trains for a world market following European regulations with an internationally distributed team, and parts of the code base and documentation are in German. Perhaps not such a big deal in the great scheme of things, but: The default should *always* be English unless legal requirements forbid it ;-).  
  > **username_24**: I don't think that it's correct to say "Unfortunately, most programming environments don't support Chinese and Japanese (or Navajo or ...) characters directly", as right now almost all programming environments *do* allow identifiers in non-Latin Unicode alphabets, as modern compilers and editors support this even for older languages like C, C++, Perl, Prolog; and of course languages like  JavaScript, Python, Go, Java, Ruby, etc have supported that for ages or even from day 1. So if you choose (for whatever reason) to use non-Latin identifiers, the tools will allow you to do that.  
  > **username_25**: I've written code with identifiers in Esperanto in PHP as well as Java 15 years ago. Worked fine back then. (Looks a bit strange, as all the standard library functions and keywords are in English.)  
  
  ---
  
  ### Answer by username_28 on 2023-05-30. Score: 7
  
  Not an educator but a CS student, reading your description of the challenges your students face when it comes to naming variables and functions resonated with me. As a non-native English speaker myself, I have experienced similar situations as a student.
  
  I am originally from Slovenia and moved to Seattle to pursue a major in Computer Science. English not being my first language, I initially struggled with expressing my thoughts effectively in programming. However, one of my professors shared a valuable insight that I believe might apply to your students as well. They emphasized that as long as the code is **logically sound** and the **purpose** of variables and functions is **clear**, the exact choice of names becomes **less crucial**.
  
  Given the limited vocabulary of your students, it may seem challenging to encourage them to use meaningful names. However, it is important to emphasize the logical clarity of their code rather than solely focusing on the names. Encourage them to use naming conventions that make sense within their context, such as pinyin in the case of Chinese students. While it may sound unusual, it serves its purpose of conveying meaning within their linguistic capabilities.
  
  Furthermore, you can gradually introduce additional vocabulary to expand their options for naming. Incorporating activities that promote vocabulary development and discussing the importance of meaningful names can help them gradually improve their skills. Might be a shot in the dark but you could potentially introduce them to [Metasyntactic variable names](https://en.wikipedia.org/wiki/Metasyntactic_variable)
  
  One possible solution could be documenting code, nothing too fancy but just adding a comment above. Its purpose is to explain what it does. Note that programmers might go for a different style of documenting their code. I would suggest not "dumping" everything on them at once (speaking from experience I hated it at first, but now I see why it's important), but introduce them to a simple one-line comment. Later on, you can tell them to list `pre` and `post` conditions and even `invariants`
  
  Example:
  
  ```
  void swap(int *num_1, int *num_2)
  {
      int temp = *num_1;
      *num_1 = *num_2;
      *num_2 = temp;
  }
  
  ```
  
  Now the code above is pretty much self-explanatory, it takes in two integer pointers and swaps them. It arguably needs no documentation.
  
  Now let's look at this example:
  
  ```
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  
  ```
  
  This is still somewhat self-explanatory but without prior `C++` or programming knowledge someone wouldn't know what's going on. To solve this problem we could simply do something like this:
  
  ```
  // {Zamenja 2 stevili} (Slovenian)
  // {Translates to: Swaps 2 numbers}
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  
  ```
  
  Or something like this:
  
  ```
  // {
  // desc: Zamenja 2 stevili (Slovenian)
  // param: a -> pointer na prvo stevilo
  // param: b -> pointer na drugo stevilo
  //
  // English translation:
  //
  // desc: Swaps 2 numbers
  // param: a -> pointer to the first integer
  // param: b -> pointer to the second integer
  // }
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  
  ```
  
  Or if you want to be fancy and use `doxygen`
  
  ```
  /**
   * @brief Zamenja 2 stevili (Slovenian)
   * @param a pointer to the first integer
   * @param b pointer to the second integer
   */
  void ab(int* a, int* b)
  {
      int c = *a;
      *a = *b;
      *b = c;
  }
  
  ```
  
  Now this results in some code that is a little more readable and someone else might have a better idea of what's going on.
  
  On that note I would like to add that naming variables like `s` or `r` and so on is considered bad practice, this is the stuff they do in `code-golf` and `dynamic programming`, what I presented is only a shorthand solution and not a long term one.
  
  **Edit:** I'm assuming you all speak the same language and there is no language barrier.
  
  Best of luck in your teaching career.
  
  > **Comments:**
  > **username_0**: Thanks for sharing your story, as for you I would recommend using github copilot, one of its selling points is to [help non-native speakers](https://github.blog/2022-09-14-8-things-you-didnt-know-you-could-do-with-github-copilot/#1-assisting-non-native-english-speakers) to come up with good names. lol  
  > **username_28**: I dislike Co-Pilot, yeah it's good in the industry (Software developers) and has many great applications, but it also violates academic integrity and basically does all the work for you, which means you don't learn anything...not to mention it also costs a decent amount. I appreciate the feedback tho  
  > **username_19**: I don't see why you can write "swap" in the comment but not as the method name. You still use pointers instead of references? Please, dear student, learn modern C++, not C.  
  > **username_20**: Sorry, but I don't like this at all. What if you have 576 different functions, with names from `aa` to `zz` - how many of those names can you remember, and how often will you confuse them? (This reminds me of the old days when I wrote CATIA V4 macros, with a library of several  hundred function names, all of them some 6 character abbreviation because that's what the linker was restricted to). The name of a method should be clear enough so you can infer what it does when you read the calling line without having to resort to any documentation.  
  > **username_28**: @username_20 I agree and I said "*short-term solution and not ideal*" and I am also assuming these kids are not writing some super complex programs with 600 functions defined all over the global namespace (Introducing namespace could also arguably be a +). I believe that with 10 functions, things like that are manageable.  
  > **username_28**: @username_19 Also --> I am assuming they would write "swap" in **Chinese/their own language**, **not English** since the question stated they lack **English** vocabulary.  
  > **username_29**: The point about short variable names is overrated to some extent. Code should be readable, and if it is, then the choice of variable name matters far less. Using `i` as a loop index is perfectly fine for example, and I would similarly not consider your `a`/`b`/`c` example to be poorly written _provided the function has a descriptive name_ and is documented properly (because it’s so short and simple, there is little to no mental overhead in tracking the variables in that context).  
  > **username_30**: @username_19 Despite some similarity in their names, C++ is not the up-to-date C or even a newer version of C. C is a perfectly good language in its own right.  
  > **username_19**: @username_30: sure, I know. The term C++ is used in the answer. I just cited it and compared that declaration to the code associated with that label.  
  
  ---
  
  ### Answer by username_14 on 2023-05-31. Score: 6
  
  Why not use Chinese directly?
  
  Here's a Python 3 script with normal ASCII, Devanagari (Hindi) and Chinese. This is both in identifiers (variables, function names) and also in strings.
  
  ## Table
  
  Ive used google translate used to make this table since I know exactly zero Chinese!
  
  | English (ASCII) | Hindi | Chinese |
  | --- | --- | --- |
  | `fool` | बेवकूफ | 傻子 |
  | `name` | नाम | 姓名 |
  | `unknown` | अजाना | 未知 |
  | `Hello` | नमस्ते | 你好 |
  | `x` | एक्स (transliteration) | x (as is) |
  
  ## Multilingual code
  
  Note the code below is rather poor on many counts! It's just a couple of lines to demo Python doing multilingual strings and identifiers.
  
  ```py
  # ASCII
  def fool(unknown): #  fool is to make foo translatable!
                     #  normally I'd use x for unknown
      name = input()
      for x in range(4):
          print("Hello %s %d %s" % (name, x, unknown))
          
  # Devanagari
  def बेवकूफ(अजाना):
      नाम = input()
      for एक्स in range(4): # literal transliteration of x
          print("नमस्ते %s %d %s" % (नाम, एक्स, अजाना))
  
  # Chinese
  def 傻子(未知):
      姓名 = input()
      for x in range(4): # Ive no idea about transliteration!!
          print("你好 %s %d %s" % (姓名, x, 未知))
  
  ```
  
  Here's a session showing ASCII and Chinese usage
  
  ```
  >>> fool(42)
  rusi
  Hello rusi 0 42
  Hello rusi 1 42
  Hello rusi 2 42
  Hello rusi 3 42
  
  >>> 傻子(42)
  习近平
  你好 习近平 0 42
  你好 习近平 1 42
  你好 习近平 2 42
  你好 习近平 3 42
  
  ```
  
  ---
  
  ### Note 1
  
  There are reasons for having strong reservations for how unicode has been adopted (but not adapted!) into Python -- and for that matter most modern languages.
  
  Here's a Python (3 only) program.  
  Note: Its Python 3 only not 2 which will immediately give syntax error on the 2nd line!
  
  ```py
  #! /usr/bin/env python3
  A = 1
  Α = 2
  А = 3
  # The 1 and 2 should be overwritten by the 3 right??
  print("And now the miracle [A, A, A] is %s" % [A, Α, А])
  
  ```
  
  And a run:
  
  ```py
  ~:$ python3 unipython.py 
  And now the miracle [A, A, A] is [1, 2, 3]
  
  ```
  
  So Python has A being 1,2, and 3 **at the same time**?!?!
  
  Strange aint it?
  
  > Well they are not 3 A's but one Greek alpha, one Russian (Cyrillic) A and one good ol ASCII A!
  > Who'd have guessed?!
  
  ### Note 2
  
  As pointed out in other answers and comments unicode identifiers is the norm not the exception nowadays.
  
  Here's C (gcc). Seems to work well enough
  
  ```
  #include <stdio.h>
  int foo(int x)
  { return x + 1;}
  
  int फू(int अ)
  { return अ + 1;}
  
  int main()
  {
    printf("Hello %d\n", फू(42));
  }
  
  ```
  
  ## Note 3
  
  As said above the norm nowadays is that languages support unicode source code. However the nuances across languages is a veritable worm-can.
  
  Eg in Python `ﬂag` and `flag` are the same.  
  In Haskell they are different
  
  ## More Philosophical objections
  
  Ive shown above that Python (and many other languages) will allow **user-defined variables/functions/classes** to be from a vastly wider character set than ASCII.
  
  What about builtin functions/types/classes?
  
  Well you could introduce a 'translation-library' that maps Chinese versions of the 50 most used library entities into Chinese.
  
  Laborious but doable
  
  But then what about keywords — if,while,def,class...??
  More laborious — recompile Python with all these keywords localized.
  
  Does it stop here? What will you do when your kids need to progress beyond your classes to reading the docs?
  
  All of this is possible but as you go further afield from my toy examples above it quickly gets tedious and intractable.
  
  OTOH none of these are rhetorical questions. With 1.4 billion population, China could dedicate a couple of thousand to heavy-lifting the localization effort.
  
  So at a single individual level you need to think through where you draw your lines...
  
  ## Personal Note
  
  At a more personal level I strongly believe that **beginning** students should not be made to break their heads over large ugly real world languages like Python/C++/Java but learn to experience the richness of programming in a controlled baby nursery — which in your case would mean not burdening your kids with programming *and* a foreign language *simultaneously*.
  
  ## Full Languages List
  
  Apart from Python, C, Haskell that Ive talked of above what of the dozens of other languages? Rosetta code has a [conspective list](https://rosettacode.org/wiki/Unicode_variable_names)
  
  ## References
  
  Here are some Python 3 references that may be useful
  
  1. [Python identifiers lexical structure](https://docs.python.org/3.11/reference/lexical_analysis.html#identifiers)
  2. [The Python Design Document](https://peps.python.org/pep-3131/)
  3. [General Python Unicode Howto](https://docs.python.org/3/howto/unicode.html)
  4. [The mailing list discussion](https://mail.python.org/pipermail/python-3000/2007-May/007524.html) (started by a French-Japanese-English trilingual)
  5. [Unicode letter categories](https://unicodebook.readthedocs.io/unicode.html#categories) — not Python specific
  6. [Unicode categories and CJK ideograph complications](https://www.hieuthi.com/blog/2021/07/22/unicode-categories-cjk-ideographs.html)
  7. [My own thoughts on programming using unicode](http://blog.languager.org/search/label/Unicode) — can be whimsical!
  
  > **Comments:**
  > **username_0**: The thought never occurred to me.  I need to do some research first  
  > **username_14**: Ive added some links/references that you may find useful @username_0  
  > **username_26**: Speaking of homoglyphs ("AΑА"), it is Unicode to be blamed that identical characters are duplicated with distinct codes.  
  > **username_14**: @username_0 Are the characters in my answer 'Hanzi'? Since I've no idea what's hanzi, simplified, pinyin and what not I just left the vague 'Chinese'. If Hanzi is more accurate I'll change accordingly  
  > **username_14**: @username_26 *Unicode blamed for homoglyphs*. Lets grant that. What will you do? What do you do about war, disease and death? As the saying goes "Sun, moon and taxes" is fait accompli. Likewise unicode. OTOH I don't think blaming unicode makes sense. ASCII was made by techies *for techies*. Unicode was made by techies and linguists etc *for the world*. At **3-4 orders of magnitude gap** from ASCII to unicode, expecting the same (techie) attitude to work will not. Specifically, prog. languages should *opt out by default, opt in with explicit decl/pragma* — like html's charset declaration  
  > **username_0**: @Rusi Sorry hanzi is the pinyin of the **Chinese Character**. And yes the characters in your answer are 'Hanzi'  
  > **username_15**: [GCC allegedly only caught up in mid 2020](https://stackoverflow.com/questions/12692067/and-other-unicode-characters-in-identifiers-not-allowed-by-g/42158646#42158646) ([version 10](https://gcc.gnu.org/releases.html)). A lot of folks are still using [Turbo C++](https://www.quora.com/What-are-some-bitter-truths-about-engineering-in-India/answer/Adhokshaj-Mishra) (often forced to) or similar old versions (incl. GCC).  
  > **username_14**: Tnx for the heads up @username_15. But I'm not sure what your point is. Some people are forced to learn programming without minimal English background, some with obsolete software.  Lots of ppl, lots of handicaps! Is there a case for "Lots of Turbo C++ in Chinese academia? After all Unicode is decades old,  but unicode  everywhere OS is still a developing subject... More pragmatically Still lot of Python 2 (and academically it's better)  
  > **username_14**: @username_15   Also if some hapless 12 year old is being subjected to C(++) in 2023, theres a bigger problem right there as compared to whether the specific C version is Turbo C!  
  
  ---
  
  ### Answer by username_22 on 2023-05-31. Score: 5
  
  I'll be provocative: English is the *lingua franca* of computer science. Ideally, every CS professional should be able to understand basic English technical texts. At a minimum, a software engineer should be able to write and read programs with English variable names and basic comments.
  
  I understand that the vocabulary of your students is limited; it is the job of the institution at which they learn to improve it to the minimum described above. If possible, the programming course should be accompanied by a 1-or 2-hours/week language course providing the specific vocabulary needed for the programming tasks. If that's not possible, fill the gap yourself. Simple English is incredibly simple, certainly from a Chinese perspective. Your students can already read the Latin alphabet. What's needed on top are a few dozen words, plus a few words of the respective problem domain for each programming task. Modern IDEs even have spell checkers.
  
  I also understand that I may be narrow-minded and have it backwards: I may live to see Chinese programmers making the same claim with respect to Chinese. But we ain't there yet, so do your students a favor and require English names for variables and functions.
  
  > **Comments:**
  > **username_14**: English is simple?!?! [See](https://twitter.com/tweetsauce/status/1132719589203169280). More seriously, I don't dispute that every programmer in the world of 2023 will be better off for better english.  I dispute that it needs to be an added burden to 10-12 yearolds  
  > **username_27**: @Rusi 10-12 yearolds, no. University students using their native language when working with established codebase (written by me, not an English native) that uses only English - absolutely. (true story)  
  > **username_14**: @username_27 don't get (parse!) your second sentence.  Absolutely what?  
  > **username_22**: @Rusi Middle school ranges from 10 to 16, I think. True, it would be wanted much for 10 year olds, but perhaps not for 14 or 15 year olds (they would really profit from a few words of English, not only in CS).  
  > **username_22**: @Rusi As to your humorous Twitter link: None of the words are needed for programming (unless they appear in the subject domain), and pronunciation (the topic of the post, and problem for many learners) is irrelevant in any case.  
  > **username_14**: This German speakers [comment](https://cseducators.stackexchange.com/questions/7757/non-native-speakers-struggle-to-come-up-with-decent-variable-names-and-function#comment21210_7758) says it all succinctly  
  > **username_11**: _"Simple English is incredibly simple, certainly from a Chinese perspective"_, not really. If you grew up learning both, then probably. But not if you're a Chinese student, the two just isn't comparable.  
  > **username_12**: If your students [can't] already read the Latin alphabet, then they're SoL. +1. I'm assuming this isn't really a problem with French or Germans, but if your alphabet is in Cyrillic or straight up pictures that don't load for me because I'm missing a font, then that's going to be a problem. *People with low command of the language unable to name things?* Correct.  
  
  ---
  
  ### Answer by username_31 on 2023-05-31. Score: 3
  
  Native English-speaking computer science students also have trouble coming up with good names!
  
  In my opinion using *pinyin* is fine. In some ways it will be helpful for new students as they will get a clue of what their code is and what language keywords and 'Base Class Library' functions, etc. are.
  
  You could look and see if there is another programming language, you could use, which supports Unicode characters in variable names.
  
  I know this is possible in C#. See *[C# identifier naming rules and conventions](https://learn.microsoft.com/en-us/dotnet/csharp/fundamentals/coding-style/identifier-names)*
  
  Sometimes you may need to start a variable with a Latin printable character for the first 'letter'. Something like an underscore.
  
  
  ---
  
  ### Answer by username_32 on 2023-05-31. Score: 3
  
  Names should be descriptive for the audience of the source code. If everyone who looks at that code understands Chinese, there is nothing wrong with using Chinese names, and if you use a programming language that struggles with Chinese characters (do such languages still exist?), you can always transliterate to latin characters.
  
  Alternatively, they can use English. In the age of machine translation, translating a term doesn't take much time. Even before machine translation, online dictionaries were a thing. Open the website, type your word, press Enter, and behold a set of translations to choose from :-)
  
  It can also make sense to mix these approaches. In many programs I have written, I used English for IT concepts, and German for business concepts (the requirements document was in German, but the software libraries we used were in English). It may look weird to mix languages, but it worked very well. After all, the purpose of naming is to clearly convey information, not dazzle the audience with your mastery of the literary arts.
  
  (What one shouldn't do in professional code is mix languages arbitrarily, switching seemingly at random. The same thing should have the same name throughout the entire source code)
  
  
  ---
  
  ### Answer by username_11 on 2023-06-01. Score: 3
  
  In my experience, it is in general hugely unreasonable to expect non-native middle schoolers to have any decent vocabulary of English. Granted, the English used in programming is not English in its entirety but it is still a lot to learn. Pinyin works fine for now, let them be.
  
  To put things in perspective, non-native middle schoolers may be tested on 1000~2000 English words. Obviously not everyone will know all of them, and even less of them well. Even if English used in programming is very limited, there might still be a few hundred words that is commonly used. Asking the students to know them well is too much.
  
  But make no mistake, English is the *de facto* standard language, and it should be made clear to them they should learn some English if they want to pursue programming further. The reasons why are innumerable
  
  ### Official documentation, books and tutorials
  
  Not knowing the vocabulary will limit the resources available to you. It is simply a fact that English resources are currently the best.
  
  ### Googling and Stack Exchange
  
  The fact that you're asking *here*, instead of say zhihu, is proof that knowing English is a great advantage. If you google in English, you get Stack Overflow. You'd be surprised how many people googled the wrong keywords, found nothing and gave up.
  
  ### Standard libraries and builtins
  
  These are not changeable and all of them relies on English. For example, in C++ it is *required* that your member functions are `begin` and `end` to enable range based for loops.
  
  ### Tooling
  
  There are tooling that relies on how English works. For example, pytest uses `test_*` and `Test*` as a signature that the objects are items for testing purposes.
  
  The list goes on. As you might imagine, software *really* **really** cares about consistency.
  
  Using Unicode characters is even worse for tooling:
  
  * Regex support for non-ascii characters is usually poor to non-existent.
  * Go (the language) uses uppercase letters to indicate exported names.
  * The way whitespace plays with different languages is hugely variable.
  * Languages going from right to left is likely impossible to work with for many tools.
  
  > **Comments:**
  > **username_16**: Sometimes I wonder why everything is in English. Then I realise, the non English stuff does not come up in by searches.  
  > **username_0**: The only thing I can add is to these words "The fact that you're asking here, instead of say zhihu..." I asked here instead of zhihu or quora is because I am an active user of SE and I think it is the best, say far better than quora, although I hate close-vote and down-votes without any comments.  
  
  ---
  
  ### Answer by username_13 on 2023-05-31. Score: 2
  
  You didn't mention what programming language(s) you're working with, but the way [PowerShell](https://en.wikipedia.org/wiki/PowerShell) names things might be helpful here.
  
  Functions have names like [`Get-Process`](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Get-Process), [`Clear-ItemProperty`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/clear-itemproperty), [`Write-Host`](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Get-Process), etc. They're all of the form "verb dash noun". There's a predefined [list of verbs](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands) that they encourage you to use whenever possible. When naming function parameters, they have predefined [lists of common parameter names](https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/standard-cmdlet-parameter-names-and-types) along with their standard meaning.
  
  PowerShell does this for the sake of consistency, but an approach like this could help a non-native speaker as well. Those lists of words can be augmented with a description in their native language. Naming something consists of selecting the relevant noun and verb from the list (substituting a native language word when needed). Over time, the students will learn the vocabulary and not need the lists any more. Since they're using the same standard words as the built-in system functions, they're also learning how to interpret those functions without needing to look up and translate their documentation.
  
  I'm not necessarily saying that you should teach them using PowerShell (that sounds quite awful, actually). You can follow a similar idea and create a naming convention for whatever language you're using. You'll have to build your own noun/verb lists, but you'll have the opportunity to fine-tune them based on your specific curriculum and assignments.
  
  Standard library functions frequently have cryptic names, but you can create a helper header/library that provides wrappers around the relevant functions using the common naming convention. My CS teacher actually did that for us even though there wasn't a language issue. It helped focus on *concepts* instead of a specific language's library syntax, simplified many interfaces, and gave the instructor a place to inject helper code that made grading easier or that simulated errors.
  
  You can strip back the layers in a more advanced course, after they're comfortable with the fundamentals.
  
  > **Comments:**
  > **username_0**: Thanks for the information. I think I will try that. BTW, it also reminds me of my Objective-C days. Apple has some guidelines for naming  https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/CodingGuidelines/Articles/NamingMethods.html  
  > **username_14**: This [comment](https://cseducators.stackexchange.com/questions/7757/non-native-english-speakers-struggle-to-come-up-with-decent-variable-names-and-f#comment21210_7758) above is worth noting  
  > **username_15**: (Many of the common PowerShell cmdlets [also have aliases](https://pvm-professionalengineering.blogspot.com/2019/10/powershell-aliases-and-missing.html), e.g., `ps` for [Get-Process](https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Management/Get-Process) (like on Linux/Unix))  
  
  ---
  
  ### Answer by username_16 on 2023-06-01. Score: 1
  
  # Some simple rules.
  
  * Design the code to be readable
    + Use the language of the domain: use the business language and natural language of the project. Most languages support unicode. e.g. `火出口` (it says fire exit in very bad Chinese: literally file exile mouth).
    + When naming things consider how they are used, over what they do: Consider what how they will look when used: e.g. `if cat.height > 3*meters then direction.set(away from cat), run(fast)`
  
  To help with this:
  
  * Actions should have verb-phrases for names. e.g. `run`, `stop`, `open`.
  * Booleans, and functions returning a boolean should have an adjective-phrase. e.g. `is running`, `is open`.
  * Non boolean objects, and functions returning such, should have noun-phrase names. e.g. `cat`, `door`, `big cat`.
  * Sometimes you will need enumerations to pass in to a procedure, these will often be adverbs. e.g. `quickly`.
  
  Most of this is general advice. However back to the non-English and English speaker. So if they can type their native language, then do that. I cannot think of a language that does not support Unicode names. E.g. these do support it: `C`, `python`, `rust`, [`scratch`](https://scratch.mit.edu/), …
  
  
  ---
  
  ### Answer by username_17 on 2023-05-31. Score: 1
  
  As others say, good naming is hard even for native English speakers.
  
  I don't think there is a straightforward curriculum to follow that makes one good at naming, or a simple criteria against which to measure success.
  
  At the stage of learning programming, when there is still plenty to learn, it might not be important for chosen names to always be great names.
  
  However, I would suggest having regular discussion about the importance of naming, and have examples of good naming schemes for pupils to consider and absorb.
  
  A pre-requisite for naming in English is to be deeply familiar with English. Exposure to a large amount of vocabulary, and examples of existing software naming schemes are also useful.
  
  To become skilled at naming, a person generally has to be interested in language, to some degree for its own sake.
  
  Some others here have also said names don't matter too much in programming. That can be true in limited cases, but as a general statement nothing could be more preposterously false.
  
  > **Comments:**
  > **username_14**: Good points! As to importance of naming: Naming is about *best-practice.* Beginning students have a hard time knowing that `else` goes with `if` not `while` (unless you're in Python!), that conditions must be parenthesized (C family) or terminated by ':' (Python).  Zillions of such minor points that experienced programmers have struggled understood internalized *and forgotten the struggle*.  
  > **username_14**: In that context a foreign unfamiliar language is a heavy gratuitous burden. In short: naming is fundamental to *software engineering.* But theres a big gap noob-programming↠ SE. See my [pianist-analogy](https://cseducators.stackexchange.com/a/6164/8837)  
  > **username_17**: @Rusi, the "while-else" is an exemplar of dreadful English naming! But yes, even with English itself, there is a process of schooling in which children learn alphabetic symbols and punctuation and all the rest of it. Meanwhile, vocabulary and word choice is largely learned from everyday listening and reading.  
  
  ---
  
  