92
votes

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?

9
  • 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. Commented Sep 15, 2010 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
    Commented Sep 16, 2010 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
    Commented Sep 20, 2010 at 5:36
  • 3
    a code sample wonderfl.net/c/iUH0/read
    – www0z0k
    Commented Feb 5, 2011 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
    Commented Feb 5, 2011 at 23:33

108 Answers 108

88
votes

I'm from Canada, but live in the States now.

It took me a while to get used to writing boolean variables with an "Is" prefix, instead of the "Eh" suffix that Canadians use when programming.

For example:

MyObj.IsVisible

MyObj.VisibleEh
5
  • 21
    This is a joke, right?
    – Philip
    Commented Jun 10, 2011 at 19:09
  • 21
    It better be, but its pretty funny. Commented Sep 16, 2011 at 2:44
  • 2
    This is the funniest thing I've seen on the internet so far Commented May 7, 2013 at 8:13
  • I find it creepy Commented Jun 26, 2013 at 11:59
  • 6
    @Philip "This is a joke eh?"
    – rlemon
    Commented Jun 26, 2013 at 13:17
51
votes

I'm Italian and always use English, for names and comments. But many other Italian programmers use Italian language, or more often a strange English-Italian mix (something like IsUtenteCopy).

A real life code sample:

// Trovo la foto collegata al verbale
tblVerbali rsVerbale;
hr = rsVerbale.OpenByID(GetDBConn(), m_idVerbale);
if( FAILED(hr) )
    throw CErrorHR(hr);
hr = rsVerbale.MoveFirst();
if( S_OK != hr )
    throw CError(_T("Record del verbale non trovato."));

By the way, the Visual Studio MFC wizard creates a skeleton application with localized comments:

BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
    if( !CMDIFrameWndEx::PreCreateWindow(cs) )
        return FALSE;
    // TODO: modificare la classe o gli stili Window modificando 
    //  la struttura CREATESTRUCT

    return TRUE;
}
10
  • 7
    Siamo messi proprio male :P Commented Sep 8, 2010 at 23:11
  • 1
    @klez: Hai really ragione my friend.
    – Wizard79
    Commented Sep 8, 2010 at 23:15
  • 2
    @Lorenzo method like isUtenteCopy is a must here in italy, lol! Commented Sep 9, 2010 at 7:13
  • 13
    That's one of the reasons I'll never work in Italy.. Commented Sep 9, 2010 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 Commented May 17, 2011 at 12:01
44
votes

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.

I guess this post might convey my point, via Jeff Atwood: http://www.codinghorror.com/blog/2009/03/the-ugly-american-programmer.html

3
  • 3
    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. Commented Sep 11, 2010 at 9:45
  • I'm from Syria, and agree with @Shady, in most of the world, English is the most effecting language and if you don't know English you can't use the Internet effectively. If we look at Indians, they are 1st in Software Development, do they have an Urdo programming language? I guess not. What matters is the use and development no matter of cultural differences. The more you're elegant the more you will prevail, that's why Arabic language faces now its most tough challenges through history.
    – Ken D
    Commented Jul 7, 2011 at 13:15
  • @LordCover You are aware that English is the national language of india, right?
    – Racheet
    Commented Jun 26, 2013 at 12:55
43
votes

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.
5
  • 1
    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...
    – Carra
    Commented Mar 6, 2012 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. Commented Apr 13, 2012 at 17:29
  • -1 for "Better to write good French than bad English", if I could. How will you ever improve your English skills with this mindset?
    – danijar
    Commented Jun 26, 2013 at 11:57
  • @danijar In some forum appropriate to improving English skills? I don't think "Humour the guy trying to become a polyglot" features very high on the list of goals for most code bases, especially not where it conflicts with goals like "Remain comprehensible to maintainers." Commented Jun 26, 2013 at 14:45
  • @shambulator Very depends. It makes sense to code international projects in English, as pointed out in many answers. For hobby projects, grammar mistakes are acceptable, so getting into the habit of coding in English makes sense to me. Moreover, personally, it is inconvenient to switch between English sources you read and your program in your native language.
    – danijar
    Commented Jun 26, 2013 at 17:29
27
votes

C#, it really works (Cyrillic):

[Flags]
public enum Товары
{
    Непонятно = 0,
    Книги     = 1,
    Тетради   = 2,
    Карандаши = 4,
    Всё = Книги | Тетради | Карандаши
}

..
Товары карандаши = Товары.Карандаши;

There is fun (weird) in that Visual Studio allows it and someone is writing code by using his/her native language (non-English).

