93

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?

yannis
  • 39,547
  • 40
  • 183
  • 216
Damovisa
  • 1,975
  • 3
  • 20
  • 23
  • 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 02:39
  • This is a great question whose answer I have always wondered about. It makes sense to have native-language names for variables, but does that mean that in a strongly-typed, statically-typed language the data type is in that language too? For example "double deux." Seems like you'd have to translate your compiler to accomodate the new language. – Joel J. Adamson Sep 19 '10 at 20:48
  • 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 05:36
  • 3
    a code sample http://wonderfl.net/c/iUH0/read – www0z0k Feb 05 '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 05 '11 at 23:33
  • Related: http://stackoverflow.com/questions/202723/coding-in-other-spoken-languages/202851#202851 – OscarRyz Feb 11 '11 at 09:38
  • @ Damovisa: There is an example in R / ggplot2 uses colour= instead of color=, which is the norm. – Owe Jessen Apr 03 '12 at 16:49
  • In Fall of 1973, the late then-CPT Grace Murray Hopper USN (later RADM Grace Murray Hopper) mentioned, in a standing-room-only talk to The University of Texas at Austin ACM Student Chapter, that she had seen COBOL programs from all over the free world, that had identifiers in the local languages right beside the COBOL (English) keywords. – John R. Strohm Jun 26 '13 at 19:39

108 Answers108

88

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
Igor Popov
  • 103
  • 5
52

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;
}
Keith Miller
  • 169
  • 1
  • 6
Wizard79
  • 7,327
  • 2
  • 41
  • 76
  • 7
    Siamo messi proprio male :P – Federico klez Culloca Sep 08 '10 at 23:11
  • 1
    @klez: Hai really ragione my friend. – Wizard79 Sep 08 '10 at 23:15
  • 2
    @Lorenzo method like isUtenteCopy is a must here in italy, lol! – systempuntoout Sep 09 '10 at 07:13
  • 13
    That's one of the reasons I'll never work in Italy.. – Andreas Bonini Sep 09 '10 at 13:15
  • Did you pick a particularly confusing code sample, or a representative one? :) – Nicole Sep 20 '10 at 20:33
  • @Renesis: I picked a random piece of code from a real world project. Perhaps other pieces may be even more representative, but this is quite understandable even to a non-English audience. – Wizard79 Sep 20 '10 at 21:52
  • I work in italy, but with an egyptian colleague who barely speaks a bit of english and italian, and you can only imagine what shit comes out. I alway use english for everything. Even my personal blog is completely in english, altough I'm italian. – Matteo Mosca Oct 27 '10 at 12:34
  • In one of our maintenance project I saw code completely written in German... apart from BCL usage which was in English – Prashant Cholachagudda Dec 20 '10 at 07:25
  • che scheletorn! – Armand Mar 22 '11 at 14:01
  • 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. Najib May 17 '11 at 12:01
45

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

doppelgreener
  • 1,274
  • 17
  • 26
Shady M. Najib
  • 261
  • 2
  • 8
  • 22
  • 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. – Evan Plaice Sep 11 '10 at 09: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 Jul 07 '11 at 13:15
  • @LordCover You are aware that English is the national language of india, right? – Racheet Jun 26 '13 at 12:55
44

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.
DomQ
  • 344
  • 2
  • 4
  • 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 Mar 06 '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 Cathcart Apr 13 '12 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 Jun 26 '13 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."* – shambulator Jun 26 '13 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 Jun 26 '13 at 17:29
