38

Possible Duplicate:
Do people in non-English-speaking countries code in English?

I have a development comming that is intended to be sold across Latin America (Spanish speakers), but I've heard from some partners that is a good practice to always code in English, I mean just code (methods, classes, pages names, etc), labels on GUI are going to be all in Spanish...

Code will be edited in the future by developer of companies across Latin America and just maybe some from outside.

What do you think?, any experience with this?

Juan Jimenez
  • 499
  • 4
  • 6
  • 16
    I would say it's mandatory. You never know, maybe someone will outsource the code to some other country. – Coder Oct 12 '11 at 16:39
  • 3
    what about table names on data base? – Juan Jimenez Oct 12 '11 at 16:44
  • 8
    Consider it to be a form of obfuscation for non-english speakers. – Jon Raynor Oct 12 '11 at 16:45
  • 2
    What about in-code comments? – Sardathrion - against SE abuse Oct 12 '11 at 16:57
  • Most programmers in Latin America understand English. – hiena Oct 12 '11 at 17:51
  • Just make sure error messages that might be of use to users are in Spanish. – Jonas Oct 12 '11 at 19:10
  • 1
    Do you have variable/function/class names that use accented characters? – JBRWilkinson Oct 12 '11 at 20:34
  • One exception really has to be project name. If your project name is in Latin you could have a variable with same name as your project. It's fairly common that project names are in Greek, Latin, Spanish or other so if the word is more like a brand then I say it shan't translate everything to English just for the sake of the decision. For example I could have a variable called favela even though it is Brazilian Portuguese and means ghetto - so a certain amount of ad hoc reasoning could be preferred so we don't start translating company names or likewise. – Niklas Rosencrantz Oct 17 '11 at 17:19
  • @JonRaynor What's up? – jim Oct 17 '11 at 18:55
  • My first though is that they speak/write Portuguese in Brazil. Maybe that's not a problem I am not sure. – Martin York Oct 17 '11 at 19:36
  • 3
    If your question is about what do other developers do, this is a duplicate, as @Caleb already mentioned. If your question is whether you should code in english or in spanish, the answer should be written in your requirements document. – mouviciel Oct 20 '11 at 08:05
  • I heard of programming language written in Chinese and mere spaces! But I guess English is just the most efficient language especially when it comes to collaboration. – Erica Xu Oct 20 '11 at 09:30
  • one thing I don't think anyone has touched on yet is that this is a second order issue, it is better to have well written, well documented code in a foreign language than poorly written code and documentation in english – jk. Oct 20 '11 at 10:03
  • @jk. identifier names are possibly the most important part of documentation. – Ben Voigt Oct 20 '11 at 14:47
  • yes but from experience following decent code in Italian is better than following terrible code in english – jk. Oct 20 '11 at 16:34

11 Answers11

55

I'm French and working in a French company.

However, we do code mostly in English. Here is why:

  • We sometimes have non-French people working with us so it's easier for them.

  • We have some code coming from third parties (lib, framework, etc.), and this code is often in English, so we don't want to end up with a patchwork of French-English code.

Generally speaking, this is not a problem because you have to understand English anyway if you want to be a good programmer.

Jon Purdy
  • 20,437
  • 7
  • 63
  • 95
