GENERIC-11: Employ well-defined and accepted coding standards, as they improve both code understandability and maintainability.


Description

Coding standards are guidelines that all developers follow in a project follow to improve collaboration. When non-logical variable or function names are used, it becomes harder for others to understand the code. Which results in time loss. There also exists coding standard files which can be linked to your AndroidStudio project. This is often used because whenever a line of code does not match the coding standard this is automatically shown. An example coding standard file can be found here. Which follows the official Android coding standards: https://source.android.com/setup/contribute/code-style

Example

We created a simple application which retrieves employees from this url: http://dummy.restapiexample.com/api/v1/

Always handle your exceptions. You might think that an exception would not occur. But it’s hard to trace back, if you do not handle them. Do not catch generic exceptions. If someone adds another exception to the method which throws the exception, you might spend more time retrieving the exception, since you did not know what caused it.

Fields on top of your file

For more coding standards read this link: