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

I've heard it said (by coworkers) that everyone "codes in English" regardless of where they're from. I find that difficult to believe, however I wouldn't be surprised if, for most programming languages, the supported character set is relatively narrow.

Have you ever worked in a country where English is not the primary language?

If so, what did their code look like?

share

locked by Thomas Owens Sep 17 '13 at 9:49

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as not constructive by Jeff Atwood Sep 26 '11 at 3:14

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

14  
It makes sense to name all things code in English to make it more integrated with frameworks not even mentioning the non-latin writing languages (I should find some Cyrillic or Chineese code; that would be interesting). The question is of course: Should it be British or American English? There are parts in .net framework with British spelling while most of it is in American. –  Robert Koritnik Sep 15 '10 at 19:07
3  
Really? Where is the British spelling? The American English used to annoy me (I'm Australian), but I'm used to it now... –  Damovisa Sep 16 '10 at 2:39
55  
The problem with questions like these is that people writing English answers to your English question on this English Q&A site are probably not representative of all programmers in non-English-speaking countries. –  Larry Wang Sep 20 '10 at 5:36
3  
a code sample wonderfl.net/c/iUH0/read –  www0z0k Feb 5 '11 at 14:33
1  
@Larry Wang: True, Stackoverflow users probably aren't representative. But we work at normal companies with normal coworkers and normal (read: representative) coding rules. So I think the answer's to this question aren't that distorted. –  nikie Feb 5 '11 at 23:33
show 4 more comments

108 Answers 108

I work for a software editor in France. Code is always in English. The variables and function names are all in English even if mistakes occur sometimes. The worst mix of French and English I encountered was "connexionKey". On the other hand, comments are not always in English depending on how confortable the developer is writing English.

share
1  
While I don't know the situation you encountered, "connexion" is the original English spelling and (at least according to Wikipedia) still somewhat used. –  Roger Pate Sep 9 '10 at 10:52
1  
I think "manouever" is a misspelling. The British spelling would be "manoeuvre." (And yes, I had to look that up to be sure; I'm very good at spelling most words, but anything derived from "oeuvre" throws me for a loop.) –  Robert Rossney Sep 20 '10 at 23:11
show 1 more comment

From Brazil,

I write generic code in English but I prefer to use Portuguese when programming near to domain application. Some terms don't fit well in application when using alien words to domain. At same time, there is a clear separation between generic coding and domain coding.

share
add comment

If you talking about using a native language on programming language own statements and API, well, in this case I can say I see in the past a very popular product in Brazil derived from xBase but whole in Portuguese.

If -> Se While -> Enquanto Left -> Esquerda Create -> Criar etc

But I think this kind of languages doesn't get too much successful.

share
add comment

I'm from Serbia.

When I code for school, I almost always use Serbian comments and variable names. That code will never be read by someone who doesn't know Serbian anyway and will never be used outside of the exam it is written on and I don't see the point of using English for English's sake.

When I'm doing some coding for myself, I tend to use Serbian too, because nobody else is going to read it and I need code to be readable easily for me and not some non-existent third party. The bad side of this is that I'd have to translate source code of a program if I'm going to share it internationally, but this never happened to me so far.

When I'm writing code which other people will read, I use English and English comments. I generally do my best to make English as readable as possible and to have as little spelling errors as possible. New IDEs with English dictionaries help here.

My reason for preferring Serbian is simple: I'm sick of code which is supposed to be written in English, but looks more like Engrish (or Senglish in my case). Furthermore this so called English continues to evolve separately from English used in countries which actually speak English. This way words which are seriously outdated in modern English, or never existed in English at all keep popping up in source code and in programmer's speech and slowly find their way into technical literature. This way instead of making new words for English technical terms in Serbian, we are making new words for English technical terms in English which English users will not recognize.

share
add comment

I work in Japan.

I'd say 40-60% of code I see uses English variable/method/class names. Sometimes Japanese and English is intermixed. Comments and commit messages are almost always in Japanese.

Consequently you see a lot of code written in poor English, and it's quite bad because it hurts readability a lot. Unfortunately, code done in Japanese isn't much better, either since Japanese written in Alphabet (in particular, lack of Kanji) is tough to read.

Sometimes engineers do use 2 byte character (Kanji/Hiragana etc.) method/variable/class names (it's legal in e.g. Java) but this frequently causes great pain because of character encodings (build blows up etc.) and is usually frowned upon.

There is a lot more emphasis on English for Japanese Engineers in the Japanese job market, so I'm hoping that this situation improves soon (I code entirely in English and I believe all Japanese engineers should, too)..

share
add comment

I'm from China, and I code in English like how others did. Except I use "words for children" in some API methods, I lack vocabulary.

Imagine a API with identifiers written in German (or even Japanese) is being used in English code...

share
add comment

In Quebec, teachers are apparently obligated to show their class material in French, which tends to result in awkward Frenglish code. Many students apparently follow the lead, but I'd say most are incomfortable with such bilingual code, and in most projects people will try to stick with English only, to the best of their English knowledge.

share
add comment

I'm from Germany and I personally strictly code in english. The company I'm working at is doing projects for international customers and usually the code + comments are in english. The department I'm in though is doing a project for a german company only and most code in the core is full of german. I tend to produce new code in english and fill in english comments wherever possible.

share
add comment

I'm from Valencia, Spain and the proper answer is "depends".

For most non-public/non-OS things i do a mix of English and Spanish in variable naming, but all my comments are in Spanish and I hope noone tells me to document/comment things in Valencian

But things change when you're publishing something under Open Source, since doing it in your local language restricts your potential users and collaborators to a smaller audience.

I can give you an example of language as a barrier: When I was running a WoW guild i began to look for alternatives to EQDKP and i found them, but most had it's documentation and comments in german so i lost any interest because relying on Google Translator wasn't an option for me, heck, some of them were awesome projects.

You also asked for a code example, as i told i tend to mix English and Spanish, but this snippet is so brief that i did not need any kind of mixture

function validaDNINIE(numero) {
// Eliminar todo lo que no sea número o letra
numero.replace(/[^0-9A-Z]/i, '').toUpperCase();
if (!numero.match(/((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)/i)) {
    return false;
}
// Comprobación de NIF
if (numero.match(/^[0-9]{8}[TRWAGMYFPDXBNJZSQVHLCKE]{1}$/i)) {
    var letra = numero.charAt(numero.length-1);
    if (letra == "TRWAGMYFPDXBNJZSQVHLCKE".charAt(numero.substr(0, numero.length-1) % 23)) {
        return true;
    }
}
// Comprobación de NIE
// T00000000
if (numero.match(/^[T]/)) {
    if (numero == numero.match(/^[T]{1}[A-Z0-9]{8}$/)) return true;
}
// ZXY
if (numero.match(/^[XYZ]{1}/)) {
    // X = 88, asi conseguimos X=0;Y=1;Z=2
    var su = numero.charCodeAt(0)-88 + '' + numero.substr(1, numero.length-2);
    if (numero.charAt(numero.length-1) == "TRWAGMYFPDXBNJZSQVHLCKE".charAt(su % 23)) {
        return true;
    }
}
// Si hemos llegado aqui es que el numero no es valido
return false;
}
share
add comment

I do know that (at least back in Excel 5.0) the entire object model of Excel is/was localised in VBA macros for languages such as Spanish. So you dealt with CuadroTextos instead of TextBoxes for example. Visual Basic is still English though, so VBA programming is done in a kind of pidgin English.

share
3  
This was the most idiotic thing Microsoft ever did. We got into huge problems on a project once because we tried to merge code written in Access. Some had English localized versions and some had Norwegian localized versions. –  Adam Smith Sep 20 '10 at 8:16
show 1 more comment

I'm doing software development for more than 20 years now and with many different languages. But all those languages have one thing in common: the keywords, function names, etc. are in English. So I choose English as my language for all my identifiers etc. too. So it's simply more fluently to read.

In the beginning I commented in my native language, German. But one the net and OSS became more and more interesting I even switched commenting to English. So a larger community has the chance to read, understand, use, and improve my code.

mue

share
add comment

I am from Israel. I work as a consultant for companies so it's fair to say I have seen hundreds of coding methods, coding systems with different technologies and languages.

every single one of them, even if it was a hebrew client side, the back-end was written in english, the variable names were english the method names were english like

checkIfCustomFieldsHaveAttachments(customField:CustomField):void

and so on and so forth.

personally, I am using english to code all of the time, I never use anything else.

share
add comment

Bolivian coder here - 100% of our code is in English, comments and variables. Why decided upon this because

A) By not using English you are essentially cutting off help from a very large pool of professionals

B) The vast majority of programmers know English to some extent.

share
add comment

I'm Norwegian, and while I've met many people coding in (and seen lots of code in) Norwegian, I only code in English. This question was brought up on StackOverflow once, and the reason I gave for only using English es consistency (getAlder() seems weird) and the question of what to do with our three special characters æ, ø and å (getKjøretøy() might not work in all languages). According to friends of mine, at least one large public project is coded in a combination where the technical terms are in Norwegian.

I don't speak a word of French, but when I was learning PHP and Mysql I read a tutorial (in English) which was obviously written by a French programmer, because all the variable names were in French. When I copied the example into my project, I couldn't be bothered to change the variable names, and I stuck to those names for a very long time, so most of my Php code was littered with French variable names.

share
add comment

I'm russian, here we code in MSVC++, this is what the code looks like:

    #include "stdafx.h"
#include <iostream>

использовати площадь какобычно аминь1

наместе двояко провѣрятичегоглаголют молчаливо
кагбе
    ѣжѣли получалка.сломалася молчаливо тогдауж 
    кагбе 
      молвити "Не лепо молвишь, барин!" аминь1
      возвѣрнути нуль спасихоспади1
    ага
    возвѣрнути один аминь1
ага

цѣло голова(цѣло количество_указов, глаголют указы[])
кагбе 
  дваждыточно первыйсундук, второйсундук, отвѣт аминь1
  буквица знако спасихоспади1
  творити 
  кагбе
    молвити "молви первый цифирь, барин: " аминь1
    получити первыйсундук аминь1

    ѣжѣли провѣрятичегоглаголют молчаливо еси ложъ тогдауж прѣрвати спасихоспади1

    молвити "молви деяние, барин: " аминь1
    получити знако спасихоспади1

    ѣжѣли провѣрятичегоглаголют молчаливо еси ложъ тогдауж прѣрвати спасихоспади1

    ѣжѣли знако еси 'q' тогдауж прѣрвати аминь1

    молвити "молви второй цифирь, барин: " аминь1
    получити второйсундук аминь1

    ѣжѣли провѣрятичегоглаголют молчаливо еси ложъ тогдауж прѣрвати спасихоспади1

    избирати знако 
    тогдауж  кагбе
      выборъ '+' сталобыти
        отвѣт буде первыйсундук да второйсундук аминь1
        прѣрвати спасихоспади1
      выборъ '-' сталобыти
        отвѣт буде первыйсундук бѣзо второйсундук аминь1
        прѣрвати спасихоспади1
      выборъ '*' сталобыти
        отвѣт буде первыйсундук повторити_столько_сколько второйсундук аминь1
        прѣрвати спасихоспади1
      выборъ '/' сталобыти
        отвѣт буде первыйсундук убрати_столько_сколько второйсундук аминь1
        прѣрвати спасихоспади1
    ага

    молвити "Отвѣт есьм: " аминь1
    молвити отвѣт да_промолчати спасихоспади1

  ага
  пока (истино) аминь1

  возвѣрнути нуль спасихоспади1
ага
share
show 1 more comment

I'm from Brazil and in all the jobs that I had most of the code was written in Portuguese. Variables, classes, methods etc. Most of the programmers and other people don't speak english.

Here is some code:

function buscaFotosMateria($idMateria) {

        global $conexao;

        $consultas['Materia']['pegaFoto'] = "SELECT * FROM sgc_materias_fotos";

        $params = array();
        if($idMateria) {
            $consultas['Materia']['pegaFoto'] .= " WHERE mfot_mate_iden = ?";
             $params[] = $idMateria;
        }

        $conexao->executaConsulta($consultas['Materia']['pegaFoto'], $params);

        return  $conexao->resulConsulta; // VARIÁVEL DE INSTÂNCIA DA CLASSE QUE ARMAZENA RESULTSET DA CONSULTA REALIZADA
    }
share
add comment

I'm french and working in Germany, in research (physics). My codes are using mainly english words, but also french ones here and there, and even sometimes from other languages, especially when the word is shorter there for instance. As for comments, I usually write them in french if they are supposed to be temporary, during the coding, and in english if they are supposed to stay permanently and help a possible reader. But sometimes temporary comments stay longer than expected, so there is language mixing there as well.. Anyway, probably I would uniformize all this if my codes were shared with other users/programmers. It really depends on the environment: in my research work & team, people exchange more their ideas, results, .. than their codes themselves - codes are sometimes specific to a project, sometimes not to the project to the programmer - this works up to a certain level of coding complexity, I heard of some codes (or "families of codes") shared by dozens of labs and evolving since years, these are surely only in english.

share
add comment

I worked in a Japanese software company for a while. The code, including variable and function names, was all in English. Comments and inline strings were in Japanese. Occasionally the function names were poorly translated, which made programming ... interesting... at times.

share
add comment

I'm from Mexico, and I personally never use Spanish for anything, even my own hobby projects (because I figure maybe someday I'd like to share the code or ask buddies to help out). I generally oppose to anything but English when it comes to tech stuff. One major pet peeve of mine is when companies use Spanish (in my case) as the default lang in their software... Apache (Tomcat) does this, so does Google. E.g., if (in the case of Tomcat) you're looking for more info on an Exception in Spanish, you're likely gonna get less results compared to the English description of the Exception. Same with Google, results in Spanish pretty much suck if you're looking for almost anything (lousy websites, outdate info...) Facebook and many open source apps do some horrible translations, too. Also translations might not fit everyone's needs. In Spain a 'file' is normally a "fichero" while in Mexico it's an "archivo"... Other Latin American countries have their own variations too.

It may sound a bit harsh for some people, but in my opinion coding in English is a "best practice". It's not a matter of xenophobia or racism or nationalism; it's a matter of scope and standards. English is generally accepted as an international business language, and it works. This has of course its own disadvantages (like bad English comments or specs gulp!), but I think that it's got more advantages.

One gem that I can remember was an error message that said:

"An error has happened!" (Mex code)

Indian code is also good stuff for a healthy laugh... Nobody's perfect, but the important thing is that we can understand each other (internationally speaking) instead of bringing more mess to our code.

share
add comment

My primary language is English, but I frequently misspell in British English. Does that count? :D

share
add comment

When I was at university in Switzerland I worked on a Modula-2 project, where everything (variables, comments, messages, etc) was in French, except for the keywords of the programming language. They also told me there were preprocessors available that would allow you to write the keywords in French as well, so "si" = "if", "alors" = "then", "sinon" = "else", etc.

share
add comment

I'm Hungarian, working in my home country with a team consisting mostly of fellow Hungarians. We always write our code and comments in English, since that is the official language of the company anyways. In addition to that, some of our projects are open source, which really mandates that everything is in English.
This has a funny side effect, by the way: sometimes my mind stays in "English mode" after work and I keep thinking in English on the way home.

share
add comment

I am Indonesian currently living in Kuwait.

In the first year of my computer science studies, I used Bahasa for almost everything except int main(). But I noticed that some of us code in english already.

All of our programming books are in english. I find it very difficult to find words in Bahasa that are equivalent for programming terms. So instead of using half-english-half-bahasa language, I (and most of my friends) started to make every possible effort to code in english.

In my first working experience in Jakarta, Indonesia, I was obliged to code in english.

share
add comment

I am from Denmark, and even though many of the technical terms translates nicely to danish, it is the norm to use the english terms (though some tend to ONLY use the danish terms, but I guess you see them everywhere).

Personally, I code in English; Meaning that all my comments, my variables, classes and so on, are in English. I do this because it makes it so much easier. If I want to make my code public, everybody can read and understand the program. If I am going to help out a friend with a code-example, I don't have to translate the comments beforehand.

share
add comment

In PHP the :: operator is called Paamayim Nekudotayim which is hebrew for double colon. The rest of the langauge is in English. The first time I saw that error message about half of my office kind of confused us. And that was at a company in Israel

share
add comment

In the Visual Studio editor, most of the places we deal with non-English bugs are in comments, and they are most east-Asian languages (Input Method Editor (IME) related). I'm pretty sure I just saw one the other day where right-to-left text in comments displays incorrectly in quick info or parameter help, so there are certainly people doing it :)

share
add comment

I (dutchy) always code in English, it just makes much more sense, all the language keywords, etc. are in English, so why not code the rest in English? :)

I always put all comments in English as well. You never know who will have to edit your code, they might not speak your native language.

share
add comment

I'm from the rotten state of Denmark. We primarily write code in English. Even the development guideline states that it should be as well. Being the newest developer in the company I assume that it was decided due to the framework we are using was done in English. It would be a horrible mess to read mixed Danish and English :)

With that said, we do write comments in Danish :)

share
add comment

I worked with a 20-person team in Lima, Peru for several years on a classic ASP project. This was 10 years ago, so conventions may have changed, but at that time, all of the comments and variable names were in Spanish.

share
add comment

I'm from the Philippines. Most people code, document, and name variables in English here. Also, I find English to be one of the most suitable language to use in programming because it has richer vocabulary than most languages out there.

share
add comment

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