Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

A few weeks ago, my class was assigned to translate to Portuguese the book Real World Haskell. As I did the translation of the text and comments, I started to wonder if I should translate the code as well, as the instructor suggested. For example:

data BookInfo = Book Int String [String]
              deriving Show

would become

data InfoLivro = Livro Int String [String]
               deriving Show

Since I haven't read any software-related books in Portuguese, I don't know if that's a common practice, neither if it should be done this way. In the end, the code is a language mix (perhaps the example in Haskell is not a good one, since you can create synonyms quickly like type CadeiaDeCaracteres = String, but you get the point). So it doesn't really matter how hard you try, you'll have to rely on the reader previous experience with some sort of basic English words.

Knowing this, I really don't see the point in translating code, since we learn in the early days of our coding life it should be written in the universal language. Nevertheless, if the surrounding text (comments, for example, and text itself in a book) needs to be translated, what is possible and feasible in this matter? Can you provide me with some guidance of what to do?

share|improve this question
5  
What does the instructor expect you to learn from this? Yes, you might learn a little about Haskell, but it sounds like it's mostly a test of your English translation skills. Does he just want a translation for future classes, and he thinks wasting the time of all the students in this class is the way to accomplish it? My bet: all you'll learn is why translation is a specialized field best done by experts. –  Dori Oct 21 '10 at 4:02
    
Related question: programmers.stackexchange.com/questions/1483/… –  David_001 Oct 21 '10 at 6:37
    
@Dori I completely agree. Sadly, that's how my university works, at least in CS field. –  Raphael Montanaro Oct 21 '10 at 15:12
    
you should tell him something like this: """Professor, você está realmente louco. Eu preferiria dormir com sua mãe do que fazer isso. Aprenda Inglês ou perecer.""" –  Job Jan 23 '11 at 18:41
add comment

2 Answers

In my opinion, no. Most programmers are forced whether they want it or not, to learn english, and nowadays it is the lingua franca of the software world.

In my experience, however, books written by authors in one of the stronger languages, have a tendency to do that - so far I've seen the practice in books in german, french and russian (well, russian is a little different of a case, since they use different alphabet as well). It is a rule of thumb that it depends on the country's dependency on english.

The text is of course translated, the bigger comments also (one that describe the workings of a program in greater detail), then somewhat more rare, smaller comments and variable names. I've also seen the case where variable names were translated, but smaller comments were left in english. I believe the author however, in that particular case, was counting on his audience to have a working english knowledge.

Sorry if this didn't solve your dilemma, but there still isn't a consensus on this one :-/

share|improve this answer
add comment

I'm brazilian [we speak portuguese here, ofc] and, when I can choose between the original or the translated version, I always take the original, since almost every book is translated to people who aren't programmers so commands and expressions lose their original meaning after the translation.

Another reason to want books in english is that everything on web [or the best things, like this site] is written in english, so you will be familiarized with the english term and you will be able to understand better other people code... [since a good programmer would code in english, at least from my POV]

If you need to read books in portuguese [or another language] prefer those written on that language [not translated].

To make it clear: if you are going to translate that book, try to keep all code in english [comments may be translated, but not vars or funcs] and don't try to translate stuff like 'array' to 'arranjo' or 'mouse' to 'rato' [at least I would prefer the english term, people on Portugal would prefer the second, I guess].

share|improve this answer
1  
+1 for needing an expert in all three of (source language, target language, programming) –  Frank Shearar Oct 21 '10 at 5:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.