Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Should I write APIs in US spelling or British spelling? Or should I provide with mapping both of them to a single one and internally using anyone which I like so that both of them works ? At present most of the APIs are with US spelling. What is the solution for it?

edit: Is there a way to standardize this. May be support both?

share|improve this question

closed as primarily opinion-based by durron597, GlenH7, MichaelT, gnat, Snowman Aug 8 '15 at 21:36

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 13 down vote accepted

International APIs

APIs which are intended to be international use EN-US. So if your intent is to provide your API to the developers worldwide (or at least several countries where British English is not commonly used), you should use EN-US.

Local APIs

Of course, small APIs which are targeting precise country can be in the language of this country. But think twice about using EN-GB even in this case:

  • Living in France, I would personally not appreciate an API en French; English is just easier to use when it comes to development. Locale settings make it just weird to write in local language. If you've seen source code with Chinese, German or Russian names of methods, you'll understand why. What I currently see here too often is the source code which mix French names with accents (é, ê, à, etc.), French names without accents (which is completely wrong and can be misleading), English names, and misspelled English).
  • Using EN-GB can make it more difficult to use the API even for British developers. It's difficult to remember that we must write Color in C# or in PHP, but Colour in a specific API.
  • When creating a local API, can you be sure that it will not be famous on international level in one, two or ten years?
share|improve this answer
Okay, will resort to en_US for programming. – kadaj Dec 31 '10 at 9:02
One note - there was once a dialect of Basic which used literal-translation-to-French keywords, albeit with ASCII limitations ("si" rather than "if", etc). Probably the worst thing about it was that it was Basic, not that it was French. – Steve314 Dec 31 '10 at 12:13

I've seen both. An API from a British company used British English spelling (e.g., "authorise" instead of "authorize"). For lack of a better answer, I'd suggest matching the convention used on the target platform. So, for example, if you use a platform "Color" class, you shouldn't use "Colour" in your API.

share|improve this answer
Strictly speaking, both "-ise" and "-ize" are equally valid in British English, though "-ise" is probably still more common. One issue as a British developer is actually remembering (and in some cases knowing) the spelling differences. With search-and-replace and/or refactoring tools, fixing shouldn't normally be a big deal, but at times probably can be. IIRC some COM related API had two spellings for one function because of a spelling error in the first version - the mistake could never be removed completely for compatibility reasons. – Steve314 Dec 31 '10 at 12:19

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