28

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

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
Zzz
  • 631
  • 7
  • 18
  • 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 Sep 16 '10 at 00: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). – Zzz Sep 16 '10 at 13:47
  • @igor Unfortunately, you misspelled 'Карандашы', 'Карандаши' will be correct. – Valera Kolupaev Sep 20 '10 at 12:16
  • 19
    next time I need to obscure my code I'm using Cyrillic. – Talvi Watia Sep 23 '10 at 07:41
  • @Jon Purdy: the numbers are flags (witnessed by the |) so the 4 should not be a 3.... – Henno Brandsma Jan 18 '11 at 16:02
  • @Valera Kolupaev: Darn, I should have noticed that. @Henno Brandsma: That's what I said. There *was* a `3` and it needed to be changed to a `4`. – Jon Purdy Jan 18 '11 at 23:02
  • 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 Feb 11 '11 at 09:47
  • @Genius I agree – Zzz Feb 11 '11 at 09:54
  • This is the sexiest code ever. – TheTechGuy Mar 05 '12 at 23:48
  • 1
    @JonPurdy In Poland there is no Cyrillic, we use Roman alphabet with few specific letters, e.g. "Dzień dobry" – psur Mar 06 '12 at 09:12
  • @psur: Yes, I know. I speak some Polish. I was just saying that more people are familiar with Romance languages than with Slavic languages. That’s why I offered the translations. – Jon Purdy Mar 06 '12 at 18:19
  • It's super-annoying to switch between the Cyrillic and English layout all the time (the keywords are still in English; and even if you fix them with macros, you still need to switch because there are no `{}[]@#$%^&` characters on Russian keyboard). And good luck debugging if some joker (or maybe yourself) changed `Товaры` to `Товары` (that's Latin `a` in the middle, in case you were wondering)... – Pasha May 23 '13 at 23:39
  • I don't understand why this is significant any decent editor allows you to use different encodings – NimChimpsky Jun 26 '13 at 13:46
25

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;
}
  • 12
    upvoted for the ano bit, good laugh :) – julien Sep 20 '10 at 11:03
  • Very nice, informative answer! Btw, seems like "latter" and "former" got mixed up in the 2nd paragraph. – Jonik Sep 20 '10 at 14:33
  • I always type: "anio" – OscarRyz Oct 27 '10 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 Sep 16 '11 at 07: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 Jan 12 '12 at 23:06
22

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.

  • 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 Sep 09 '10 at 10:11
  • 8
    Being a professional programmer who hates English is not really a sustainable position to be in :-) – DomQ Sep 09 '10 at 11:27
  • 1
    @David_001 spot on ;-) – Preets Sep 09 '10 at 13:51
  • I object to the thumb rule. In fact, from my personal experience, it's rather the other way round. We have worked with many small French companies whose code was completely in English. We are also working with a huge company whose name I will not disclose for obvious reasons, but whose products are being used by millions of people all over the world every single day. These are *extremely* skilled folks working on *extremely* safety-critical code, and all their object/method/variable names are in French (and easily 20 characters long). – RegDwight Sep 12 '10 at 19:12
  • @RegDwight 20 characters long with no less than 1/3 of them silent. :p – Nathan Taylor Sep 15 '10 at 19:24
  • 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 Sep 16 '10 at 15:46
  • The "more skilled" translates to "has written more code". It is simply easier to _read_ anything that is written in one language only and with English keywords it implies that the rest must be English too. –  Oct 18 '10 at 19:57
  • 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 Dec 20 '10 at 10:22
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

  • It is easier to outsource support

  • 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 Oct 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... – pgras Feb 11 '11 at 12:12
16

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.

pramodc84
  • 1,803
  • 23
  • 23
  • 1
    Do you think you could reformat your answer so that it can be seen without using the horizontal scrollbar? – Autodidact Sep 09 '10 at 09:52
  • Its done. I know scroll bar sucks! – pramodc84 Sep 09 '10 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. –  Sep 09 '10 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 Sep 13 '10 at 07: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 Feb 11 '11 at 09:24
10

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

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
finnw
  • 1,467
  • 2
  • 17
  • 21
  • 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. – Richard Gadsden Sep 09 '10 at 10:44
  • 7
    I use British spellings everywhere, for no better reason than because I can. – Dan Dyer Sep 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 Purdy Sep 16 '10 at 00:27
  • 1
    @Jon it doesn’t seem then that British is quite so international as you would have us read. – nohat Oct 06 '10 at 17:50
  • 1
    @nohat: Thence the irony. – Jon Purdy Oct 06 '10 at 21:28
  • 4
    I know colleagues who write in British English just to annoy American colleagues. – Sir Wobin Feb 11 '11 at 09:28
  • 1
    This is a very interesting discussion - especially for us non native enlish speakers who don't give a sh?t about the ohh so dramatic differences in US/UK spelling .... :) – Ingo Feb 07 '13 at 19:50
  • Yeah, as an Australian I refer to Colour, Cancelled, and Dialogue box. – Mark Hurd Jul 04 '13 at 06:00
10

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.

DavRob60
  • 3,286
  • 2
  • 31
  • 39
  • 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 Sep 20 '10 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 Sep 20 '10 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 Sep 20 '10 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... – Talvi Watia Sep 23 '10 at 07:46
  • @Talvi: if coding guidelines are followed, fixing typos should be as simple as a search-and-replace. – rwong Dec 26 '10 at 14:49
9

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.

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
EpsilonVector
  • 10,763
  • 10
  • 56
  • 103
  • 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? – Federico klez Culloca Sep 08 '10 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 – Shady M. Najib Sep 08 '10 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. – EpsilonVector Sep 08 '10 at 23:18
9

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.

  • 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. – Matthijs Wessels Sep 09 '10 at 08: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 Sep 20 '10 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 Mar 06 '12 at 15:32
7

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.

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
Mladen Prajdic
  • 351
  • 1
  • 6
  • 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... – Robert Koritnik Sep 15 '10 at 19:06
  • Adding a link for Slovenia was necessary ? :-) – Luc M May 02 '12 at 17:19
6

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.

OemerA
  • 331
  • 2
  • 7
  • +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 Jan 18 '11 at 08:48
  • Same here. I do use german, though, in certain comments. For example, I do not write /* WTF??? */, but maybe /* verflucher Mist?! */ – Ingo Feb 07 '13 at 19:55
5

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.

Andreas Bonini
  • 1,073
  • 1
  • 9
  • 16
Federico klez Culloca
  • 3,092
  • 24
  • 24
5

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.

Rasmus Faber
  • 290
  • 4
  • 10
  • +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 Sep 20 '10 at 14:08
  • User visible strings frequently need to be localized anyway, moving it out of the code. –  Oct 18 '10 at 20:01
5

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

4

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.

Diego
  • 121
  • 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. – Sergio Acosta Sep 09 '10 at 06: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 Nov 04 '10 at 11:22
4

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.

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
Pickels
  • 121
  • 3
4

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

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
4

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

Ashalynd
  • 264
  • 2
  • 6
4

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.

Autodidact
  • 171
  • 6
4

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();
        }
    }
Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
misho
  • 101
  • 2
  • 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 Sep 20 '10 at 12:08
  • @xsl, looks like something intended for further mechanical processing. –  Oct 18 '10 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 Oct 28 '10 at 12:07
  • Use Java, get JavaDoc instead..! – stolsvik Mar 06 '12 at 02:03
4

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

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
Rabskatran
  • 1,421
  • 1
  • 14
  • 20
  • 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 Sep 12 '10 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... ) – Tulains Córdova Jun 26 '13 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. – Tulains Córdova Jun 26 '13 at 13:31
4

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"    
  खत्म अगर    
खत्म कार्य
Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
Rakesh Juyal
  • 111
  • 4
4

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.

James
  • 782
  • 4
  • 10
3

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.

Giel
  • 259
  • 2
  • 4
3

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.

Erik Engheim
  • 111
  • 2
1

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

frogstarr78
  • 231
  • 1
  • 5
1

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.

JoelFan
  • 7,025
  • 4
  • 38
  • 53
1

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

logoin
  • 289
  • 1
  • 6
1

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.

