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?

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.

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 KoritnikSep 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...
–
DamovisaSep 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 WangSep 20 '10 at 5:36

@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.
–
nikieFeb 5 '11 at 23:33

@Lorenzo method like isUtenteCopy is a must here in italy, lol!
–
systempuntooutSep 9 '10 at 7:13

13

That's one of the reasons I'll never work in Italy..
–
Andreas BoniniSep 9 '10 at 13:15

3

I've just ran into a fellow developer yesterday who happened to work on some international firm, they are adding some features to a system that it was build by and for an Italian telecom company. Unfortunately they almost code everything in italian, that includes variables, methods names, comments, and even logs!!Even during some sort of a handover session only one developer from the Italian team could speak English well enough to walk the folks through the code.. Anyway, it seems Google Translator is getting great reputation in my friend's team now :D
–
Shady M. NajibMay 17 '11 at 12:01

I'm French. As has been pointed out in comments, my countrymen tend to exhibit an above-average pride in the national language :-). I take a pragmatic position on the issue myself:

I speak the language that the target audience will most likely understand. When coding open-source software with a global ambition, I use English. For less widely useful stuff (for instance, my Emacs configuration file), I might use French.

I acknowledge the fact that not everyone will master English. In that perspective, using my mother tongue might actually make my code more accessible instead of less (in the example above, nobody cares about an umpteenth .emacs, except if it happens to be written in a language that they understand).

Better to write good French than bad English. I actively discourage my subordinates from writing half-assed English especially where concision matters, eg in docstrings and version control commit messages.

And then someday your company gets bought out by foreigners who have to browse through your code. Yeah, it's not that much fun having to go through our French colleagues source code...
–
CarraMar 6 '12 at 14:38

7

Even though I don't know a word of say Vietnamese, if my choice is between reading code with correct Vietnamese comments, or "English" comments that excessivly broken and ambiguous, I'd strongly prefer the former. It is possible for me to use multiple automatic translations, a Vietnamese-English disctionary, and/or a human translator to understand the Vietnamese, but the intended meaning of the ambiguous broken english may well be lost forever.
–
Kevin CathcartApr 13 '12 at 17:29

I'm from Egypt. I think we switch to English by default when we talk, or even think about code. Most of the learning resources - regular ones like books, and even blogs, podcasts and so on - are in English. Switching to your mother tongue means turning your back to lots of great resources.

Being from the US, I hate to admit it but the 'Ugly Americans' still hold a lot of cultural influence in our country (to the detriment of us all), especially in business. Just like racism, sexism, etc... cultural progress in the states is measured the same as it alway has been. One generation at a time.
–
Evan PlaiceSep 11 '10 at 9:45

For those who don't speak Russian or are too lazy to look up the translation, Товары is Items; Непонятно, Unknown; Книги, Books; Тетради, Notebooks; Карандашы, Pencils, and Всё is All. I only note this because speakers of Romance languages tend to be able to muddle through other Romance languages, and I think Slavic languages tend to be underrepresented in the West (I have Polish heritage). I also assume that that 3 should be a 4.
–
Jon PurdySep 16 '10 at 0:25

19

next time I need to obscure my code I'm using Cyrillic.
–
Talvi WatiaSep 23 '10 at 7:41

6

I'm Russian, but I hate code member names written in russian. Who said that I will support this code all the time? May be tomorrow I'll be fired, and on my place will be somebody from other country.
–
GeniusFeb 11 '11 at 9:47

1

@JonPurdy In Poland there is no Cyrillic, we use Roman alphabet with few specific letters, e.g. "Dzień dobry"
–
psurMar 6 '12 at 9:12

Spain has a traditional problem with foreign languages. Spaniards younger than 40 are supposed to know English from school but the plain fact is that the level of English is close to zero almost everywhere.

So there're basically two type of software environments: code that's supposed to be shared with international parties (open source projects, Spanish offices of foreign multinationals, vendors who sell abroad) and code that's sold locally. The former is of course written in English but the latter is normally written in Spanish, both variable names and documentation. Words in variables lose accents and tildes as required to fit into 7-bit ASCII (dirección -> direccion) and English bits may be used when they represent a standard language feature (getDireccion) or a concept without an universally accepted translation (abrirSocket).

