A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people understand.
However, how can one choose to name a function when it could have different valid English spellings. For example, would one name a function get_center
or get_centre
?
Are there some rules of thumb to choose, do we choose both or just choose one arbitrarily and try to keep consistency afterwise?
NOTE: Most answers recommend using American English, which makes sense. However, I had no idea that one of the spellings was American English and the other one was Great-Britain English. Therefore, my example is not a good one. Of course I would have used center
if I had known that difference. But my question is still valid even though my example is a poor one.
NOTE²: Concerning center
vs centre
, I see that wxWidgets uses both.
5
You choose what makes sense for your organization/project, document your choice, and use it consistently. There really isn’t any universal guideline for this.
If the majority of your developers spell it “centre”, then it may make sense to standardize on the “British English” spelling vs. the “American English” spelling of “center”, since that’s what most people will be accustomed to.
OTOH, if you’re working with one or more APIs/frameworks/toolsets which use the “American English” spellings, you may be better off sticking with that for consistency with those.
But again, document your decision – not just what you decide, but why and make sure that everyone has read, understood & agreed to follow it.
1
when developing international projects, it is common sense to use English as the reference language since it is the language that the most people understand
For the very same reason, it is common sense to use American English (en-US), not any other regional accents or dialects:
-
en-US is used in every international project I’ve seen. Switching from en-US to, for example en-NZ (New Zealand) would be painful and create inconsistencies between the codebase you write and the APIs you use.
-
Variants other than en-US are less known compared to en-US. That’s why I completely disagree with both the comment of Joel Brown and the answer of alroc: if you follow their logic, then you’ll find yourself using German if you’re in Germany, or Spanish if you’re in Spain.
-
Either you are writing a local project and are completely sure that it will never be used by any foreign developer. In this case, you are not forced to stick to English in the first place, and many developers will use their language instead.
-
Or your intent is to develop an international project, which means using American English, not English used in Australia or Ireland.
-
-
If you’re using a language other than American English, it would be consistent to also use non-American localization (not at UI level, but in code and documentation). This creates additional unneeded complexity.
-
I imagine that for people who have English as their native language, it’s pretty simple to understand any English dialect or regional accent. This is not the case for foreigners. Developers working in India, China, Russia are accustomed to American English, and for them (for us), using other variant is painful.
Note: this is still just my own experience as a French developer and what a few of Indians and Russians told me. It appears from the comments that some other foreigners are more accustomed to en-UK.
For example, I have no issues watching a movie in American English, but I can hardly understand some movies shot in Scotland or Wales. Written English is more uniform, but still is slightly more difficult to read and especially write for foreigner developers.
Using English only in a professional context makes things worse. When the only usage of English for a Russian developer is his job, the person will be accustomed to write color or center, and colour or centre will be perceived as a misspelling; just a few seconds after that, the person will understand that it’s a correct spelling of a word in another regional accent.
-
Spell checkers, browsers and other tools are generally configured to be used in American English. Working on a project which uses other locale will require either a dedicated development environment or a constant reconfiguration of tools if the developer has to maintain multiple projects at the same time.
7