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.

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
add comment

2 Answers

up vote 8 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
1  
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
add comment

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
2  
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
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.