PDA

View Full Version : Programming in foreign languages



Govtcheez
12-15-2004, 09:47 AM
I've just been given a program written by someone else here to finish up. It's about 85% complete, but he needs more time to focus on some other jobs, so I inherited it. The author's originally from Ecuador, and going through his code, I'm noticing that every one of his variable names are in Spanish. Right now, I'm looking through the 50-odd pages of code and feeding words I don't know into babelfish. (also, there are no comments at all in this code, but I don't know if that matters, since I wouldn't be able to read it anyway)

This kinda got me thinking. I know that we've got people from all over the globe here, and presumably some people working for companies where the common language is not their own. When you write programs, do you normally write it in your native language or in the one that's more convenient for the other people around you?

Not the most interesting question in the world, I guess, but it's better than figuring out what the guy meant by "For each archivo in subcarpeta"

adrianxw
12-15-2004, 10:29 AM
For each file in the subfolder?

Otherwise, depends on the employer/client/project/situation.

Often a client or customer will never see the code so they are out of the loop.

Installation standards usually define the working language for naming variables and so forth, where they do not, the project team/manager usually decide. Big projects with a lot of foreign workers usually have English as their house language.

At home, I use a mixture of English and Danish. It seems to depend what I am doing/mood/phase of the moon/other. I actually had to go and look, as I don't tend to think about language unless it is non Danish/English. Since I read either equally well, it is unimportant to me unless the code is likely to be seen by others.

exluddite
12-15-2004, 10:33 AM
I've wondered about that myself. Thank god I speak english, otherwise I'd have that to contend with when learning a programming language. I wonder if there are compilers that use "native" keywords? For instance instead of "Include, for, using", you'd have""Incluya, para, el usar" . Of course maybe that'd be more trouble than it's worth.

Govtcheez
12-15-2004, 10:38 AM
> For each file in the subfolder?

Yeah, I figured that out, thanks to babelfish. I've got a postit with my quick-translation guide on it now :) The only thing I'm really worried about is abbreviations where he uses part of a Spanish word and I can't figure out any meaning.

> Often a client or customer will never see the code so they are out of the loop.

Usually that's the case here (I would assume that's why there are no comments, at least). He was really resistant to the idea of handing it over to me - probably because of the bad style, use of Spanish (my boss told me he's been warned about that before), and job security.

> I wonder if there are compilers that use "native" keywords?

I was wondering the same thing.

VirtualAce
12-15-2004, 11:16 AM
I ran into this as well when researching graphics. Downloaded some code from the net and then realized all the comments and all the variables were in german. Took me forever to figure out what each variables was.

I guess just because its in C/C++ doesn't mean the entire C/C++ world is going to understand your code. After all your variables, function names, class names, macro names, etc, etc., are all probably words that are native to your spoken language.

GanglyLamb
12-15-2004, 01:02 PM
When coding for any programming class in school i use my native language ( dutch ), since its compulsory.
On the other hand while writing code which is not schoolwork i do it in english...
I didnt used to write it in english but i can still remember one of the very first times i posted some code here it was in dutch, i got little response , i even had to edit my code and translate all my variables, after that experience i just decided i should always write it in english.

Greets,

Ganglylamb.

Zewu
12-15-2004, 01:33 PM
Swedish.

whackaxe
12-15-2004, 02:04 PM
often when i code french projects, i force myself to give french variable names and stuff, but french is the worst language to use with computers. there isn't any real translation for login/logon (i use the word connection). sometimes i slip though and start commenting in english :D

adrianxw
12-15-2004, 02:31 PM
>>> I wonder if there are compilers that use "native" keywords?

A little creativity with the pre-processor could produce that. Hmmm...

maes
12-15-2004, 02:37 PM
All code is writen in English where I work. Fo comments, you can choose (dutch or english)
I usualy make all my comments in English because the source is property of our customers and thir native tongue can be dutch or french.

Sang-drax
12-15-2004, 03:25 PM
When I program, it can actually be easier for me to write comments and name variables in English, rather than Swedish. The programming language is in English, along with the documentation, most web resources and message boards, so it becomes natural to write my comments in English.


A little creativity with the pre-processor could produce that. Hmmm...
You could translate most of C++ into your language of choice using the preprocessor, but you'd still be stuck with #include, #ifdef etc.

B0bDole
12-15-2004, 06:46 PM
It makes it fun when the variables names don't have any meaning, like : int asdhjjghsdf;

reading code like that is fun, I do it in my spare time.

novacain
12-15-2004, 09:18 PM
I was working for a Polish boss. We had Russian, Sri Lankan, Canadian, Chinese, Korean, Italian and Australian workers (in a team of 10).

With the accents, and technical terms, it took me a month before I could understand what was going on in the team meetings.

B0bDole
12-15-2004, 09:23 PM
>We had Russian, Sri Lankan, Canadian, Chinese, Korean, Italian and Australian workers (in a team of 10).

Holy crap. (what the I am sillyI am sillyI am sillyI am silly is Sri Lankan?)

Zach L.
12-15-2004, 09:25 PM
Island sorta south of India.

*edit*
Well, just slightly southeast.

abyssphobia
12-15-2004, 10:10 PM
Not the most interesting question in the world, I guess, but it's better than figuring out what the guy meant by "For each archivo in subcarpeta"
that means for each file in a sub folder ;)