samo
  • 111
  • 1
  • 1
    While I don't know the situation you encountered, ["connexion"](http://en.wikipedia.org/wiki/Connexion) is the original English spelling and (at least according to Wikipedia) still somewhat used. –  Sep 09 '10 at 10:52
  • Connexion isn't so bad. I once got into a discussion with a British colleague about the word manouever because I thought it was a misspelling. Old/adapted/culture specific words are even an issue among primarily English speaking cultures. – Evan Plaice Sep 11 '10 at 09:35
  • 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
1

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

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
Noah Richards
  • 346
  • 2
  • 6
1

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;
}
Maniero
  • 10,826
  • 14
  • 80
  • 133
rmontagud
  • 11
  • 2
1

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.

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
1

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.

Maniero
  • 10,826
  • 14
  • 80
  • 133
1

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.

Maniero
  • 10,826
  • 14
  • 80
  • 133
1

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.

AndrejaKo
  • 573
  • 4
  • 12
1

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.

1

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.

Anwar Chandra
  • 285
  • 1
  • 6
1

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.

Niklas H
  • 645
  • 5
  • 15
1

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

Enno Shioji
  • 161
  • 4
1

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

Ming-Tang
  • 856
  • 5
  • 15
1

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.

zneak
  • 2,556
  • 2
  • 23
  • 24
1

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

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
cyberzed
  • 933
  • 1
  • 6
  • 14
1

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.

halfdan
  • 111
  • 6
1

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

Zachary K
  • 10,433
  • 2
  • 37
  • 55
1

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.

Duncan Smart
  • 196
  • 3
  • 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. – Erik Engheim Sep 20 '10 at 08:16
  • Absolutely agree. You were unable to use code samples or documentation written by non-Spaniards. – Álvaro González Sep 20 '10 at 10:47
1

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

themue
  • 281
  • 2
  • 6
1

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.

Avi Tzurel
  • 101
  • 3
1

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.

1

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.

1

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
ага
1

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
    }
Ricardo
  • 1
  • 1
1

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.

1

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.

Kamil Kisiel
  • 101
  • 3
1

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.

0

Once I've worked with code which was written by Italian programmers, and once by German programmers. It was standard MFC/C++, so of course all the keywords and language/platform was in English. But the variable names, classes, functions, and inline comments were in Italian and German, respectively.

It's amazing how much difference that makes in terms of readability and ease of maintenance.

On the flipside, I can imagine that as a non-English speaker, it would be quite a steep learning curve to learn a programming language/platform where all the keywords and APIs are in English. Even if all the documentation is translated and you can look it up.

Bobby Tables
  • 20,516
  • 7
  • 54
  • 79
0

I'm swedish and pretty much all my code is in english.

An intresting concept in this regard is Domain Driven Design, in that process it is a major point to not translate words and concepts:

Direct translation to and from the existing domain models may not be a good solution. Those models may be overly complex or poorly factored. They are probably undocumented. If one is used as a data interchange language, it essentially becomes frozen and cannot respond to new development needs.

Therefore:

Use a well-documented shared language that can express the necessary domain information as a common medium of communication, translating as necessary into and out of that language.

So if domain specific terms are in the local language and not translated along with the rest of the code, a domain expert but non-programmer can get a grasp of what the code does.

Fredrik
  • 803
  • 6
  • 12
0

I had worked for a few months in Japan. Although the code was in English the file headers and small amount of comments they had was in Japanese. They actually had to find me a English keyboard to work with.

softveda
  • 2,679
  • 1
  • 21
  • 21
0

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.

Portman
  • 558
  • 5
  • 11
0

I'm from Brazil, and in my last job, some guys didn't speak english, so we had to write things in portuguese, but most of the people wrote in english.

Curtis
  • 431
  • 1
  • 5
  • 14
0

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.

Terence Ponce
  • 3,052
  • 3
  • 26
  • 33
0

I usually do everything in English when programming C#, but sometimes we throw in some Spanish or Italian in comments. Some business objects are in Spanish (but always mixed with English for actions and such).

