Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

American English or British English Java [closed]

Tags:

java

spelling

I have a question about language in Java. I've tried googling for an answer, but although I found a related question regarding personal preference, the technical side wasn't really addressed. So this is it-

Does it matter to Java if you use British English or American English? Does it cause any complications technically speaking if you use British English (as long as your code is written consistently)?

I'm Australian and proud of the Britishness of our language so this is relevant to me.

like image 634
Laura West Avatar asked Sep 17 '25 21:09

Laura West


2 Answers

The Spec says:

"An identifier is an unlimited-length sequence of Java letters and Java digits, the first of which must be a Java letter."

You write code in Java, not in English, German or Chinese. Java doesn't care if your "identifiers" (package-names, class-names, variable-names,, method-names etc.) are a real word at all, if you look at obfuscated code, you'll see class-names like "A" and method-names like "x". Since Java supports Unicode, you could use non-ascii letters like 'ö' or even Chinese signs.

Java-Keywords (public, protected, while etc. and true, false and null of course) are fixed, you have to write them the way the Specification says.

like image 51
hinneLinks Avatar answered Sep 19 '25 11:09

hinneLinks


The ultimate goal of any code (Java or not) to be easy readable. You should not use terms that others can't clearly understand (domain-specific terms are exception). So choose not between British and American, but between less and more clear.

like image 36
Denis Kokorin Avatar answered Sep 19 '25 11:09

Denis Kokorin