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.
1 [crayon-5df3b161ad663788321780 inline="true" ]while, if, mypackage
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.
1 [crayon-5df3b161ad66c527733272 inline="true" ]MAX_HOURS, FIRST_DAY_OF_WEEK
CamelCase (also known as Upper CamelCase) is where each new word begins with a capital letter e.g.
1 [crayon-5df3b161ad675049058746 inline="true" ]CamelCase, CustomerAccount, PlayingCard
Mixed case (also known as Lower CamelCase) is the same as CamelCase except the first letter of the name is in lowercase e.g.
1 [crayon-5df3b161ad67d289883193 inline="true" ]hasChildren, customerFirstName, customerLastName
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:
12 [crayon-5df3b161ad686516703419 inline="true" ] package pokeranalyzerpackage mycalculator