Tag Archives: Naming convention

Using Java Naming Conventions and Andriod Naming Issue

This article on naming conventions is based on Java, some rules apply to other programming languages as well.

I highly recommend this article to new programmers who are yet to have their own naming styles (for functions, variables, etc).

This is especially useful if you are just starting to learn programming.

If you are a experienced programmer with your own naming styles, you may want read this and see if there is anything to improve your naming techniques.

Original article: http://java.about.com/od/javasyntax/a/nameconventions.htm

Note on meaningfulness and length:

When choosing a name for an identifier make sure it’s meaningful.

Don’t worry about the length of the name. A longer name that sums up the identifier perfectly is preferable to a shorter name that might be quick to type but ambiguous.

There are 4 types of letter cases for naming:

Lowercase is where all the letters in a word are written without any capitalization e.g.

Uppercase is where all the letters in a word are written in capitals. When there are more than two words in the name use underscores to separate them e.g.

CamelCase (also known as Upper CamelCase) is where each new word begins with a capital letter e.g.

Mixed case (also known as Lower CamelCase) is the same as CamelCase except the first letter of the name is in lowercase e.g.


Standard Java Naming Conventions:

Basically, follow the naming guidelines below when you write your programs, you will find your programming process more systematic, efficient and professional than if you don’t.

Packages: Names should be in lowercase. With small projects that only have a few packages it’s okay to just give them simple (but meaningful!) names:

Continue reading