92

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,647
Damovisa
  • 1,965
  • 3
  • 20
  • 23

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
51

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;
}
Wizard79
  • 7,337
  • 2
  • 43
  • 76
44

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

Shady M. Najib
  • 251
  • 2
  • 8
  • 22
43

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
27

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

777
  • 631
24

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;
}
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

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

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,793
  • 23
  • 23
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.)

finnw
  • 1,447
  • 2
  • 17
  • 21
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,276
  • 2
  • 32
  • 39
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.

EpsilonVector
  • 10,683
  • 10
  • 58
  • 103
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.

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.

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
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,084
  • 25
  • 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.

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

Pickels
  • 121
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).

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

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();
        }
    }
misho
  • 101
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

Rabskatran
  • 1,421
  • 1
  • 14
  • 20
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"    
  खत्म अगर    
खत्म कार्य
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
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
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

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,121
1

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

logoin
  • 289
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

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

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

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,816
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,816
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
  • 583
  • 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.

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

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
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,596
  • 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 :)

cyberzed
  • 923
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
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,413
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
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
    }
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.

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,616
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
  • 813
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
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
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
  • 441
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.

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.

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.

paul
  • 1,191
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?

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.

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
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,296
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
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
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,073
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
  • 9,016
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,140
  • 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,543
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..

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

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

-1

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

Nils
  • 566
-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
-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,624
-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