Now, when I’m in Objective-C, I always stick to English. It makes so much sense (in the way the language is structured) that it’s easier to read.

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
0

I am English and have lived and worked in Germany. I nearly always use English unless I can't think what the English term for something is. Then I use a German word.

I have met one or two who insist on only using English ('because it is better') but then spell things incorrectly which can be very bothersome when it makes its way into the API. There have been some compile-issues when using accents (for example, 'Müller') in source code. These have been forbidden.

Team discussion is exclusively in German. Coding is mixed. Most tend towards German names for variables and methods, etc. but will use English when it suits them. What ticks me off is when the English spelling is wrong.

Peter Mortensen
  • 1,050
  • 2
  • 12
  • 14
paul
  • 1,201
  • 9
  • 10
0

Yes, although I am Dutch I want everything on my computer to happen in English except for communicating with Dutch people or visiting Dutch sites... I really don't like the mix of Dutch and English all over the system and have thus chosen to do everything in the same language for consistency reasons.

When I was young I wanted to write everything in my own language, as for keywords...
But that just doesn't seem possible to accomplish. Maybe this is a good idea for a future language?

Tamara Wijsman
  • 8,259
  • 14
  • 58
  • 94
0

In my former work we had habit of talking in Swedish and writing in English, when for example writing something on the drawing board.
I think it started when we had a lot of consultants from different contries at the work. We had to switch between English and Swedish depending on who was listening to you.

I have to make a distinction between writing code comments and even documenation in English and write and talk about common-day thing in English. It is not the same.
I have written more design documentation in English than I remember but that doesn't mean that I can talk about how to cook food or writing a poem in English, or write an answer on SO without making spelling errors or use improper grammar.

My wife is from latin america and we speak Spanish at home so I am in the situation that I speak two languages regulary (Swedish and Spanish) and write two languages regulary; Swedish and English, the latter mostly about technical matters. Writing documentation in English is a required skill when working as an engineer in Sweden.

0

In Germany i think it depends on how big and open the shop is. In bigger banks people write in English because you might have to deal with non-German speaking consultants for a specific job.

But also remember the OpenOffice fiasco when people found out that most of the StarOffice code was written in German.

LennyProgrammers
  • 5,649
  • 24
  • 37
0

I'm from Finland and all the programs I know have been written in English. I have seen few Finnish comments though, but they are certainly not the accepted practice. In some databases I have seen even some column names in Finnish, but that too is considered wrong.

As it is perfectly possible that some day you have a coworker from another country like Pakistan, I think that coding in Finnish would be just irresponsible. The sole exception are some customer specific terms and especially acronyms since they can be very hard to translate and the translation would probably be hard to understand. Also you wouldn't be able to use the whole Finnish character set in variables etc.

Carlos
  • 1,479
  • 1
  • 12
  • 17
0

Most programming languages are designed for English and English is the international language of programming. The same for Aviation, anywhere in the world at any airport, English is the default language.

There are a few programming languages I believe that are designed for different languages, either Russian or a variation of Mandarin but I have no idea how used they are or what they are called.

WalterJ89
  • 1,306
  • 8
  • 15
0

As Spaniard working in Ireland, now I do all my code in English.

But I have worked previously on Spain for a multinational project and we have to code everything in English (although no one was English-speaker, mostly Spanish and French, which leads sometimes to some really funny weird comments). And after that, I worked on a Spanish company and all the code has to be on Spanish. The problem on setting variables in Spanish is that you can't use (depending on the language) all the characters, as some are not available in ASCII. So that always leads to some deliberate typos on variables, which some times can be annoying.

For example:

// English
int size = 0;
// Proper, non-ascii Spanish
int tamaño = 0;
// Bad but ascii Spanish
int tamanno = 0;

Another curious effect is that there are a lot of characters used on programming (like #{}[], etc) that are much more easily accessible on a English keyboard than on a Spanish one. I found more comfortable to program on English layout (now that I have get used to it) as I have to make less weird key combinations.

These days, when I code for personal projects, I code in English, but probably because I'm used to it...

At the end of the day, it's just a matter of who do you expect to read your code, I guess... If I had to program just by my own for a while, probably I will revert to Spanish.

Khelben
  • 1,339
  • 1
  • 8
  • 8
0

I'm from Brazil, and I spent a lot of time in university coding half English, half Portuguese software. Later I switched to full English for almost everything, particularly any projects I was opening up for people elsewhere.

Now that I'm living and working in England I've started using UK spelling for variables and the like. It's slightly annoying to mix a variable colour and ActionScript attribute color, but I'll live. :)

Pedro
  • 141
  • 3
0

I am from Bangladesh, and every single coder I know use English in their code. We even switch to English (or at least Bengali with lots of English words) when we talk about programming. This is true even for people who are otherwise not very comfortable in English. I have seen some people use Bengali for variable names and small comments, but that is always in very short scripts, throwaway programs, solutions to programming puzzles etc. and almost always as something of a joke intended to amuse the reader.

I think this is true for programmers in most non-english speaking countries. Most good books, tutorials, documentation are in English, as are the comments,docstrings and variable names in any code you can find. English is also the preferred language to communicate with other programmers from around the world. So IMHO learning and using English in an everyday basis is not something a programmer can easily avoid. It forms a base for the common culture of programmers everywhere.

MAK
  • 1,093
  • 8
  • 14
0

my native language is russian (i live in moscow), however i wright code, comments, svn comments (when it's allowed by repository rules), even project descriptions/documentation (also if allowed) only in english. and i use english documentation/language references.
there're generally two reasones for that: consistency of the result ,the fact that i'm really not going to translate any programming-related texts of mine - ever ;)

www0z0k
  • 101
  • 1
0

To me (from Denmark) it falls most natural to code in English. I guess there are two reasons.

First of all, all keywords and API classes and methods are already in English, so writing variables and comments in Danish makes the code inconsistent to read.

Secondly, all books, blogs, QA sites like P.SE and SO, are in English. So it is almost like my brain switches to an English mode when dealing with programming.

There are times however, where I would not choose English.

Sometimes you work in domains that are so tied to concepts that are language specific that they are impossible to translate to English. E.g. I worked at a mortgage issuer, and all their domain is loaded with legal terms, terms specific of Danish mortgage systems, etc.

I also worked with a system submitting forms to the government. Also here the domain was loaded with untranslatable terms.

So in the case the the domain is highly specific to the country where you work, you should keep the domain concepts in your local language. Otherwise the developers will speak a different language than the domain experts, and that will lead to poor communication.

Pete
  • 8,916
  • 3
  • 41
  • 53
0

In Czech Republic, the debate is still somewhat alive between three schools of thought:

  • Use English, only 10^7 people speak Czech
  • Use Czech without diacritical marks, not every environment supports them
  • Use Czech with diacritics, yay Unicode!

Since that time I worked in a Dutch company which had most code written under the assumption that "we're all Dutch here, what would we use English for?" (and later expanded across Europe), I've switched to English for everything - code, comments, and metadata. After all, my colleagues have been Czech, Dutch, Bulgarian, French, American, Turkish, Swedish, and Croatian - with English being the common language (after all, the Dutch guy was not happy when we needed him to translate comments every day ;)).

0

I'm from China, If I write code for myself, I use English,

If I write code with my Chinese coworkers, I use Chinese comment,

If I write code with other Foreigners, I use English.

linjunhalida
  • 139
  • 7
0

English is not my mother language but I definitely use strictly English for everything. To be perfectly honest I absolutely hate to see non-English comments or something else written in a language besides English.

Mainly, because I think it's one of the most beautiful languages and probably (maybe) because for the languages/frameworks/more I learned/learn I use strictly english materials(like textbooks, online tutorials).

Daniel
  • 1,150
  • 2
  • 10
  • 20
0

I just start a PHP code with the following lines:

