Non-native english coders : In which language do you comment
Moderator: Moderators
Non-native english coders : In which language do you comment
I was wondering about this. Because I think I had to comment my code in english if I ever make it public so that people could understand the code.
But it is also a problem because I have to think a lot more to comment my code in english and it makes the coding process slower, also it is slower if I go back to some code I wrote long ago to understand the comment in (poor) english I made.
So I think it should be easier to just comment in french (my language) but then some computer related terms are just untranslatable !
So I end up mixing english and fench in my comments and I don't know if this is a good idea !
Especially becuase I always use english variable names, if they were in french it'd be ridiculously long and unpractical.
But it is also a problem because I have to think a lot more to comment my code in english and it makes the coding process slower, also it is slower if I go back to some code I wrote long ago to understand the comment in (poor) english I made.
So I think it should be easier to just comment in french (my language) but then some computer related terms are just untranslatable !
So I end up mixing english and fench in my comments and I don't know if this is a good idea !
Especially becuase I always use english variable names, if they were in french it'd be ridiculously long and unpractical.
Guido van Rossum, benevolent dictator of the Python programming language, is Dutch, but he comments in English according to PEP 8:
Guido wrote:Python coders from non-English speaking countries: please write
your comments in English, unless you are 120% sure that the code
will never be read by people who don't speak your language.
When programming, I write everything in english: variables, comments, documents, everything. Not because I want people from around the world to understand what I do, but because I think english is more concise and less ambiguous than portuguese, making it more efficient for describing technical things.
The only exception for me is at work, where not everyone speaks english and we make things that deal with real-life things that only exist in our country, so it would be really silly if I tried to describe such things in english.
The only exception for me is at work, where not everyone speaks english and we make things that deal with real-life things that only exist in our country, so it would be really silly if I tried to describe such things in english.
It depends from purpose of the programming. If it is something that is going to be released and going to be useful for people from the whole world - in english, if it is something for personal use or is useful for local use only - in my native english. I usually don't comment code for personal use too much, though.
Commenting code in english does not slow down the process, because it is rather formal, with limited set of worlds (this does that, this changes that etc) - it is not a poetry or something.
Commenting code in english does not slow down the process, because it is rather formal, with limited set of worlds (this does that, this changes that etc) - it is not a poetry or something.
Everything in english.
My mother language is portuguese-br, but I'm always writting C code using english, always. I have no special reason for it...


