Choosing between words with different spellings for function names

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.

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

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

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật