Why is it important to comment your scripts?
When you are coding, you are writing commands to a server/computer and need to use a highly formal language that may not clearly reflect your thoughts when making the script.Therefore, it can be difficult for others (or yourself) to understand how the script is structured, and thus hard to identify and correct errors in the script.
Comments can be used to write short explanatory text in the script. The server completely ignores the comments, and the comments do not affect the actual functionality of the script.
In the business world, it is often a requirement that scripts and programming are commented, otherwise it would be too risky for a company to take over a system in which it would be too difficult to find and correct errors.
How do you insert comments?
It is quite easy to insert a comment. You simply start the comment with a double slash: "//".Take a look at this example from lesson 5, now with comments:
For the sake of the example, we have included many extra comments, so it should be clear that you are far better off debugging a script with comments than without.
Therefore, remember to comment your scripts!
This post is invaluable. How can I find out more?
ReplyDeleteI have read so many articles concerning the blogger lovers except
ReplyDeletethis post is actually a nice piece of writing, keep it up.