Some random information regarding commenting your code #Root

Some random information regarding commenting your code

Is commenting required? or suggested?
Simply yes. Always comment your code.

Note: Commenting is always useful only when it is done right. 
Bad commenting is worse than not commenting.

What should you write in the comment?
--------------------------------------
Write why the section of the code is required.
write-What does the code section do.
Write it in plain english. Don't use any language syntax.
If you do not find what to write...then better check did you understand the 
requirements of the assignment/section? 
Also check, are you sure your design/logic will work? 
Also, why your design/code will work -- did you really understand. 
Do not write how the code works in comments but write why and what it does.

Why commenting is useful?
-------------------------
Commenting will make your code more readable to others.
Commenting will help others to find out the right section of code to edit/modify. 
Also, understand the purpose of the program as well as sequence of the logic.
It will also help you to review/(work on) your own code later
In many or most companies, you will hardly write codes from scratch, you have to 
work on others' code. Hence, commenting is important


Random:
--------
Use a clear commenting style - easy to edit
Comment as you go/code - do not leave commenting until the end of writing code
If you are worried that commenting will reduce performance...rather comment and 
use tools to create release codes without comments
comment above the code -- not at the right
variable declaration may have comment at the right
if you use any special trick that is not obvious from the code -- write it in 
comments [a trick:we can do a right shift for divide by 2]

Comments and Pseudocode Programming Practice (PPP)
----------------------------------------------------
Comments and Pseudocode Programming Practice (PPP) go hand in hand.
what is Pseudocode Programming Practice (PPP)?
1. Write your logic in plain english may be as a paragraph
2. Decompose it step by step into as fine grained that it can not be decomposed 
further. (The paragraph will be converted to lines of steps)
3. comment each line/step (use comment sign like //)
4. After each line/comment write the corresponding code.

From: http://sitestree.com/?p=3537
Categories:Root
Tags:
Post Data:2016-07-08 16:05:38

Shop Online: https://www.ShopForSoul.com/
(Big Data, Cloud, Security, Machine Learning): Courses: http://Training.SitesTree.com
In Bengali: http://Bangla.SaLearningSchool.com
http://SitesTree.com
8112223 Canada Inc./JustEtc: http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning)
Shop Online: https://www.ShopForSoul.com/
Medium: https://medium.com/@SayedAhmedCanada