At some point every developer Has experienced it returning to code composed months or days before, you end up not able to remember why you wrote the code how you did and what it was for. Nothing could be more frustrating or more time consuming than having to step back through code and figure out what was happening. There is, however, a means to decrease the probability of this occurring again. Adding comments to your source code can appear to be a waste of time today, but if you must return to a chunk of code weeks later on, you will be very glad you took the time to add a few explanatory remarks.
If you have decided to start investing time putting comments in your code, permit me to give you a few pointers which will enable your opinions to have the best impact. The first thing do is put in the place of somebody who has never seen this specific code before. Try to imagine this individual, trying to determine what the code prior to me is supposed to perform. Start out at the start of the code with an explanation of what the general code is attempting to accomplish. This will give the reader some idea about what the code is supposed to do.
Then provide a brief description of what each factor’s role is from the code. The person reading the code could finally determine what each factor is doing, but it is simpler if you just spell it out to them.
Last, add the date. This is a very important step. It is extremely possible that sooner or later you should make alterations or corrections to your code. By including dates, others and you can see that portions of control flow obfuscation are the latest and that are the earliest. This can be particularly valuable when debugging programs. Add a date, never erasing previous dates, every time start working in a bit of code. also include a brief description of what was changed and why. This makes for an excellent reference log for later.
Finally the job of a web developer is one of communication. Whether you are communicating with your staff, with direction or you are communicating with a machine coding. You are going to learn about getting more expressive with everything you write concerning software however you will also learn to get a higher degree of communication and communicate ideas to people around you. This is an excellent skill and will be helpful in different parts of your life.