13
  • 11
    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 Purdy
    Commented Sep 16, 2010 at 0:25
  • @Jon Purdy you are right. I have added [Flags] attribute and have changed 3 to 4. but problems is not in development issues. There is fun (weird) that visual studio allows and someone is writing code by using his/her native language (non-English).
    – 777
    Commented Sep 16, 2010 at 13:47
  • 19
    next time I need to obscure my code I'm using Cyrillic. Commented Sep 23, 2010 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.
    – Genius
    Commented Feb 11, 2011 at 9:47
  • 1
    @JonPurdy In Poland there is no Cyrillic, we use Roman alphabet with few specific letters, e.g. "Dzień dobry"
    – psur
    Commented Mar 6, 2012 at 9:12
24
votes

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 :)

Some samples:

/**
 * Devuelve una cadena aleatoria de la longitud indicada elegidos entre la lista proporcionada;
 * contempla caracteres multi-byte
 */
function mb_cadena_aleatoria($longitud=16, $caracteres='0123456789abcdefghijklmnopqrstuvwxyz'){ // v2010-06-03
    $cadena = '';
    $max = mb_strlen($caracteres)-1;

    for($i=0; $i<$longitud; $i++){
        $cadena .= mb_substr($caracteres, mt_rand(0, $max), 1);
    }
    return $cadena;
}

/*
 * Da formato a un número para su visualización
 *
 * numero (Number o String) - Número que se mostrará
 * decimales (Number, opcional) - Nº de decimales (por defecto, auto)
 * separador_decimal (String, opcional) - Separador decimal (por defecto, coma)
 * separador_miles (String, opcional) - Separador de miles (por defecto, ninguno)
 */
function formato_numero(numero, decimales, separador_decimal, separador_miles){ // v2007-08-06
    numero=parseFloat(numero);
    if(isNaN(numero)){
        return "";
    }

    if(decimales!==undefined){
        // Redondeamos
        numero=numero.toFixed(decimales);
    }

    // Convertimos el punto en separador_decimal
    numero=numero.toString().replace(".", separador_decimal!==undefined ? separador_decimal : ",");

    if(separador_miles){
        // Añadimos los separadores de miles
        var miles=new RegExp("(-?[0-9]+)([0-9]{3})");
        while(miles.test(numero)) {
            numero=numero.replace(miles, "$1" + separador_miles + "$2");
        }
    }

    return numero;
}
5
  • 12
    upvoted for the ano bit, good laugh :)
    – julien
    Commented Sep 20, 2010 at 11:03
  • Very nice, informative answer! Btw, seems like "latter" and "former" got mixed up in the 2nd paragraph.
    – Jonik
    Commented Sep 20, 2010 at 14:33
  • I always type: "anio"
    – OscarRyz
    Commented Oct 27, 2010 at 20:34
  • I (spaniard too) don't understand the fear to use tildes, I have seen this amongst some coworkers as well. Modern IDEs fully support unicode, so what's wrong with using "año"? Anyway I always use English, it looks weird to me to see Spanish words intermixed with English language keywords and framework classes/members.
    – Konamiman
    Commented Sep 16, 2011 at 7:38
  • At least "anno" is the (very) old-fashioned spelling of "año". Perhaps such Spanish-speaking programmers should code in Latin rather than Spanish; it is the "Latin" alphabet, after all.
    – phoog
    Commented Jan 12, 2012 at 23:06
22
votes

In France, many people tend to code using French objects/methods/variables names if they work with non English speaking colleagues. However, it is really depends on your environment.

The thumb rule is 'the more skilled people you are working / the projects you are working on are, the more likely it is that it is going to be in English'/

It seems to be the same in Germany.

8
  • 22
    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_001
    Commented Sep 9, 2010 at 10:11
  • 8
    Being a professional programmer who hates English is not really a sustainable position to be in :-)
    – DomQ
    Commented Sep 9, 2010 at 11:27
  • 1
    @David_001 spot on ;-)
    – Preets
    Commented Sep 9, 2010 at 13:51
  • 20
    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.
    – BlairHippo
    Commented Sep 16, 2010 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 :)
    – Gauthier
    Commented Dec 20, 2010 at 10:22
22
votes

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

  • It is easier to outsource support

2
  • 7
    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 C
    Commented Oct 19, 2010 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...
    – pgras
    Commented Feb 11, 2011 at 12:12
16
votes

I'm from Bangalore, India. Programmers are from various states with different languages.

