Properly Comment your code

Read this tip to make your life smarter, better, faster and wiser. LifeTips is the place to go when you need to know about Web Application Development Tips and other Web Development topics.

Do I need to comment code?

Properly Comment your code

My motto: "Code as if the person taking over my position is an insane killer" -- Meaning, if they can't understand what I did, they might come looking for me. ALSO, if you have to revisit a piece of code you wrote long ago, it helps to know what you did, and why. When you create a new function, add a comment block at the top. When you start a new webpage, add a comment block at the top. When you change a line of code somewhere in the page, either add a revision line at the top, referencing the changed code, or use an inline comment where you actually changed the code. For a good example of commenting code, see www.meridiandevelopmentsystems.com/lifetips/03.htm

   

Comments

Nobody has commented on this tip yet. Be the first.



Name:


URL: (optional)


Comment:


Not finding the advice and tips you need on this Web Development Tip Site? Request a Tip Now!


Guru Spotlight
Candi Wingate