deadalnix
  • 5,973
  • 2
  • 31
  • 27
  • 5
    Understanding English is one thing. Being able to correctly and consistently translate terms from a problem domain you are only vaguely familiar with is a *completely* different thing. – Michael Borgwardt Oct 20 '11 at 08:10
  • That's dumb. If you are not familiar with the domain, you'll have difficulties in both languages. This is a domain understandoing problem, not a language one. – deadalnix Oct 20 '11 at 08:25
  • 4
    Wrong. You can be 100% familiar with a domain without knowing how all the terms translate to English (and sometimes there *are no* really correct translations for some terms!). It's it's not uncommon at all to have a projct with such people as domain experts who write the specs, and programmers who implement the specs for whom domain knowledge is completely optional. Forcing those programmers to translate everything to English and back, *that* would be a really dumb decision. – Michael Borgwardt Oct 20 '11 at 08:56
  • Well, the spec should be written with terms in english too. Unless tou have a national specific problem, thoses terms will exists in english. – deadalnix Oct 20 '11 at 10:45
  • 3
    You can talk all day long about how things "should" be, but that doesn't change the fact that the requirement to have everything in English incurs a very real cost (not just from doing it, but also misunderstandings and errors) that cannot always be justified. And no, it's simply not true that "those terms will exist in english". Example: In Germany, there's a broand (and very widely used) category of securities called "Zertifikat" for which no equivalent English term exists (all English terms are either more specific or more general). – Michael Borgwardt Oct 20 '11 at 11:01
  • So you have a nationnal specific problem, like I was mentionning in my previous comment. This is an exception case. Obviously, you have to know when to break the rule and it seems to be a good reason here. But it doesn't change the fact that in the general case, you should code in english. Don't code in local language unless you can demonstrate that this is the right thing to do. – deadalnix Oct 20 '11 at 16:27
  • @deadalnix "National problem domains are small corner cases"... well, except public sector, banking, insurance, education, military, accounting, transport, and so many others ;-) – guillaume31 May 31 '18 at 12:36
  • @deadalnix Always code with the exact same terms your domain expert uses. If the domain needs to be modelled in a more internationally used language (ie English), they'll tell it to you. – guillaume31 May 31 '18 at 12:41
22

In most programming languages the keywords are in English, so it generally looks a bit forced if you mix languages.

For this reason, as well as developer numbers, English tends to be the language used in most developments, even developments by companies based in non-English speaking countries.

Luke Graham
  • 2,393
  • 18
  • 20
21

In general, as said in other answers: Programming languages use English keywords, and when a project becomes larger, you might get foreign people working on the code. Additionally, concepts like "getters" and "setters" or instance in languages like Java are commonly called getFoo or setFoo and it makes sense to keep this convention.

On the other hand, you might create an application for a specific target market. I, for instance, was working for a large bank developing balance analysis software where we had German financial and legal language. In the end, we decided to use German identifiers to keep the exact terms as the English terms sometimes had a slightly different meaning; on the other side, we kept the convention to use English in other places, so we had functions like getUmlaufvermoegen() (instead of getCurrentAssets()) which looks "funny" but proved to work well, as we could easily go through the calculations together with the experts from the bank who defined the calculations we did but was consistent with frameworks etc. we used.

Pang
  • 313
  • 4
  • 7
johannes
  • 3,601
  • 2
  • 26
  • 32
  • I wish I could upvote this more. Coding everything in English sounds great in theory, but translating domain terms for the sake of language consistency is not a great idea... – Michael Borgwardt Oct 20 '11 at 08:07
5

I live in Colombia and we are taught to write our code in english for the sake of universality, most of the good programmers know the 2 languages anyway because its necessary and because almost all good documentation and reference is writen in english;

So i think is safe to write your code in english its very likely that they are going to understand and it is a good practice.

jsrc1115
  • 51
  • 2
5

This is a tough one. The problem with having all the variable names in English is that you have to translate the customer's domain from their native language into English. And that is really hard sometimes, as naming stuff is one of the more difficult problems in programming. If you are trying to practise DDD then creating an ubiquitous domain language is nearly impossible. There will always be two versions of every concept and meaning gets lost in translation.

But on the other hand if you mix another language into the code base (besides English) then it will always look messy and be unreadable for everyone that cannot speak that language.

As a native English speaker living in Sweden, I lean towards translating everything to English except for the odd word that just cannot be translated without losing some of its meaning.

Daniel Lee
  • 150
  • 6
3

We were discussing coding standards recently at work and an interesting point came up. We are English speakers in the UK, and we have been directed to code in US English. As hard as it is for us to swallow our pride, we have to accept that this is the right thing to do. Although there is no difference in the keywords, much of the .NET framework is in US English, and I accept it is better to keep the consistency, rather than put national pride first :).