<?php
/* -----------------------------------------------------------------------------
 file name     : DOCUMENTROOT/index.php
 compatibility : PHP 5.2.x / UTF-8 [LF]
 description   : 
 copyright     : Copyright(C)2010 by *********
 date          : managed since [2010-09-01 19.05 (JST: GMT+0900) @462]
 encode phrase : 時々京の方向に幅が細くて美しい線が入った飾りを持つ雀が往く
 encode phrase : 男は傷の拳で美しく印刷された一冊の書を持ち憎い相手の笑いに応じた
 encode phrase : 牀前看月光/疑是地上霜/擧頭望山月/低頭思故郷
 encode phrase : 茨菰葉爛別西灣/蓮子花開猶未還/妾夢不離江上水/人傳郎在鳳凰山
 encode phrase : 上記の文はエディタにエンコード判定させるためのダミー文です。
 Git revision  :
----------------------------------------------------------------------------- */

to tell my text editor its encoding. Most text editors will not appropriately recognize an encoding of text file when it was opened in it.

0

I'm Dutch and often code in English, even my personal, internal code. My English vocabulary is also richer when it comes to programming / computer science and it doesn't make a lot of sense to (try to) use Dutch words. I.e. if I would be naming a method signature a "Methode handtekening" I doubt if any fellow Dutch coders would understand what I mean.

Ivo van der Wijk
  • 659
  • 4
  • 13
0

I'm from Spain: in a time now, I'm mixing code in English and Spanish. From now on, I will set it strictly in English. The idea of doing everything in English is not crazy, is the future.

0

At a company I used to work for, the management purchased codebase for a soccer game from an Italian company. None of us really played much soccer, and most of the variables and comments were written in Italian. That was not a fun project.

0

I'm from Holland. Here, because very few dutch programmer resources exist, most people think and code in English. There are things in my personal life I couldn't explain in English, there are algorithms and patterns I couldn't possibly explain Dutch.

So my native language is dutch, except when it comes to IT related stuff.

Ralf
  • 101
  • 2
0

I'm programming in germany. Most usually I see code written in english (as all the books we learn from and all the design patterns are english, and of course all official APIs are in english), but comments are frequently in german.

I try to write comments in english too, but I know thats not very common.

0

I think there is a lot of cognitive overhead when your code is part english, part some other language, especially if you're using some large API where you end up with english method calls on types declared in antoher tongue etc. So I'll use english unless I have a good reason not to.

One of these reasons, which I haven't seen mentioned, is ubiquitous language (as per the Domain Driven Design principles). If doing contracted work for which I rely on the knowledge of business experts, with whom I call one thing one way, and then in the code define the type in english, things get confusing, especially if that's and odd/unusual vocabulary which I'm not accustomed to...

Hence I've often been using a mix of the two, where business-critical objects and methods are named in the language AND tongue of the domain, and the rest of the code which is more of an infrastructure/technical concern is in english, to match the apis more smoothly.

But from a craftsman's point of view, I must say I have mixed feelings about this, and don't find this a very satisfying solution.

julien
  • 1,533
  • 1
  • 11
  • 20
0

I'm from Romania, and where I am working there is a strict policy of adhering to standard notations and English. Even documents and how-to guides and wiki's are written in english. There is even no thought that you might write in the native tongue. English is by-default, and the company invests in compulsory English courses.

0

We use English in most projects just to follow the APIs.

But you shouldn't be dogmatic about it because there are always exceptions. For instance if you work for a German insurance company you will face so many domain specific concepts and terms which are not translatable at all you should consider using the native language. This is a team decision.

Dittmar
  • 11
  • 1
0

I speak Afrikaans as a first language. When I code I usually use a mix of Afrikaans and English variables and I mostly comment in Afrikaans. As we have 11 official languages I would code in English for official purposes (government projects etc.). If I quickly write code to test things I almost always code and comment in Afrikaans.

0

