r/AskComputerScience • u/stahl085 • Feb 10 '16
The only programming languages that I know are in english. How does programming work in other languages?
This is mostly for high-mid level languages. Can you use the same(similar) compiler? I figure syntax would be extremely different in some languages? Can someone elaborate on this topic for me please? and thank you!
17
u/panderingPenguin Feb 11 '16
Programming languages are pretty universally in English. It's one of the more commonly spoken second languages in the world, and a kind of de facto lingua franca for technical information. If you're in a technical field, you probably know at least basic English.
I studied computer science in the US, but spent a semester studying abroad in china. The CS students there use the same programming languages used in the US. They write their code in English. Normally that includes the variable names too. Sometimes they write comments and documentation in Chinese, sometimes they don't, depending on who they expect to read it.
2
u/mehum Feb 11 '16
I remember seeing some Chinese code in some Unicode-capable language (maybe Python 3) where all of the variables and function names were kanji. It was hilariously difficult to follow.
1
u/videoj Feb 11 '16
Kanji (漢字) is written Japanese.
Pinyin (中文) is written Chinese
5
u/darthpuyang Feb 11 '16
Pinyin is referring to the phonetic system of writing Chinese, the actual written Chinese is called Han Zi
2
u/anamorphism Feb 11 '16
漢字 (trad), 汉字 (simp), or hànzì in pinyin, heh. but, as you can see, it's literally the same thing in japanese just pronounced slightly differently.
6
u/Laugarhraun Feb 11 '16
Unless you code for excel, the code is exactly the same...
7
u/sefsefsefsef Feb 11 '16
The programming languages aren't "in English" to begin with. They are their own language. It would be like saying "I'm speaking English in French" when you use words like "baguette." You aren't programming in English, you're programming in C/C++/Java/whatever.
4
u/mehum Feb 11 '16
Technically correct, but can you point to any command in any programming language that is derived from a language other than English?
4
u/Laugarhraun Feb 11 '16
Well there's some Hebrew in PHP (lexer part I think) :p such as T_PAAMAYIM_NEKUDOTAYIM.
1
u/camcam369 Feb 11 '16
Well there's 'lambda' in Python. But I understand your point and I agree with you. Almost every reserved keyword (that I can think of) is in English.
4
u/MiserableFungi Feb 11 '16
There are other languages. But for all intents and purposes, they are not important enough usage wise to supplant English.
3
u/hokaloskagathos Feb 11 '16
There are some non-English based programming languages, more than you would think from this thread: https://en.wikipedia.org/wiki/Non-English-based_programming_languages
It's true though, that they are not much used.
2
u/pilibitti Feb 11 '16
There are no different programming languages for different spoken languages. Like, there are no popular programming languages aimed at people speaking Spanish, French, or Japanese. We all pretty much use the same programming languages. Native speakers of non-English languages sometimes use variable names in their own language, and that's about it.
2
u/RK65535 Feb 16 '16
Generally in modern languages the only difference is the comments, variables, etc. Programming generally is a universal language. I was looking into the history of Soviet era programming and computing 2-3 years ago, and I found that much of it was in fact written in Latin and English, with exceptions such as Rapira that could come in either a Russian or English dialect, but was the same regardless of which was used.
1
u/xiongchiamiov Feb 11 '16
Now take a look at the country of origin for the authors of those languages. Is English their first language? Often not. But all of the language constructs are in English anyways, because that's the language of technology, and those languages would've never gotten as popular if they weren't.
1
u/TwiSparklePony Feb 12 '16
I see a few other people mentioning languages written in Chinese or something. I present Piet, programs as art.
39
u/PastyPilgrim Feb 11 '16 edited Feb 11 '16
From what I understand, most people use English for language keywords (if, then, public, private, etc.). And even if you were to use a variant of a language that had keywords in your native tongue, it would just be the keywords that would change, not any major syntax or language structure.
Because so many programming languages have English origins, it's really more convenient just to learn how to read the language's English keywords because all of the documentation, demos, etc. will be in English. Not to mention all of the compilers, syntax highlighters, and so on that are tuned for English.
Now, even if someone is using English keywords, it doesn't mean that their code is in English. You would probably write variable and function names, as well documentation, in your own tongue.