Some people have trouble doing programming with syntaxes taken from English. Would you program better if (well, this is a big if) the programming language syntax were in your native language?
views:
351answers:
18Programming language is not english ;-) Will another person understand if you tell him
if (foo>bar)
echo "foo is greater";
else
echo "bar is better";
Think about the world today. Programmer from another country supporting an application developed by a developer from another country. Will this be possible if we had programming languages in native language.
About 6 or 7 years ago my upper secondary school had a IT & economics class where we used excel. The version of excel we used was in norwegian, and so was all of the syntax; if(...) had become hvis(...) etc. This was probably why i havent used excel since then.
Do not mess with Programming Language syntax, it will never catch on and it will ultimately be a waste of time.
It probably makes it easier for beginners to memorize and digest concepts of programming. I remember when I was in school in Vietnam and first introduced to dos programming, I had to first memorize the meaning of the keywords in order to better memorize the syntax and usage of a keyword.
1) I used to be an OS designer. I once contracted to write a device driver for a DataSaab (of Sweden) minicomputer in what they claimed to be some procedural langauge. The source code arrived, and the programming langauge was something DataSaab had designed, complete with Swedish keywords, Swedish variable names and Swedish comments. I like Swedes but don't know Swedish, and this contract ended badly for me, so the answer is clearly yes.
2) I work with customers in Japan that build large embedded C systems. Fortunately, the C compiler they use has the standard keywords. But they write comments in Japanese.
I'd say the answer was clearly yes.
@Shoban's answer
I liked your example, so I took it and translated it with Google Translate to Chinese (Simplified)
如果( foo的“酒吧)
回声“ foo是更大的” ;
其他的
回声“酒吧是更好地” ;
What did I learn from this example? I learned that 酒吧 is "Bar" in Chinese
(Sorry, for creating a whole answer instead of a comment but comments don't indent)
No, language is not logical at all. Programming is logical. Easy ways to express yourself.
After writting in English for so long, I must say that I have come to like it better (with a few reservations) than my native language. I properly also write it better than I write Danish, at least I write more English than I do Danish.
So no I cannot see how changing a few keywords would alter my ability to program. I don't even see the if statements anymore, all I see is blond, brunet, ...
There is a programming language called 1C, it's syntax is in russian. Person who decided to do that should be beaten to death.
As another example of why the answer is No, consider the original COBOL language. Here's how you would calculate the zeros of a quadratic:
MULTIPLY B BY B GIVING B-SQUARED.
MULTIPLY 4 BY A GIVING FOUR-A.
MULTIPLY FOUR-A BY C GIVING FOUR-A-C.
SUBTRACT FOUR-A-C FROM B-SQUARED GIVING RESULT-1.
COMPUTE RESULT-2 = RESULT-1 ** .5.
SUBTRACT B FROM RESULT-2 GIVING NUMERATOR.
MULTIPLY 2 BY A GIVING DENOMINATOR.
DIVIDE NUMERATOR BY DENOMINATOR GIVING X.
Admittedly, there is a less wordy way of expressing this.
(Example stolen from Wikipedia)
EDIT: for those who don't know the history of COBOL, it was designed (in the 1950's) with a syntax that resembles English so that non-technical people types could write programs. It patently did not succeed in that goal.
"I'm thinking about syntactic sugar, you can switch the "keyword set" between languages. You can see the code in English if you'd like."
That wouldn't constitute a "native language". Grammar is so divers, it's not enough to simply switch keywords. In fact, it would make even less sense if you'd only exchange keywords.
Rough illustration:
if (x > y) {
echo "X is bigger than Y!";
}
もし (x > y) ならば {
"X is bigger than Y!"を出力;
}
So, I'd go for No.
I prefer programming in English, especially with frameworks like Ruby on Rails which depend on some language rules. Sometimes I use the transition from my mother tongue to English as a formalization step. (Outlining in German, English names for fixed, formalized concepts).
It can be an advantage to call some things (objects, classes) with your mother tongue (if it's not English) to disambiguate it with language or framework-specific keywords like "class" and so on. It seems to be common practice to use "klass" or "klasse" (German word for class) among English-speaking programmers, not only in the KDE world ;)
I think IBM tried this once for some printer language that was translated into German. Big flop. Personally, I don't see the benefit. If your English is SO bad that you can't even remember "if", "while", "return" etc, then you definitely have more urgent problems than learning how to program.
No.
Localized documentation, maybe. But the programming language? Who cares?
The level of abstraction on which one works when solving a programming problem goes way above the language of the keywords.
I have never felt that the few keywords in a programming language get in my way, even if I am not a native English speaker. Hell, in my first job with a US company they were amazed that I did not know what "napkin" means, after passing hours of technical interviews. My answer was "I don't need napkins to program" :-)
I'm French...I use English variable names, I even write comments in English.
English is universal. We have enough incompatible standards already !
Yes. I am 100% certain that we all would. Anyone who says differently is deluding themselves based on habit.
However, the benefit or global interoperability of syntax is much bigger. There's people from all over the world discussing specific programming problems on here. If the syntax were localized, this would be almost possible, since you'd have to translate the syntax as well, and probably make mistakes in doing so.
Also, language keywords are nothing compared to API libraries. Having native keywords would be pointless without a native version of API libraries, since those make up a bigger part of most code than keywords do. Having e.g. the entire Java standard API translated into incompatible language versions is obviously absurd. Of course you could have interoperability based on an "internal" name that is not translated, but then people would probably start refering to the methods by that internal name (which would probably be in English).
Reminds me of Literate Programming as described by Donald Knuth.
A methodology that combines a programming language with a documentation language, thereby making programs more robust, more portable, more easily maintained, and arguably more fun to write than programs that are written only in a high-level language. The main idea is to treat a program as a piece of literature, addressed to human beings rather than to a computer.
I really wonder how this would go about given the kind of discussions design meetings have in real life.