Swede here. I believe in Sweden most code is written in English simply since that's the way most programmers learn to program. All literature, all samples etc used in teaching (and on the web) is in English so it's natural to code in English. And I believe that's the way it should be.

There is one area though where it becomes problematic and that's when you start applying Domain Driven Development and want to follow the pattern of Ubiquitous Language. Now suddenly you want your code to be in English but at the same time you want your team and the business representatives to use the same terminology and although there is a lot of Swenglish in corporate Sweden you get an awfully uggly conversation when people start to mix the two languages.

Mille Bessö
  • 496
  • 3
  • 5
0

I'm from Latvia, and I'm coding only in English. Makes the code look much more fluent and pure. Plus, my language is filled with all the fancy characters like "š", "ž", "č".. and therefore, makes it kind of unhealthy for the code.

But that's only my opinion..

tomsseisums
  • 101
  • 3
0

I'm not a native english speaker but yes I code and write all my comments, class names, variable names, function names in english. Why? Well just because it makes more sense for me and it makes it much easier to share my code. Just my 2 cents

0

I'm Mexican, living near the border with USA (in Hermosillo, Sonora). I code all of my work (personal and for the company) in English, and I encourage my friends and teammates to do so too.

I have found that this give us a flat terminology (everyone, here and in other parts of the world use the same word for the same thing) and make out integration with our clients seamless.

Here in Mexico, and especially in some part near the border with the USA, a new kind of "Spanish" has been talked among several population groups, the "Spanglish" (yes, it just not a [bad] movie, but also a cultural term) and sometimes, this permeates to the "engineering layer" and the they start using terms like "linkear" (to link, create a link) or "parsear" (to parse), so I ask every programmer that I know just use plain English.

Hugo
  • 141
  • 7
0

Mexican here

Whend doing my own work, i mostly use english, as many tutorials and examples are in english, i do code a lot in english though all comments are done un spanish, but when working on my companies software, i do code all in spanish

CJLopez
  • 101
  • 1
-1

I'am from indonesia, and english is not our primary language, but all of programmers that i know is coding in english including the code comments.

uray
  • 101
  • 2
-1

I'm a Chinese and we write code in English while we write the comments in Chinese.

Zhu Tao
  • 101
  • 1
-1

I'm from INDIA and as far as I have noticed all the Indians code in English.

Chankey Pathak
  • 3,249
  • 28
  • 32
-1

Yes. I live in Switzerland and my native language is German.

Nils
  • 556
  • 2
  • 5
  • 13
-1

I have been told by friends the the original SAP database system was codded entirely in German. Once they were bought out however, it was likely this was ported over to English.

-1

I noticed that is more easy for small groups to maintain an English-only standard. Big, bloated projects tends towards to use a mixed convention (English and Italian in my cases).

-1

hell yeah from Morocco!
well i'm talking about my case, some people mix between english french and arabic.

aleo
  • 139
  • 2
-1

All identifiers are English. They look silly with the English keywords.

Comments are either in English or Dutch, not certain if that good, but the codebase is too big to adapt.

Toon Krijthe
  • 2,634
  • 1
  • 21
  • 30
-1

I'm from Israel, and professional programmers almost always use strictly English. However, sometimes, Hebrew seeps through, for example see PHP's scope operator.

-1

We ALWAYS code in english. Comments and documentation are written in spanish if the customer really asks for it.

-1

From my experience here in Germany, most professional programmers (as in capable ones) code in English. In my opinion, variable, function and class names in non-English are just plain ugly. :-)

-1

Hola soy de Argentina y siempre usamos variables y comentarios en Castellano. En algunos casos los clientes solicitan la documentación en ingles y solo en estos casos se usa otro idioma. Saludos!

-1

Have a look on this Chinese markup language project site:

http://code.google.com/p/chtml/

-2

personalmente los nombres de las variables/funciones/clases/etc... las escribo en ingles o en un spanglish por ejemplo: getLastComida(); get(en) - Last (en) - Comida(es)

Desde Chile