Zepper
RockNES author
RockNES author
All English for me for the same reasons tokumaru mentioned.
I can't even talk about anything computer-related in German without constantly wishing for words as precise as their English counterparts, so I end up with long sentences explaining everything which makes communication in my mother language take longer.
Then again, I suck at everyday conversations. I'd die of hunger having an American breakfast because I wouldn't know how to ask your Dad if he could pass me a particular thing whose English name I forgot.
I can't even talk about anything computer-related in German without constantly wishing for words as precise as their English counterparts, so I end up with long sentences explaining everything which makes communication in my mother language take longer.
Then again, I suck at everyday conversations. I'd die of hunger having an American breakfast because I wouldn't know how to ask your Dad if he could pass me a particular thing whose English name I forgot.
- rainwarrior
- Posts: 8062
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
English is my native language, but I've always been impressed that so many non-native-English coders make the effort to leave English comments. I don't expect/demand it, but I do appreciate it. (Non-English comments I attempt to translate if I need to; at least the internet has made rough translation fairly easy these days.)
On a related note, my brain seems to automatically write comments in Canadian English, but uses U.S. spellings like "color" and "center" in the actual code. This may be confusing.
On a related note, my brain seems to automatically write comments in Canadian English, but uses U.S. spellings like "color" and "center" in the actual code. This may be confusing.
I'm surprised how many of you comment everything in english.
Before I commented in english but I figured it slowed down me a lot and I made crappy comments anyways.
English is okay to say "this does that" etc... but when I'm doing complex things involging jongling with the X, Y regs, stack and various temporary variables (which about any routine with deals with complex maths does), it's complex to explain it to myself in english so I prefer using french so I can just write it down and read it without thinking too much.
Before I commented in english but I figured it slowed down me a lot and I made crappy comments anyways.
English is okay to say "this does that" etc... but when I'm doing complex things involging jongling with the X, Y regs, stack and various temporary variables (which about any routine with deals with complex maths does), it's complex to explain it to myself in english so I prefer using french so I can just write it down and read it without thinking too much.
Useless, lumbering half-wits don't scare us.
I'm the exact opposite... I have a lot of trouble explaining in portuguese things that would need really simple and small sentences in english. I find that portuguese either lacks words to properly describe programming concepts or the words that do exist just sound weird. "Scrolling", "array", "register", "mapper" and "bank switching" are examples of things that sound really weird in portuguese, at least to me.Bregalad wrote:when I'm doing complex things involging jongling with the X, Y regs, stack and various temporary variables (which about any routine with deals with complex maths does), it's complex to explain it to myself in english
English also has some handy shortcuts that make it easier to describe things... For example, you can say "memory-mapped registers", and you only need the dash to connect the words. In portuguese you absolutely need a preposition to connect them: "registradores mapeados em memória". Not only individual words are usually longer (see "registradores" vs. "registers"), but you also can't take shortcuts that are possible in english.
-
Celius
- Posts: 2159
- Joined: Sun Jun 05, 2005 2:04 pm
- Location: Minneapolis, Minnesota, United States
- Contact:
I think if you are releasing code into the public, English is the most universally accepted, so I would recommend English comments in that case. However, if it's just for your own viewing, it's best to do what's easier for you to understand.
Like Tokumaru was pointing out, I think a lot of programming concepts are easier to explain in English. Plus, programming languages are usually much like English, so commenting on it is often like expanding on what the line of code says by itself.
I also can't help but feel like the same words feel a lot more organic in other languages, which throws me off. Like when I read "memória" in Tokumaru's post, I had a hard time thinking of RAM instead of someone's mind. Maybe that's just me, though. Plus I'm not really one to talk because English is my native language.
Like Tokumaru was pointing out, I think a lot of programming concepts are easier to explain in English. Plus, programming languages are usually much like English, so commenting on it is often like expanding on what the line of code says by itself.
I also can't help but feel like the same words feel a lot more organic in other languages, which throws me off. Like when I read "memória" in Tokumaru's post, I had a hard time thinking of RAM instead of someone's mind. Maybe that's just me, though. Plus I'm not really one to talk because English is my native language.
- Hamtaro126
- Posts: 783
- Joined: Thu Jan 19, 2006 5:08 pm
I live in the USA, And most of us speak English, so I think if anyone were to use only English to comment code, it will make complete sense to 98% of the people, Making it readable for the most part!
English is really the most hard, but yet ESSENTIAL language to learn because of it's semi-universal use.
English is really the most hard, but yet ESSENTIAL language to learn because of it's semi-universal use.
AKA SmilyMZX/AtariHacker.
I'll only write comments in English ever, not only because this is easier for me to type and for others to read, but putting anything but English (or, better phrased, anything but standard ASCII) in a plain text file will just mess things up (unless you need to put string messages in another languages in your codes). Accented characters and C/J/K characters aren't actually guaranteed to be displayed correctly when the files are opened in a different system. For example, if you open a Japanese text file with notepad (and even notepad++) in Chinese Windows, 99.95% of the time the Japanese text will only appear as corrupted gibberish. Even opening simplified Chinese files in a traditional Chinese system won't work. (That's why I use Applocale and create shortcuts for launching notepad, command prompt, 7-zip manager, etc. in different languages.)
The introduction of Unicode actually doesn't help much. This problem still persists most of the time.
The introduction of Unicode actually doesn't help much. This problem still persists most of the time.
I think I know why that might be: the example sentences used in foreign language classes refer to organic subjects. They don't try to teach a language and computer science at the same time. Imagine how "Memory, all alone in the moonlight..." must sound if you've been installing RAM all day in a computer factory.Celius wrote:I also can't help but feel like the same words feel a lot more organic in other languages, which throws me off. Like when I read "memória" in Tokumaru's post, I had a hard time thinking of RAM instead of someone's mind.
I think I know why that might be too: Microsoft prefers UTF-16 over UTF-8. Writing foreign language comments in BOM-less UTF-8 is probably the cleanest way to do so in programming languages that expect the program to be written in ASCII, and it appears common practice on UNIX. But as I understand it, it isn't possible to set a Windows app's default code page to UTF-8 the way it is with certain other multibyte code pages such as Shift JIS. Furthermore, Windows Notepad forces you to insert the BOM whenever saving a UTF-8 file, which causes programs to fail to compile because compilers don't know what to do with a BOM that isn't marked as a comment.Gilbert wrote:The introduction of Unicode actually doesn't help much.