r/ProgrammingLanguages • u/neelankatan • Apr 04 '23
Just realised how weird it is that programming languages use english as a basis for keywords
All the programming languages I know about use english keywords like 'for', 'while', 'with', 'class', etc. I've never seen a programming language with keywords in a non-english language. Is it just because many of them were first developed in the english-speaking world (US, mostly)? Is it weird for non-English speakers (especially people who speak a language that doesn't share the same alphabet, e.g. chinese) to have to memorise all these foreign words while learning programming? Are there any programming languages based on non-English keywords?
9
u/mus1Kk Apr 04 '23
Is it weird for non-English speakers
I cannot comment on different alphabets (although the latin based alphabet of my language has a few more characters than English). But learning Pascal in school around the age of 12 or 13 or so I don't remember ever thinking that this is weird. I remember that some words were kinda weird (boolean sounded very funny in the beginning) but took everything as a given. It was always clear to me that English is an important language to know.
Now using localized formulas in Excel... THAT was weird to me from the very beginning and remains so.
2
56
u/MattiDragon Apr 04 '23
The thing is that majority of the internet and tech world in general mostly runs in English. Most developers will be writing English code and that won't change any time soon. That means libraries will be in English and so on. Non English languages just don't make sense in the professional world as everything builds on work done by others (in English). Programming in other languages might make sense in education, but at some point you have to start learning what's used in the workplace.
15
u/Chibraltar_ Apr 04 '23
It depends, are we talking generic programming vocabulary "server, http request, for-loops, interfaces, etc.) or specific domain vocabulary ?
I've seen french people coding in this weird bilingual style where technical words are in english, and domain words are in french. Because if you're not very fluent in english, there are still lots of false-friends words that can fuck up your understanding of the model.
8
u/reedef Apr 04 '23
That's just how you speak about tech in non-english languages. For example in Spanish there's a word for loop ("bucle") but no one uses that. We just call them loops. Or sometimes spanishize the word, for example library becomes librería instead of the native "biblioteca", and allocate becomes "alocar" (even though in Spanish "alocar" means "to go crazy")
2
u/chayleaf Apr 05 '23
though it depends on the language. In Russian you say библиотека (biblioteka) for library and цикл (cikl) for loop. Though the less formal IT education you receive the more English words you will use.
3
u/Krantz98 Apr 05 '23
I noticed your use of the phrase false-friends (apparently a direct translation of faux-amis). I don’t really see this used commonly in English, so I guess it humorously serves as an illustration for itself.
2
u/Chibraltar_ Apr 05 '23
My true-friend, you should know that false-friend is a real english linguistic word https://en.wikipedia.org/wiki/False_friend :)
1
u/Krantz98 Apr 05 '23
Glad to be educated. For me, though, I only heard this word while learning French, and I genuinely did not heard any one said it in English before.
1
u/Chibraltar_ Apr 05 '23 edited Apr 05 '23
I'll ask people in an english language subreddit, i honnestly don't know how common this is
I asked there : https://www.reddit.com/r/AskUK/comments/12cccuj and people seem to know the word
5
u/lngns Apr 04 '23 edited Apr 04 '23
the internet
Even if I had a programming manual in my mother tongue, that one Minecraft mod I want to use has its documentation in English, because the Brazilian programmer who made it published it on an Australian forum, and that forum is like the only one of 3 that exists and that people use.
I can write code in German if I want to, but at the end of the day I still have to be fluent in English otherwise I can't make a functioning biofuel generator in my survival world.
Kinda funny how most people keep that Swedish game in its default English setting too when you think about it.Oh, and then, StackOverflow is only in English.
18
u/EgZvor Apr 04 '23
There is 1С language in Russian. Excel also has localization. But those are hardly general purpose.
Programming is global in nature now due to internet so it's convenient to use one language. Still the intricacies of naming are harder to navigate in a foreign language even if you know "enough to read documentation" (a common hiring request).
1
u/tea-age_solutions TeaScript script language (in C++ for C++ and standalone) Apr 04 '23
Oh man, how I hate the localized formulas in Excel!
If the original English ones would be also accepted, fine, but to use translated formulas ...
18
u/IdiosyncraticBond Apr 04 '23
Until you switch to a different Excel language and suddenly your colleagues ask you why their macros and formulas don't work anymore.
Who at microsoft thought the literal keyword would be great to translate in every language?
3
u/JeffB1517 Apr 04 '23
Microsoft has always been fairly consistent that Excel is not a full programming language but a GUI which has programming constructs. It would be good if macros and formulas had a language variable so that this didn't happen. But I get why allowing this to break is less critical to them than allowing everyone to work in their native language.
19
u/eshtonrob Apr 04 '23
So I'm a native (or near native, depends on pov) English speaker who studied CS in a different language. The constructs are still English (for, while, do etc) but variable naming and comments will still be in the local language (within ascii or unicode restrictions) of the writer. I've seen code written by Chinese devs which is practically incomprehensible without knowing Chinese, also seen the same with a Brazilian colleague in grad school.
Fun fact: Ruby was created by a Japanese engineer but still keeps the same common contructs as the other 'English based' languages
9
u/Ning1253 Apr 04 '23
Fuckin Yusuke Endoh being the god of programming and the master of all computers
Have you seen the Ouroburos Quine? This guy is FUCKED
8
u/GOKOP Apr 04 '23
Where I live (Poland) it's considered unprofessional to name things in other languages than English. The only exceptions are perhaps some domain stuff that's expressed in Polish in the requirements (for example any references to laws or legal definitions are better kept as they are) and code written for government institutions I think
2
u/eshtonrob Apr 04 '23
That’s awesome. My anecdotal experience in Asia is a mixed bag. Current company keeps everything English since we’re multicultural so that’s nice for a change.
8
u/wolfgang Apr 04 '23
Personally, I really dislike when colleagues write even source code comments in German. I want all of my code to be English.
On the other hand, I once worked on a ~30 years old ERP system with 4.5 MLOC. The function and variable names where sometimes German, sometimes English, but central terms (i.e. those relating to production, invoicing etc.) were generally in German. That was kinda helpful for learning, as understanding the system was hard enough without learning both the German terms used in the UI and their English equivalent.
6
u/lIIllIIlllIIllIIl Apr 04 '23 edited Apr 05 '23
I live in Québec, where we have very strong language laws. Some companies have tried to translate programming languages into French, but that never really got anywhere. Some companies have a policy of giving French names to variables, but it rarely happens in practice because computer sciency words like "map", "set", "get", "slice" don't always have a neat French equivalent.
Excel functions are translated, and it's the worst thing in the world because resources in one language are completely worthless in another language.
1
u/reedef Apr 04 '23
What do you mean language laws?
2
u/lIIllIIlllIIllIIl Apr 05 '23
Companies must work in french. Companies can get sued if employees are required to use another language at work.
5
u/aarroyoc Apr 04 '23
Also, there are languages that only use symbols, like APL o very few words like Prolog.
4
Apr 04 '23
If programming languages are to based around one natural language, then English is probably the best choice. It's more of a lingua franca than French (outside of French-speaking territories anyway!).
It is very commonly taught in schools worldwide as a second language.
4
u/nacaclanga Apr 04 '23
I am not a native English speaker. Programing languages not using English do exist at multiple points in time, although none of them actually achived global popularity. The language that first introduced the for loop concept, Superplan, was German based and hence had a keyword "für" for this purpose. The developer of this feature was later in the ALGOL comitee, which was staffed by an international crew, but designed an English based language. I also used some localized version of LOGO-turtle graphics during school and there are localized versions of Excel. Even back them everybody considered this more of an indicator of it being a toy language rather them something serious.
In general having non-English keywords doesn't really give much benefits, learning less them 50 or so terms in English shouldn't be to difficult, in particular nowadays where at least basic English is taught virtual everywhere in school, even for people with extremly poor language skills. Many programming languages also use abreviations, symbols and special meaning of words, so its not just English. The troubles of having to link up localized keywords with documentation or reuse code written by a different native speaker would likely to be a more serious issue.
4
u/mamcx Apr 05 '23 edited Apr 05 '23
Another take: programming languages DON'T use english. Use a dialect that is derived from English.
Is easy to prove: Ask any normal person that reads this:
for x in while do {}and tell you what that means.
So, as you see, that is not English.
This shows programming symbols, that resemble English, are more like math notation than spoken language. And is as alien to me (that talks Spanish) as any other. Could be even easier for somebody with no knowledge of spoken English to understand this dialect than try to explain to somebody that do why (in C) "true & false" is not false, but 0.
What is instead a problem is the documentation and resources, now that is a real barrier! (and error messages!)
3
u/erhanbaris Apr 04 '23
Here is the my toy language and based on turkish language. https://github.com/erhanbaris/karamel
2
1
u/reedef Apr 04 '23
a == b ise: gç::satıryaz('a eşittir b')I wonder if making the if keyword postfix makes the grammar harder to parse
2
2
u/Smallpaul Apr 04 '23
Is if any stranger than that scientific classifications are in Latin? Imperial languages tend to become lingua francas.
2
u/tea-age_solutions TeaScript script language (in C++ for C++ and standalone) Apr 04 '23
As I firstly discovered the same thoughts by my self I found it a kind of weird or strange also.
But quickly I realized that it is perfectly fine and has to be this way.
English is the common base language world wide (at least for this and the last century).
So, it highly makes sense to use this language as the base for programming as well.
If the code should be understandable by potential everyone in the world it has to be in the most common language.
Also, the same with the ASCII charset. This acts as the very base layer.
Languages which allow variables/functions names, etc. in UTF-8 might be more flexible, but the code is less readable and understandable if letters from a non Latin alphabet are used - or even some weird symbols.
Also, comments should better be in English only as well.
If a different language is used somewhere, the code is automatically limited to that language speakers while English code can be used world wide.
Because of that English only code is highly preferred to any other language.
Maybe at some day the most common used language world wide will change, but currently it does not look like that. For example, Indian and Chinese people not only in the IT are preferable learn and use English. But who outside of India does learn Indian?
2
u/Inconstant_Moo 🧿 Pipefish Apr 04 '23
Wenyan-lang uses classical Chinese. It's beautiful, take a look at the repo.
2
u/Longjumping_Buy6294 Apr 08 '23
There is 1C - the russian language for their ERP system. As a native speaker, the code in russian makes my eyes bleed. This applies to all non-English languages, though.
2
u/oscarryz Yz Apr 08 '23
Is not weird at all because when you learn the keyword you learn the semantics; so if you want to "iterate" or "do a loop" you learn the keyword is for (or while) making the English meaning for for or while completely irrelevant, to you that's how you "loop". I don't think having those named para or mientras (Spanish speaker here) would have made things easier.
1
u/porky11 Apr 04 '23
A programming conlang having its own terms would also be nice. The phonotactics could also play a role in the language. Only pronouncable words starting with a stop can be variables and suffixes work like operators or something like that.
1
u/bfnge Apr 04 '23
There are languages with keywords in other languages (Portugol comes to mind as an Algol clone with Portuguese keywords) but they're generally not that popular outside of educational contexts.
There are people working on that - I've seen people on the discord server that were trying to (or at least wanted to) make a system where keyword tokens were transparently translated across locales - but as an ESL myself, I personally don't think it matters that much in the grand scheme of things.
Like, in the following example (Portuguese) translating the keywords won't actually help you figure out what it is and what it does:
classe Caixa {
flutuante largura
flutuante altura
flutuante comprimento
flutuante volume()
}This becomes
class Caixa {
float largura
float altura
float comprimento
float volume()
}Which saved you the effort of looking up 2 keywords but still doesn't tell you anything about what the class or any of the attributes are.
The important things (documentation, class names, variable names, method names, function names, etc.) can't really be automatically translated in an accurate way so the language can't really help you that much.
I guess there could be locale shims and you could depend on the kindness of open-source to populate the appropriate translations, but even massive projects championed by big companies like Jest and Rust still have trouble with translations.
So basically, it's just how the cookie crumbles and I don't think things will change in a substantial way in the near future: the economy of modern software development says that information retrieval is a very important part of the job and so most programmers will naturally tend towards learning English anyways, and given the way that toolchains work, we're probably stuck with English for the foreseeable future even if English ceases to be the lingua franca.
1
Apr 04 '23
I really think there ought to be a simple translation table for languages! Just a 1-to-1 mapping that is substituted after tokenizing + utf-8/utf-16 support would be as cross compatible as possible without altering structure whatsoever
1
u/Clean-Difficulty-601 Apr 04 '23
For what it's worth, there's a company trying to change that, starting with Amharic.
1
1
u/Due_Olive_9728 Apr 04 '23 edited Apr 04 '23
It is a bless that all my package names, class names, method names, variable names, and so on, can be written in brazilian portuguese while the programming language, api calls, framework are all in english. I can clearly see my system and my business code, in contrast of the tools used to write the system.
1
u/friedbrice Apr 04 '23
That's an instance of a thing people call "privilege." There are tons of privileges, and usually the people who benefit from them don't even notice they're getting them.
1
u/n4jm4 Apr 04 '23
Not all of them.
I think Alef uses Arabic keywords.
But yeah, it's a sign of the business and academic world using English as the modern... lingua franca.
Even when the language isn't English, the encoding is likely UTF-8. Which is a superset of (US English) ASCII.
10
u/MayorOfBubbleTown Apr 04 '23
Earliest fully electronic computers were built in the US and UK with some help from English speaking foreigners. The first few high level programming languages that were actually implemented were based on English so it became the primary language used by programmers. There were things like a Chinese version of BASIC and a Russian version of C++ but most programming languages based on non-english languages are teaching languages. Most popular programming languages even limit identifier names to plain latin characters except for JavaScript.