We code in English, document in English, comment in English, naming convention is in English. English is our common language while talking in office.

5
  • 1
    Do you think you could reformat your answer so that it can be seen without using the horizontal scrollbar?
    – Autodidact
    Commented Sep 9, 2010 at 9:52
  • Its done. I know scroll bar sucks!
    – pramodc84
    Commented Sep 9, 2010 at 10:20
  • I don't know why people like using back ticks for emphasis. They look and work horribly at emphasis, and there's two perfectly good emphasis styles already.
    – Roger Pate
    Commented Sep 9, 2010 at 10:56
  • 9
    +1 My team has people from at least 7 different languages. English is the only way to go - even for gossiping :)
    – Amarghosh
    Commented Sep 13, 2010 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 Wobin
    Commented Feb 11, 2011 at 9:24
10
votes

I'm form Quebec and I saw a lot of programmers prefer to code in English. I got a good quote for you.

Let them program in English and you will see they don't know English.

So you could find gems like :

//putting the conter to 0
i=0

In clear, it's better to code in your native language if you don't master the target language. otherwise, it's just obfuscate the code.

5
  • 6
    "In clear, it's better to code in your native language if you don't master the target language. otherwise, it's just obfuscate the code." Hahaha classic.
    – Neil Foley
    Commented Sep 20, 2010 at 12:44
  • 3
    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.
    – yatima2975
    Commented Sep 20, 2010 at 14:26
  • @yatima2975 It was not a real life example, it was something I build from my mind tho avoid any copyright issues.
    – DavRob60
    Commented Sep 20, 2010 at 14:30
  • 1
    ugh.. and having to fix typos in variables and filenames is the worst. summery transfar sucess just to name a few... Commented Sep 23, 2010 at 7:46
  • @Talvi: if coding guidelines are followed, fixing typos should be as simple as a search-and-replace.
    – rwong
    Commented Dec 26, 2010 at 14:49
10
votes

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.)

8
  • 2
    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. Commented Sep 9, 2010 at 10:44
  • 7
    I use British spellings everywhere, for no better reason than because I can.
    – Dan Dyer
    Commented Sep 12, 2010 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 Purdy
    Commented Sep 16, 2010 at 0:27
  • 1
    @Jon it doesn’t seem then that British is quite so international as you would have us read.
    – nohat
    Commented Oct 6, 2010 at 17:50
  • 4
    I know colleagues who write in British English just to annoy American colleagues.
    – Sir Wobin
    Commented Feb 11, 2011 at 9:28
9
votes

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.

3
  • 1
    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. Commented Sep 9, 2010 at 8:56
  • Dutch is not bad for technical language in general. It does fine in physics and general maths. But for programming, definitely. There are far too many English jargon terms that are horrible to translate (e.g. interface), and the Dutch terminology hasn't developed enough to provide its own. Anyway, all my code is in English, except sometimes the comments on my hobby projects.
    – Joren
    Commented Sep 20, 2010 at 14:35
  • Same here in Flanders, English is the de facto language for programming. Some comments might be in Dutch for my colleagues though.
    – Carra
    Commented Mar 6, 2012 at 15:32
9
votes

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.

3
  • That's interesting. I always asked myself how people with non-latin scripts do code. Is translitterating from hebrew characters to latin characters a viable option? Commented Sep 8, 2010 at 23:11
  • I myself sometimes do transliteration.. On the very rare occasions when I find translation would be kind of confusing (specially if the business requirements are in Arabic). Yet, Generally it's thought of as a bad practice Commented Sep 8, 2010 at 23:15
  • 1
    I definitely know of some people who transliterate in chats and SMS. However, I would really frown upon that in code, especially in comments. Commented Sep 8, 2010 at 23:18
7
votes

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.

And I'm talking about the code itself, not software localization.

2
  • Interesting. I'm also from Slovenia and I reject any non-english words in code (not even in comments). I used to work in a company where a guy was adding comments in Swedish. Imagine that! How maintainable was his code in terms of comment explanations. For what I know he may be ranting about the company in them... Commented Sep 15, 2010 at 19:06
  • Adding a link for Slovenia was necessary ? :-)
    – Luc M
    Commented May 2, 2012 at 17:19
6
votes

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.

One example I think it is horrible to see is

meinObst = "Apfel;Himbeere;Traube"
meinGeteiltesObst = meinObst.split(";")

for obst in meinGeteiltesObst:
    ...

You absolutely can see it in the for statement you are switching from one language to an other and that's not a good thing IMO.