It also might help your English (not that there's anything wrong with it!). The big question is, with the emerging economies on the rise, when will us English speakers have to learn to code in Brazilian Portuguese, Russian, Hindi or Mandarin :)

Paul T Davies
  • 3,144
  • 2
  • 22
  • 22
  • yeah good point Paul I think things are kept reasonably simple with English but who knows what's in store for the future? If I may be a bit drastic or draconian here hah Who knows in the next decade if humans will code? Us lot will be replaced by a bunch of machines! – MalsR Oct 13 '11 at 10:41
  • Maybe, but who's going to write the code for the machines? :) – Paul T Davies Oct 13 '11 at 10:53
  • Crikey hmm yeah it's all uncertain I'm afraid :) – MalsR Oct 13 '11 at 11:42
  • 3
    I am brazillian and code in UK english when I remember the UK version of a word or construct. :P I think UK english is more beautiful and sounds better. – speeder Oct 18 '11 at 17:59
  • sometimes the spelling differences help e.g. Color is a type Colour is a property – jk. Oct 20 '11 at 10:01
3

I live in Italy and here you usually see English mixed with Italian or English words with Italian suffixes.. This is very widespread, for example in a slide in a CS university course I saw:

bool checkFatto;

("check done")

I'm a strong believer that all code, including comments, and even including in person developer talk should be in english. Italian simply doesn't have many of the required words required to discuss programming topics. But this is virtually never done.. Maybe that's why I chose to telecommute for an american company.

Something that bothers me just as much is people who google programming questions in italian or look up the italian wikipedia. They have no idea of the quantity of the information they are missing out on (such as the entirety of SO).

Andreas Bonini
  • 1,073
  • 1
  • 9
  • 16
  • 4
    In person developer talk? I really don't think so. If I speak with my colleagues that have the same native as me, I am going to speak with them in that. And if some term doesn't exist there, or it wouldn't be clear, I'll just use the English term. Being good programmer requires you to **read** well English technical text. But that's not the same as being able to *speak* coherently in English. – svick Oct 12 '11 at 21:46
  • 1
    I dont understand why this question get a downvote. +1 for me since I agree I can't imagine seeing stackoverflow clone in Italian. – Rudy Oct 13 '11 at 03:35
  • It's not that Italian doesn't have the words, It's more that Italian is a much more verbose language. – Adriano Varoli Piazza Oct 18 '11 at 18:28
2

English:

GetUserInvoices(int userId);

Spanish:

ObtenerFacturasDelUsuario(int idDeUsuario);

English words are usually shorter and easier to read, that's one of the reasons why I usually code in English (I am from Spain). The other one is that I find ugly to mix Spanish words with the English language keywords and framework classes and members.

Konamiman
  • 617
  • 4
  • 12
0

It's a dilemna from me: for mechanism and key words, or read documenation, no real problem.

My english is poor, and this language have no words for many subtle significant ideas.

I've tried to developp in english, it lead me astray, and I have to make it again with known words that represent the real world.

So, for core/essential code it is in French (nobody's perfect) with dual languages translation with hope that for a native english it is not so diffucult to have the keys of understanding close to the some piece code (not all).

It is not proudness, just to enrich the work with different cultures and to do job in the best manner.

cl-r
  • 37
  • 2
0

When we started our application five years ago we only had 4 Dutch programmers. But we wrote everything in English.

Today, our code is used by French colleagues and Indian developers. Thanks to using English, they can also use our code. The French colleagues have quite a bit of french in their comments and naming schemes. We can still make some sense of it but it's a lot easier if everything is in English.

In short, what if tomorrow you have a few Brazilian colleagues?

Carra
  • 4,261
  • 24
  • 28
-1

I firmly believe that no serious developer can be uncapable of, at the very least, understanding English in written form. How else would you refer to any library's documentation, read a book on a highly specialized matter or even use Stack Overflow?

In your particular case, chances are that if a client "requires" the source code to be in their local language, they could be a quite low-profile company, and perhaps you wouldn't like to establish a relationship with such a customer.

deprecated
  • 3,297
  • 3
  • 20
  • 26