but I guess the guy put in that comment something like
por cada archivo en subcarpeta

and yes I would put my program in my native lenguage :D
because is the one that I understand at 100 %.Well and depends of my state of mood.


I'm really worried about is abbreviations where he uses part of a Spanish word and I can't figure out any meaning

You can ask me about the abbreviations and I would be glad to explain the meaning to you ;)

nvoigt
12-16-2004, 03:35 AM
> I wonder if there are compilers that use "native" keywords?

I was wondering the same thing.


LOL... you bet. Do you know the Excel language ? Not VBA, but the pseudo script where you can sum up columns and stuff. In a German Excel, it's translated. It's no longer IF, it's WENN ( German for if ) and so on. While it may be nice for Germans, can you imagine me sitting in front of an Excel sheet figuring out how the hell to sum up a column ? It's not SUM for sure. It's SUMME. WTF ? I am German, but how should I know what word those english commands were translated to ? For a programmer, this translation is a real pain in certain body parts.

I wrote our coding standards and all code is to be written in english. Comments are free, either in German or English but you have to chose one and stay with it for a project. I'd like it all in english, but not everyone here can write or even read english sufficiently.

Edit:
Oh, and Excel isn't even translated very well... because it just dawned on me that WENN is not the equivalent of IF. WENN means WHEN i.e. at a certain time. FALLS means IF.

GanglyLamb
12-16-2004, 06:13 AM
@nvoigt: I agree 100% with you on the excel thing, we had to do an exam in school about excel,
I have a english excel on my computer so i practised it with that version, in school they are running dutch version... so when i went for the exam i was pretty blown away since IF would become ALS ... still havent got the results so ill just pray for now :(

adrianxw
12-16-2004, 06:50 AM
>>> fun when the variables names don't have any meaning,

To make the point that there are no reserved words in Fortran, I once wrote a small program where all the variable names were, what in other languages would be keywords.



IF(NE.EQ.EQ)THEN
THEN = ELSE
ELSE
REAL = CHARACTER
ELSE = END
END IF

Slightly more fun would be to have variables names that do mean something, but not what they apprently mean.



int CharBuf;
char *RecordCount;

That kind of thing. In a nice complicated routine, creative use of that technique could be very confusing.

nvoigt
12-16-2004, 06:53 AM
Or, like my predeccessor did, name them after friends.

int John;
char Hans;
char Peter[80];

And it was not a joke... not until I had to read and understand that piece of bs two years later...

Govtcheez
12-16-2004, 07:12 AM
> but I guess the guy put in that comment something like por cada archivo en subcarpeta

Nope, like I said, no comments. The code was "For each archivo in subcarpeta". I'm programming in VBA, not C.

> You can ask me about the abbreviations and I would be glad to explain the meaning to you

Thanks, but I think it'd be a lot easier to just ask the guy who wrote it.

> Oh, and Excel isn't even translated very well... because it just dawned on me that WENN is not the equivalent of IF. WENN means WHEN i.e. at a certain time. FALLS means IF.

We were always taught that "wenn" could be used as "if" in certain situations. They said it pretty much meant "whenever", so it could be used sometimes. I seriously doubt you know more about German than my German teacher just because you live there :rolleyes:

nvoigt
12-16-2004, 07:19 AM
Wenn means when. It's asking for or waiting for a time. There is no doubt that it will happen. Only when :)
Falls means if. It's checking for a certain condition to come true. It doesn't have to come true however.

Both can be used in a normal conversation and 99.99% of Germans will either not care or maybe even not know better. But for a language that probably has less than 255 words I would have expected some grammar Nazis double checking it :)

Govtcheez
12-16-2004, 07:37 AM
What about "ob"? I seem to remember that could be used as "if" in some situations, too.

nvoigt
12-16-2004, 09:18 AM
Indeed, "ob" would be translated as "if", too. I don't think I want to explain when "ob" is used instead of "falls" or "wenn"... I'm soooo glad I learned German unconsciously. English is easy, at least you guys have rules and a finite number of exceptions. We have a ton of exceptions and once in a while we have a consistent rule as an exception.

I remember I learned english irregular verbs in school. I wonder what you do in German lessons, I'm unable to find a regular German verb :rolleyes:

Govtcheez
12-16-2004, 10:40 AM
Anyone know what "tamanio" means? I checked babelfish, where it was helpfully translated as "tamanio", and then I searched google. The first page that came up that was actually in English was this site, so I think it was meant to be.

edit: That can be our new slogan: "Cprogramming.com - Your 16th source on google for 'tamanio'"

edit2: It means size. Just an fyi.

abyssphobia
12-17-2004, 03:42 PM
Anyone know what "tamanio" means? I checked babelfish, where it was helpfully translated as "tamanio", and then I searched google. The first page that came up that was actually in English was this site, so I think it was meant to be.

edit: That can be our new slogan: "Cprogramming.com - Your 16th source on google for 'tamanio'"

edit2: It means size. Just an fyi.

TamaŅo means size, He forgot to put the Ņ or he has a keybard with out that letter, that happens all the time, you can put that letter pressing alt 1 6 5

edit: Ok I was thinking in a stremely case, yep it's better to ask him, but If you don't found him and you need that information I would give you the translation that word, ok if you have any other questions, I would be glad to help. ;)

Sang-drax
12-17-2004, 03:45 PM
Just press ~ + n to get an ņ.