Showing posts from December, 2012

Code Conventions for the Java Programming in Android

ReadabilityPurpose of this lesson: Human readability is extremely important.Especially important factors: Naming, indentation, conventions.Humans must be able to read the programsSource 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 likea,b, andconly when there is no inherent meaning in a variable -- it's just an abstract number.
SeeNamesfor a more detailed discussion.Conventionsare important to follow. There are standard naming, forma…