It happens that the Spanish word for year (año) becomes the word for anus when you remove the tilde. I don't have any problem with writing ano but most other programmers avoid it at any cost and produce all sort of funny alternatives like anno or anyo :)

It would be of no surprise to me whatsoever that the french would program in french... (not that i'm saying they hate speaking english, but, well, i think that is what i'm saying...)
–
David_001Sep 9 '10 at 10:11

8

Being a professional programmer who hates English is not really a sustainable position to be in :-)
–
DomQSep 9 '10 at 11:27

As an American who once spent about a month in France, I'd actually like to contradict the "French Hate Speaking English" stereotype. My experience was that I'd start talking in French, and then we'd often wind up switching over to English with little social friction. The attitude seemed to be "Thank you for attempting to learn my language; I appreciate the effort. Unfortunately, your French really sucks and my English doesn't, so let's use that, as I don't want to be here all f**king day." Probably worth noting that 1) I wasn't in Paris and 2) this was back in '94.
–
BlairHippoSep 16 '10 at 15:46

6

@BlairHippo: as an french citizen who moved, I encounter the stereotype (and suffer from it) very often. My explanation is that (and I hate to generalize) people are too proud to show their lack of skills in english. If you are addressing them in native english (or american), you are getting a huge unfair advantage. By starting with french - especially if it's bad, you show that you won't be judging them if they have bad english, since you dared showing your bad french. Most french people who know english are very likely to use it for showing off :)
–
GauthierDec 20 '10 at 10:22

I'm from Sweden and both me and my colleagues code in English. I think this is a good thing, but sometimes it can be difficult to come up with English equivalents to customer specific terms and expressions.

My reasons for writing code in English:

Allmost all programming languages I have ever used have been written in English (mixing languages would make the code harder to read for me)

Most popular frameworks and third party extension are written in English (again, mixing languages would only be a distraction)

Swedish characters (åäö) are usually not allowed when naming variables and functions

If the other team members are from different countries we can still collaborate

If I need support from a platform vendor it is is much easier for them to help me if they can understand my code

I visited Sweden on time in the 1980's and was amazed that just about everyone I met spoke good English ... including shop assistants and taxi drivers. You guys rock!
–
Stephen COct 19 '10 at 14:52

3

+1 for "it can be difficult to come up with English equivalents to customer specific terms and expressions"... And I also agree with Stephen C when he says Swedish people speak good English...
–
pgrasFeb 11 '11 at 12:12

Do you think you could reformat your answer so that it can be seen without using the horizontal scrollbar?
–
Sandeep DattaSep 9 '10 at 9:52

9

+1 My team has people from at least 7 different languages. English is the only way to go - even for gossiping :)
–
AmarghoshSep 13 '10 at 7:18

2

My Indian colleagues and I occationally have a laugh about many Indians speaking Hinglish. It's mostly English but noticably different. English code tends to be very good whereas documentation brings out some excentricities.
–
Sir WobinFeb 11 '11 at 9:24

That comment indicates to me that they also don't know the language they're programming in very well, though - I don't think the comment would be any more useful in perfect French.
–
yatima2975Sep 20 '10 at 14:26

1

ugh.. and having to fix typos in variables and filenames is the worst. summerytransfarsucess just to name a few...
–
Talvi WatiaSep 23 '10 at 7:46

I am from England, and I try to code (and post on sites like Stack Overflow) in US English, because that is the established international language for programming.

I think I am in the minority though. Some British programmers I know insist on using British spellings even when collaborating with other coders who are using US English and can get upset when an American or Indian colleague edits their comments to change from British to US English (don't try that on Ward's wiki.)

Likewise - I'm English and generally use US English when programming. I still want a "Colour" property that's just a synonym for Color, but other than that I've got over it. The fact I was taught Oxford-style -ize rather than Cambridge-style -ise makes it easier anyway.
–
Richard GadsdenSep 9 '10 at 10:44

7

I use British spellings everywhere, for no better reason than because I can.
–
Dan DyerSep 12 '10 at 14:35

2

I use British (read: international) spelling everywhere but in code—much to my own chagrin—for consistency with, somewhat ironically, international de facto standards.
–
Jon PurdySep 16 '10 at 0:27

