[ACCEPTED]-Coding in Other (Spoken) Languages-spoken-language

Accepted answer
Score: 161

If I understood well the question actually 29 is: "does every single coder in the world 28 know enough English to use the exact same 27 reserved words as I do?"

Well.. English is 26 not the subject here but programming language 25 reserved words. I mean, when I started 24 about 10 yrs ago, I didn't have any clue 23 of English, and still I was able to program 22 simple things by learning the programming 21 language, even when I did not know what 20 they meant ( in English ). As a matter of 19 fact this helped me to learn English.

For 18 example. I know to do an "iteración" ( iteration 17 of course ) I had to write:

 for( i = 0 ; i < 100 ; i++ ) {}

To me the "for", the 16 ";" and the "++" where simple foreign words 15 or symbols. Later I learn that "for" meant 14 "para" and "while" meant "mientras" etc. but 13 in the mean time I did not need to know 12 English, but in my case what I needed was 11 to know "C".

Of course when I needed to learn 10 more things, I had to learn English, for 9 the documentation is written in that language.

So 8 the answer is: No, I don't see if, while, for 7 etc. in my native language. I see them in 6 English, but they didn't mean to me any 5 other thing that they meant for the programming 4 language in turn.

Is like switch statement 3 in bash: case .. esac. What Is "esac"... for 2 me the end of the switch statement in bash.

I 1 guess that's what we call "abstraction"

Score: 28

In the Java language some methods must be 7 named (at least partially) using the English 6 language because of the JavaBeans convention.

This 5 convention requires that a property X be 4 established via a pair of getX() and setX() methods. Here 3 in French-Canada, where some developers 2 are obliged to code in the French language 1 this leads to the following travesty:

interface Foo {

  Color getCouleur();

  void setCouleur(Color couleur);
}
Score: 27

I'm having trouble finding references, but 27 I'm reminded of three stories.

A Lisp hacker 26 defends meaningless functions like "cdr" and 25 "car" by comparing them to programming 24 in your non-native language: http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg01171.html

When Yukihiro 23 Matsumoto ("Matz") started developing 22 Ruby, he used english keywords even though he was writing all the documentation in Japanese!. There was 21 no English documentation for Ruby for a 20 couple years, and very few Americans using 19 the language. But now it's a world-class 18 language, and it the fact that it was born 17 in Japan is only of historical interest. If 16 the language had been using keywords in 15 hiragana, it would have had a much more 14 difficult time gaining popularity.

I read 13 an essay once -- maybe someone else can 12 find it, Google is no help today -- that 11 suggested that translating keywords was 10 misguided because the words aren't actually 9 English-- they're jargon. Not only do (to 8 use the examples above) para and pour not quite 7 have the exact meaning that for has in English, to 6 non-programmers the phrase "for loop" is 5 jibberish. Even Americans have to learn 4 a new meaning. So to translate the words's 3 superficial meaning into another language 2 is more like making a cross-language pun 1 rather than actually being helpful.

Score: 25

I really have not thought too much about 4 programming in Japanese before, but here 3 we go, using the question's code sample.

Using 2 only the language statements in Japanese 1 with the variables in English:

// In Japanese, it makes more sense to put the keywords/modifiers as
// postfix expressions rather than prefix expressions.
(i < size)か {
     (l[i])は {
     1だ:
         「もしもし。」を書く;
     省略時値:
         「いいえ、いいですよ。」を書く;
     }
} ない {
     「はい、ありがとうございます。」を書く;
}
Score: 14