2
  • +1 for "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?"
    – Martin Ba
    Commented Jan 18, 2011 at 8:48
  • Same here. I do use german, though, in certain comments. For example, I do not write /* WTF??? /, but maybe / verflucher Mist?! */
    – Ingo
    Commented Feb 7, 2013 at 19:55
5
votes

I'm from Denmark.

Code, documentation, naming, design documents etc. is all done in English. I have only ever seen otherwise in hobbyist and student projects - and even then only very rarely.

The only open question that I see is what to do about (potentially) user-visible strings:

window.setHeader("????");

throw new ThisMightBeSeenByTheUserInAnErrorMessageException("????");

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.

2
  • +1. I'm from Finland and this sounds familiar. Using English for pretty much everything is very natural, even if everyone in the team is Finnish-speaking. The last time I needed coded in Finnish was at some university project long ago.
    – Jonik
    Commented Sep 20, 2010 at 14:08
  • User visible strings frequently need to be localized anyway, moving it out of the code.
    – user1249
    Commented Oct 18, 2010 at 20:01
5
votes

I'm from Italy but I'm not sure what you're asking.

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.

5
votes

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. :)

0
4
votes

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.

2
  • 7
    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. Commented Sep 9, 2010 at 6:59
  • I'm also from Uruguay. In the company I work for, we code everything in english. The code comments, classes, methods, fields and variable names are in english. The localization of the product we build is in english (that would be a commercial strategy), and even the comments when commiting changes to the repository are in english.
    – Fede
    Commented Nov 4, 2010 at 11:22
4
votes

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:)

4
votes

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.

4
votes

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.

4
votes

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.

4
votes

I'm from Belarus, but I'm always use English for comments. And as I know a lot of Belarus programmers use English as primary language for coding.

    /// <summary>
    /// Get item quantity
    /// </summary>
    /// <param name="itemCode">Item code</param>
    /// <param name="grade">Grade</param>
    /// <param name="lpn">LPN</param>
    /// <returns>Returns item quantity</returns>
    private int GetQuantity(string itemCode, string grade, int lpn)
    {
        using (var db = new MappingDataContext(_connection))
        {
            db.ObjectTrackingEnabled = false;
            return (from i in db.INVENTORs
                    where i.ITEM_NO == itemCode
                    where i.CUSTCHAR12 == grade
                    select i.ITEM_NO).Count();
        }
    }
4
  • 2
    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.
    – xsl
    Commented Sep 20, 2010 at 12:08
  • @xsl, looks like something intended for further mechanical processing.
    – user1249
    Commented Oct 18, 2010 at 20:05
  • 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.
    – Marek
    Commented Oct 28, 2010 at 12:07
  • Use Java, get JavaDoc instead..!
    – stolsvik
    Commented Mar 6, 2012 at 2:03
4
votes

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.

alt text

alt text

3
  • Best answer here. There should be only three answers with votes for the corresponding answers. "My language", "English", and this one. Especially since almost nobody brings code samples.
    – Moshe
    Commented Sep 12, 2010 at 14:15
  • I used to programm in 4D, I didn't know the language of the language's reserved word could be changed. Now that you mention the tokenized nature of the language I remember something weird that happened to me. Another programmer and me had to work in separate copies of the database. We created two tables, but we created them in different order. Then when we copy code from my database and pasted in his, the name of the tables were inverted. TableA was TableB and viceversa. ( to be continued... ) Commented Jun 26, 2013 at 13:31
  • ( continuation ) Then I realized than the code we saw was really a visual interpretation of the real code, and that it was not transferable. The code really contained the serial number of the tables when we saw a table name. That way when you paste the code in the other database, the table names were wrong because the tables there were created in a different order so the underlying table serials were not the same. Commented Jun 26, 2013 at 13:31
4
votes

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).

1
  • What companies are those? Sounds awful. Commented Sep 12, 2010 at 2:01
4
votes

I have always coded in English. Also, I never wanted to code like this either:

क = 1;
कुल = 0;
जब तक क छोटा है 10 से  {
    कुल += क;
}
छापो कुल

कार्य खाली मुख्य ( )      अंक समय       लिखें "Enter current time"    
     पढें समय        अगर [ समय < 12 ]    
        लिखें "Good Morning"    
  वरनाअगर [ समय >= 12 और समय < 16 ]    
           लिखें "Good Afternoon"    
  वरना              लिखें "Good Evening"    
  खत्म अगर    
खत्म कार्य
3
votes

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.

3
votes

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.

1
vote

I'm from Taiwan. We code in English and follow the naming convention of specific languages.

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