Writing just code is not enough, writing good code should be our aim. In this writing good code means an easy to maintain and readable code.
Use lots of comments in your code. Single line comment can be added as follows:
// this is a single line comments example
Multi-line comment block can be added as follows:
/* This is an example of multi-line comment block
it spans multiple line
the comment block ends here */
Use meaningful names for your variables and functions.