3 ms·
If you’re not English speaker, do you always write comments in English, or in your native language? I personally see the latter as bad practice - in 21st centur
by josefrichter 5y ago
If you’re not English speaker, do you always write comments in English, or in your native language? I personally see the latter as bad practice - in 21st century it’s almost impossible to expect that your code won’t ever be read by a foreigner. But I wonder how do you feel about it?
- DeusExMachina 5y agoI am not an English speaker, but everything that ever went into my code was always in English, including names of variables, types, etc. Programming languages are in English and there is something that irks me in having another language mixed in.
- laserlight 5y agoAgreed. But I also discovered that in some domains local jargon doesn't correspond well to its English translation, or is not available at all, which is likely the case in law and accounting. In such cases, I go with the local language.
- josefrichter 5y agoThen it’s important to add a good English comment explaining why the local jargon is used, right? :-)
- laserlight 5y agoRight :)
- josefrichter 5y agoExactly. I spoke about comments only. I can turn blind eye on occasional non-English comment or short note here and there. But naming variables and functions in local language is an inexcusable sin. I am from small country of Czechia with 10 mil people. Naming function in Czech is utterly stupid. Even if you’re sole developer, there’s a good chance you’ll want to paste a snippet to stackoverflow, sooner or later have a collaborator from nearby Ukraine or Pakistan (very common), or god forbid! - your product will be so successful someone will want to buy it. Good luck if the code base is littered with language nobody speaks :-)
- porkbrain 5y agoThe problem with Czech is our extended alphabet and, more importantly, conjugated forms of verbs and nouns. You can't make the code sound good without proper conjugation, but of course no mainstream programing language supports it.
- antupis 5y agoAt least here work language is English comments, jira tickets, code and so on. even when orginal team is fully native Finnish speakers next guy might not.
- progx 5y agoCode (variables, ...) are always in english, they are most of the time shorter than german words. Comments are in my native language, if i am absolute sure, that this code will not be used by any other people.
- josefrichter 5y agoYou can never be sure :-) Don’t you paste snippets to SO, GitHub issues or forums, when seeking help?
- masklinn 5y ago< do you always write comments in English, or in your native language? Same language as the codebase, so usually english. It can make sense for the codebase to use local naming conventions e.g. for legal, accounting, or administrative concerns: the ideas and concepts don't necessarily translate easily (or at all) and all the reference documents are in the local language in which case the codebase will probably be better off using the local language, and both comments and commit messages should match.