1

@Jon it doesn’t seem then that British is quite so international as you would have us read.
–
nohatOct 6 '10 at 17:50

4

I know colleagues who write in British English just to annoy American colleagues.
–
Sir WobinFeb 11 '11 at 9:28

I live and work in the Netherlands, but all the code we write is in English. Here are some reasons I can think of why we code in English:

The .NET framework we work with is in English. It's always better to follow conventions of the framework you're working with and I believe this includes the language.

Dutch is a horrible language for describing technical concepts. English has words that can accurately describe something technical, e.g. a piece of software, but many of these words have no Dutch equivalent. The word "interact" is an example of this; there's no commonly used Dutch word that conveys the same message.

A small percentage of the company doesn't speak Dutch (yet).

The only reason I can think of why you would not code in English, is in the context of domain-driven design. Practicing DDD includes defining a ubiquitous language with your client. If your client demands the use of non-English terms, it would be unwise to translate these terms to English in your code; it defeats the purpose of the ubiquitous language.

I don't agree that Dutch is a horrible language for describing technical concepts. It is just that nowadays most technical texts we read are not in Dutch so we are not used to the Dutch equivalent of technical terms any more. But for the rest I agree with you. The framework is already in English and who knows that your code might ever be read by someone who doesn't speak Dutch. So it's usually company policy (also documentation). But this is not really specific to the Netherlands.
–
Matthijs WesselsSep 9 '10 at 8:56

I have never seen anyone use non-English names in code here in Israel, but my experience is limited to university projects. At any rate, I personally only code in English, and I actually also type all my emails and homework assignment in English. This is mainly because Hebrew is written right to left, and it can be very annoying incorporating English terms into the text.

I'm from Germany and I write my class, method, variable names all in english and I think most of the people do this as well.
But in comments it depends on whom I'm working with.

And I have to admit if I see code written in some other language than english I really hate it cause you can't "read the code". It's like if someone would write a sentence in german mixed with english.

A other reason you definitely should use english when coding is that API calls and language specific calls are always written in english. So why switching languages? I would even say using english helps you thinking cause you don't have to switch languages.

Also all those documentations and most questions and answers on the internet are in english so IMO you HAVE TO work in english anyway.

I'm from Slovenia and I code strictly in English. I have seen different programs coded in Slovenian because the client demanded so. Apparently it's easier to read the code like that.
So yes, people don't only code in English.

If you're talking about naming objects, yes, we do that in English. Usually students name their objects in Italian for learning purposes. But personally I find it difficult and prefer to use English, since some technical terms are extremely awful in Italian.

For exceptions I prefer using English messages. It looks better and you have to deal with English exception-messages from frameworks anyway.

For GUI texts I am more agnostic. It is a more elegant solution to write everything in English and use a localization solution to translate to Danish, but it is a lot of work for an application that will only ever be used by Danish users.

I'm Italian. I usually use English for everything(*), but when I was writing web stuff I couldn't manage to use English for database objects. Having to translate concepts between a "program language" and a "documentation/URL/UI/customer language" adds too much burden. Besides, sometimes your database objects take their names from bureaucratic terms that are hard or impossible to translate. So I used Italian for database objects and anything related to that. Comments were also in Italian, since they refer to those same objects and it would sound awkward (many English technical words do not exist in Italian, but DB is a field where the lexicon is pretty complete).

However, when I wrote class libraries meant to be reused, I strictly used English, for all of classes, variables, and comments (except maybe the toplevel comment, which had code samples and was bilingual).

(*) one exception: I consistently name my dummy variables pippo and pluto ("Goofy" and "Pluto") rather than foo and bar. :)

Yeah, we do. I'm from Uruguay and we usually code with variable names in English. Some people leave comments in Spanish, but I find that a bit awkward. In a previous job we were forced to use Spanish for variables and methods, and I hated it.

I have found that the best compromise is to leave the business terms in Spanish and everything else in English, because Spanish business terms might not translate well, specially when the programmer does it. I do things like: getPromotorFactory() all the time. It looks weird, but if the style is consistent, I find the code is easier to understand by other developers in the same company.
–
Sergio AcostaSep 9 '10 at 6:59

