How to write a clean code – 6 Tips

This is a tiny post which talks about writing a clean code for a fresher who is trying hard to get success in the IT Industry.

1) Use the meaningful variable names

example
$elapsed_time_in_days;
$days_since_deletion;

2) Adding comments is one of the good habits. write comments for every code modifications.

3) Code scouting – When picking up the new code from the Internet, Take some time to read it and try to add methods or split the required functionalities.

4) Functions and sub-functions. Make sure functions are doing its job that its meant to do.

5) Testing – Unit testing is very important, testing the functionality and isolation intensively.

6) Final tips are Practice, Practice, Practice.

Goog Luck!