I'm working on a game engine in C++ and I have methods like setColour and things that use British grammar. While I was thinking how C++ compilers mostly use the English language (correct me if I'm wrong) and how most APIs use American grammar, should I go with the flow and continue the unofficial standard in the grammar programmer high council or be a rebel?
I'm not sure which.
You should use the American spelling of color
. 99% of code out there uses this, even including much of the code written by British or Australian English speakers. If you use something different, you (or someone else that uses your code) are just going to end up forgetting which to use at some point and making a needless mistake.
I'm British, and I think the right thing to do is to grit my teeth and use Color
. I wouldn't normally expect a German-speaking programmer to use Farbe
in a public API[*] and I wouldn't expect to have to provide alternative spellings like finalize
vs finalise
or localization
vs. localisation
.
The compiler will point out any mistakes, so I think providing alternative names for things is misguided. Come to think of it, it could even hinder some programmers since IDE auto-completion will have more to chew on. If you're going to use a single spelling hten "Color" is such a common word in APIs, commonly spelled without the "u", that it's wilful idiosyncrasy to spell it any other way. It doesn't help anyone much.
Obviously there's no clinching argument - you can call your functions method001
, method002
if you like, and the code will still work, so Colour
is a minor quirk by comparison. But there's a fine line between "quirky" and "misanthropic".
[*] Just because he finds it more readable than Color
, I mean. If he doesn't speak English at all, he has no choice.
Be a rebel! Go with your native English.
If you feel like tossing a sop at the Americans, provide cover functions with the incorrect spelling (facetiously: but just make sure they run enough slower that they prefer to use the right spelling).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With