I am currently in the Netherlands, but coming from Russia originally. 11 years ago, many programmers in Russia didn't have a good command of English, hence the comments were often in Russian. Variable names and function methods were still in English, or what people thought was English, simply because corresponding Russian words tend to be long, and sometimes seem to obscure the sense. Now it's probably like everywhere: the more professional people are, the more the chance that their comments are in English.

In the Netherlands, I have seen Dutch comments and variable / method names in the company where the majority of the programmers were Dutch (such companies do exist:) ) But it was the only case.

By the way, the question 'Did you know the Latin alphabet until you came to the West' used to annoy me, until I have learned to laugh at it:)

From India, like someone else said we are 100% English! But I have also worked in Germany for a short while. The Germans used to do it like the Italians (like Lorenzo said). But bigger companies like Siemens etc. have standardised on English. It's much easier to delegate your work outside of your base country when all of your documentation and code is in English.

I came to US less than a decade ago and English is not my first language. Even though I learned how to read and write English in school, I did not speak English reasonably well until I got married to someone who did not speak my language. Well, English was not her first language as well but we found it was easier to use English to communicate than trying to learn each others language. I think the same holds for programming too. If everyone expressed their ideas in their own language, the knowledge would become too scattered. Should English be mandatory? Probably not. Most people wouldn't need it. My family was mostly farmers and most of them would never need to know English to lead a useful life. I wouldn't say successful life because it has different meanings in different parts of the world.

I don't wish to enter a holy war but English in programming may have nothing to do with 'Ugly American' programmer. It may just be a convenient way to collaborate for people speaking different languages. It could have been any language. May be in the future we will code and comment in Chinese. If that happens it probably wouldn't be because of 'Ugly Chinese' programmers, rather it would be because more people in more countries use Chinese to communicate with outsiders.

Even for personal projects I tend to use English mostly because it's easier to ask questions about the code on Stack Overflow or other websites. The same goes for my operating system - I only use English. I had a Dutch operating system once, and it's really horrible to google for errors or information.

There is one advantage of coding in another language and that is that you most likely won't run into conflicting or reserved words.

OT: Your code example contains 7 lines of comments without any real content besides repeating the name of the function and the parameters. I wrote this, because I did the same thing in the past until I realized that it’s a complete waste of time for everyone involved. I know a “comment compulsion” like this hard to overcome, because a function without a comment header look so unfinished once you are used to it, but focusing only on important comments will save you a lot of time and improve your commenting skills in general.
–
xslSep 20 '10 at 12:08

1

@xsl, Thorbjørn: this is XML documentation in C#. Technical documentation can be generated from these XML comments. There is a tool called Ghostdoc that creates and fills these stubs automatically, so creating these 7 lines of documentation does not require typing at all. While it usually does not provide value to the programmer who edits the code, visually, it separates methods and is not obtrusive.
–
MarekOct 28 '10 at 12:07

I'm surely the weird one: I use a language that is tokenized, and so even the language itself can be displayed in your own native language (French, English, German, Spanish and Japanese). It's an RBDMS language born in the 1980s, called 4th Dimension. Have a look at the Language Command translation by clicking on the flags icons.

Hereunder you can see the same code seen with French and English settings.

I'm from Quebec and a French speaking person, but all my code, comment and documentation is always done in English. But I know some companies in Quebec that enforce French in the code (comments and object/variable naming).

Being from the Netherlands I've had the nasty experience of being forced to write comments (and even variable names) in Dutch at school. Most of the time I rejected this attitude and wrote all that in pure English regardless, along with several other students that already had programming experience or learned fast.

In all the companies I've worked for the only use of Dutch was for strings the end-user could or would see, all other text (non-user documentation included) was in English.

I am from Norway, we code in English. Meaning variable names, method names, comments etc are in English. There is some variation however. You might find comments in Norwegian and the code itself in English.

Code developed by government institutions or very small companies might be in Norwegian. In general it is very impractical to use Norwegian because companies hire people who don't speak Norwegian or might want to do outsourcing. Using Norwegian code would then just complicate things. For most companies of a certain size that deal with customers abroad English is the company language. Meaning emails, announcements etc will be in English although employees obviously speak Norwegian to each other.