As many people already pointed out, in most 57 programming languages you just have to learn 56 a few keywords, so it doesn't matter that 55 much if they're in English (or a language 54 other than yours, for that matter). It's 53 just a symbol you associate with some construct. For 52 instance, in VB you have "THEN", which in 51 many C-style languages would be "{" and 50 it doesn't make a big difference in readability 49 (well, at least that's how I see it, being 48 a Non-English native speaker).

But where 47 things can sometimes get hairy, and where 46 the choice of (natural) language matters 45 is in naming identifiers. If the names of 44 variables, functions, classes, etc, don't 43 have a meaningful name for you because of 42 a language barrier, following even the simplest 41 code can be rather challenging.

I remember 40 someone once gave me a short snippet of 39 Actionscript taken from some blog. The names 38 were in German and since I don't speak a 37 word of that language, stuff could have 36 been called var_123, var_562 or func_333 35 as well (and probably it would have been 34 easier for me to remember the names or at 33 least to have a chance of spelling them 32 right without copying and pasting). Since 31 this was a short, self-contained snippet, I 30 used an online translator to give those 29 vars and functions meaningful names in my 28 native language (Spanish) and after that, everything 27 was clear. The point is that the code was 26 actually simple, but I was only able to 25 make sense out of it without too much (unnecessary) extra 24 effort just when I overcame the language 23 barrier.

Since then, I've switched to using 22 English for naming identifiers. Whether 21 you like it or not, it's the "koine" for 20 programming, engineering and generally technical 19 stuff. Most of the APIs are written in English 18 and so is most documentation (and probably 17 the best resources you can find are in English 16 as well). As a nice aside, it keeps your 15 code more coherent with the code you're 14 likely to be interacting with, and I think 13 it tends to be more compact and succinct 12 than other languages like Spanish (which 11 otherwise would be my natural choice).

Of 10 course, if you can't understand at least 9 some English, the problem remains the same, so 8 it's not a perfect solution. But, given 7 a number of developers from many different 6 countries, chances are that the common language 5 for them to communicate (through code and 4 of course other means) will be English. So, choosing 3 English is perhaps the best option, even 2 though it would be not the perfect solution 1 to this problem.

Score: 10

The programming language defines keywords 21 and standard class names, and it's best 20 practice to give user defined types, variables 19 and functions also English names (as a non-native 18 speaker I can tell ;-).

So yes, if all is 17 well, you'll be able to read the code.

However 16 languages like Java and Perl allow the full 15 Unicode set for identifiers, so if somebody 14 writes his class names in Kanji, you'll 13 likely have a problem.

Update: For Perl there's 12 a joke module that allows you to write Perl in Latin. But 11 it's really just that, a joke. Nobody uses 10 things like this seriously.

Second Update: The 9 idea of localized programming languages 8 isn't that ridiculous. Excel's macro language 7 is localized, but luckily it's stored in 6 one canonical language (English) in the 5 file, so the localization is just a layer 4 on top of the normal thing. Such things 3 only make sense for small "programs", for 2 "real" programs it becomes hard 1 to maintain.

Score: 7

Actually there are some Non-English-based programming languages (Wikipedia)

I'm Norwegian 5 but I've allways used English for all code 4 except output (ignoring some silly code 3 from school). Actually I usually write everything 2 in English and then translate it to my native language, using 1 gettext (or something).

Score: 6

I am British and a problem we often run 12 into is the American/British spelling clash. This 11 often occurs with programming related terms 10 such as Initialise() or Initialize(), Analyse() or 9 Analyze() etc. This can (has) lead to problems 8 trying to overriding methods, and is sometimes 7 difficult to spot.

Since the framework (in 6 our case C#) was designed by Americans, we 5 found that it is best to be consistent and 4 use American spellings. We even adopt Color.

We 3 have a mix of nationalities in our development 2 teams and most non-British people tend towards 1 American spellings naturally.

Score: 4

AppleScript was once available in French 2 and Japanese dialects. I do not know why 1 it was withdrawn.

Score: 4

Taking this to the next level, what about 11 being able to substitute symbols?

After seeing 10 languages like Brainf**k and Whitespace I thought of making 9 a language like this: it'd be identical 8 to C except you use closing braces to open, opening 7 braces to close, swap the meanings of + and 6 -, * and /, ; and :, > and <, etc.

The 5 concept is nothing more than a gimmicky 4 altered C compiler. But, like thinking of 3 keywords differently, it challenges you 2 to rethink some basic assumptions if you've 1 never thought of such things before. Ex:

int foo)int i, char c( }
    int six = 2 / 3:
    int two = six + 4:
    if )i > 0( }
        printf)"i is negative"(:
    {
{
Score: 4

I'm in a French team developing a software 16 system in C#. Despite the fact that the 15 programming language keywords are ostensibly 14 English, I imagine that you would have great 13 difficulty reading the code as all the function 12 names, variables, code comments, database 11 tables and columns, technical specifications, protocols 10 and so on, are all in French, including 9 those lovely accented characters ç, é, è, ù, etc. I'm 8 not even certain if the system would even 7 run elsewhere due to localisation bugs, such 6 as relying on the comma to be the default 5 decimal seperator.

Otherwise, WinDev is a 4 popular programming platform in France, and 3 its programming language WLanguage has keywords 2 in either French or English, see and example 1 here : link text

Score: 4

The only language I saw localized is Excel with 5 its macros. If you try to sum a column using 4 an Italian version of Office you have to 3 write SOMMA(A1:A10) and not SUM. That's a shame.

By the 2 way, just because it's fun, here's how your 1 code should look like with Italian keywords:

se (i < size){
    commuta
        caso 1:
            stampa "hi there"
        normalmente:
            stampa "no, thank you"
} altrimenti {
    stampa "yes, thank you"
}
Score: 3

i've seen VBA translated into spanish-like 5 commands. it's one of the ugliest things 4 ever seen. i would be ashamed to have something 3 like this on my computer.

PD: i happen to 2 think that spanish is a much nicer language 1 than english; but translating is WRONG

Score: 3

Well, As others pointed-out, the keywords 11 and system calls would likely remain in 10 English.

However, understanding the keywords 9 of the language is only a small part in 8 understanding the code. Variable names, function 7 names and comments all risk being in the 6 native language of the author.

Edit: I just flashed-back 5 to my youth where I went in the mapping 4 tables of my TRS-80 built-in BASIC to switch 3 the keywords to French. I could change all 2 the keywords but I couldn't make any of 1 them larger. Made for funny programs.

Score: 3

Don't make fun of this. Some years ago, Microsoft 12 had announced G# (German Sharp) - C# with 11 German keywords and API. Of course, it was 10 an April Fools joke, but the entire site 9 about that looked so real and professional 8 (and was on microsoft.com). Scary.

At work, we 7 use two field bus systems, both developed 6 in German-speaking countries, which have 5 a scary mix of German and English for identifiers, including 4 some lovely false friends. It's a mess.

No, English 3 keywords and identifiers are fine. Though 2 some might argue if it should be Color or 1 Colour :)

Score: 3

In several VBA project I've worked on (yes, very 9 early in my career) we had to detect the 8 version of office which was installed on 7 the user's machine and change the formulas 6 used in the speradsheets accordingly.

As 5 i program in portuguese"SUM" would have 4 to be translated into "SOMA" and so on and 3 so forth. I just can't imagine the necessary 2 work to make this happen in several languages. Has 1 anyone else suffered with this problem?

Score: 3

There are some languages that have translated 31 keywords. Excel formulas, for example. If 30 you write some calculations in a spreadsheet, this 29 will be in your language.

Fortunately, this 28 is not a general practice, and even non-English 27 speakers like me thank God that there is 26 a standard language for keywords :

  • it's easier to share you work.
  • it prevent documentation from becoming a bigger nightmare that it already is.
  • English words and sentences are usually short and syntactically pragmatic. In literature, Latin languages are much more beautiful, but for technical stuff, English rocks.

And where 25 to stop ? Can you imagine a C in ancient 24 Greek ?

Keywords must stay in one language, and 23 well, it started with English, let it stay 22 that way. This could have been worst (Asian 21 language ?). And so we have to write methods 20 and comments in English. Ok, more work for 19 us, but at least the international code 18 base stay congruent.

There is, however, one 17 case where using native language method 16 names and comments can be a good practice 15 : in third world country. I'm going to Senegal 14 in some months to manage a Django project. Senegal 13 have a huge analphabetization rate, and 12 therefor it's already great that they spead 11 energy in improving they programming knowledge. French 10 is the native language here, so it would 9 be inefficient to force them to learn computing 8 AND a new tongue at the same time.

BTW, that 7 would be your code with French keywords 6 :

Si (i < taille) {
    cas par cas :
        cas 1:
            afficher "salut"
        défaut:
            afficher "non merci"
} sinon {
    afficher "oui, merci"
}

Not that translating the keywords have 5 nothing to do with translating the strings. Of 4 course, we have "hi, there" translated in 3 our language. European coders even tend 2 to use I18N much more than American sot 1 their service can reach a wider audience.

Score: 2

Generally speaking, most programmers adapt 10 to the English form. I learned to program 9 when I was 7 years old and only spoke Hebrew 8 (which is right to left) and with no english, which 7 made it quite a fascinating experience.

The 6 problem you would usually get is with documentation, variables, and 5 function names. I have seen my share of 4 variables in other languages using english 3 alphabet.

The only language I'm familiar 2 with that actually got translated was good 1 old Logo (still amazing to this day).

Score: 2

When I was a kid we went to France, and 10 in a museum we went to, I remember finding 9 a display which showed you how to write 8 computer programmes. The language was some 7 kind of BASIC variant and I distinctly remember 6 it using POUR instead of FOR, and so on. I 5 was 7 years old and had only just learned 4 BASIC, and it seemed completely natural 3 to me that the French would have their own 2 dialect like this!!

I guess it may have been 1 LSE that I saw?

Score: 2

Filemaker's scripting language is localized. The 21 scripts (and data!) are stored in a terrible 20 "sorta canonical" form.

So if you write a 19 script in the American version, then open 18 it up in the French version, all the keywords 17 and built-in function names will be in French. But 16 why won't it run?! Aha! The French version 15 uses "," as the decimal point, and therefore 14 to avoid ambiguity uses ";" to separate 13 function arguments -- where the American 12 version uses "." and "," respectively. This 11 conversion you have to do yourself.

So you 10 work through the incredibly bad script editing 9 interface (you can't write scripts as text 8 files) to fix all these things. It runs! Great! The 7 results are all wrong! Oh no! Aha! The 6 Jan-7-2004 date you entered in the American 5 version is being interpreted as July-1-2004 4 -- apparently dates are not only displayed 3 but stored in locale-dependent order. Am I kidding you? No.

[Note: Filemaker 2 8 and 9 may be sane -- I only ever worked 1 with 3 - 7.]

Score: 2

Your question is an interesting one with 8 regard to Perl because it's syntax is designed 7 to follow (English) natural language. I 6 wonder if that makes it more difficult for 5 non-English speakers...

Of course, Perl and 4 Perlers refuse to play by conventional rules. Mad 3 scientist Damian Conway wrote the Lingua::Romana::Perligata module 2 which uses the black magic of source filters 1 to allow you to write Perl in latin!

Score: 2

Here in Australia we still need to spell 5 colour like color. However, I do find it annoying when 4 other (Australian) developers, working on 3 an Australian project, decide that internal 2 variable names need to be spelt the american 1 way.

Score: 1

It would be pointless, IMHO, to i18n a language 4 syntax. It would just kill any sort of portability.

The 3 only exception are educational languages, such 2 as LOGO. They were designed for ease learning, so 1 portability is not an issue.

Score: 1

I read a lot of code, but the problem always 6 is at variable/method names and comments, if 5 they are commenting their code on their 4 own language, using a language special characters 3 like Japanese or Cyrillic, we are in trouble! but 2 the keywords I think they will stay in English 1 as they are.

Score: 1

in Italian

se (i < dimensione){
    scegli
        caso 1:
            stampa "ciao"
        mancante:
            stampa "no, grazie"
} altrimenti {
    stampa "sì, grazie"
}

To confirm the worries of some 11 previous poster I've seen a Fortran code 10 with a macro include to translate all the 9 keywords from English to French. Allow me 8 not to continue on this.

I also had to work 7 with a code simultaneously containing identifiers 6 in Italian, German, English and French, not 5 only because it was developed in many different 4 places, but also because the main developer 3 thought it was fun and helped him not to 2 duplicate identifier names (of course, with 1 a routine 2000 lines long....)

Score: 0

I think WordBasic was localized. WordBasic 6 was used to write macro's for in Word before 5 VBA was used.

If I remember it correctly, only 4 WordBasic written in the English version 3 would execute on all localized version. If 2 you would write a Dutch version, you could 1 only execute it on a Dutch Word.

More Related questions