Posts

Showing posts from December, 2012

Code Conventions for the Java Programming in Android

Image
Readability Purpose of this lesson : Human readability is extremely important. Especially important factors: Naming, indentation, conventions. Humans must be able to read the programs Source code is read by both the compiler, which doesn't care about your writing style, and people, who care enormously about your writing style. ALL programmers insist that certain rules be followed. Some of the most important are: Indentation.   Statements which are contained within something else (a class, a method, a loop, etc) must be indented on indentation amount to the right. There are several styles for this; use one of them. Meaningful names.   Variables, methods, classes, etc must be given names that mean something to the reader. Use names like a ,   b , and   c   only when there is no inherent meaning in a variable -- it's just an abstract number.   See   Names   for a more detailed discussion. Conventions   are