Do people in non-English-speaking countries code in English?

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

    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.

    Really? Where is the British spelling? The American English used to annoy me (I'm Australian), but I'm used to it now...

    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.

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

    @ Damovisa: There is an example in R / ggplot2 uses colour= instead of color=, which is the norm.

    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.

  • 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
    

    This is a joke, right?

    It better be, but its pretty funny.

    This is the funniest thing I've seen on the internet so far

    I find it creepy

    @Philip "This is a joke eh?"

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

    Siamo messi proprio male :P

    @klez: Hai really ragione my friend.

    @Lorenzo method like isUtenteCopy is a must here in italy, lol!

    That's one of the reasons I'll never work in Italy..

    Did you pick a particularly confusing code sample, or a representative one? :)

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

    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.

    In one of our maintenance project I saw code completely written in German... apart from BCL usage which was in English

    che scheletorn!

    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

  • 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

    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.

    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.

    @LordCover You are aware that English is the national language of india, right?

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

    • I speak the language that the target audience will most likely understand. When coding open-source software with a global ambition, I use English. For less widely useful stuff (for instance, my Emacs configuration file), I might use French.
    • I acknowledge the fact that not everyone will master English. In that perspective, using my mother tongue might actually make my code more accessible instead of less (in the example above, nobody cares about an umpteenth .emacs, except if it happens to be written in a language that they understand).
    • Better to write good French than bad English. I actively discourage my subordinates from writing half-assed English especially where concision matters, eg in docstrings and version control commit messages.

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

    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.

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

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

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

    @igor Unfortunately, you misspelled 'Карандашы', 'Карандаши' will be correct.

    next time I need to obscure my code I'm using Cyrillic.

    @Jon Purdy: the numbers are flags (witnessed by the |) so the 4 should not be a 3....

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

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

    This is the sexiest code ever.

    @JonPurdy In Poland there is no Cyrillic, we use Roman alphabet with few specific letters, e.g. "Dzień dobry"

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

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

    I don't understand why this is significant any decent editor allows you to use different encodings

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

    upvoted for the ano bit, good laugh :)

    Very nice, informative answer! Btw, seems like "latter" and "former" got mixed up in the 2nd paragraph.

    I always type: "anio"

    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.

    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.

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

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

    Being a professional programmer who hates English is not really a sustainable position to be in :-)

    @David_001 spot on ;-)

    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 20 characters long with no less than 1/3 of them silent. :p

    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.

    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.

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

  • 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

    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!

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

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

    Do you think you could reformat your answer so that it can be seen without using the horizontal scrollbar?

    Its done. I know scroll bar sucks!

    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.

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

    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.

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

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

    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 It was not a real life example, it was something I build from my mind tho avoid any copyright issues.

    ugh.. and having to fix typos in variables and filenames is the worst. `summery` `transfar` `sucess` just to name a few...

    @Talvi: if coding guidelines are followed, fixing typos should be as simple as a search-and-replace.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM