PHP Advices #1: Comments

Ever got a project which was already started but you had to finish it? If so, you must know how much anger can a non commented code bring to a developer.
This article is meant to advice developers into creating and updating comments for each line of code they write. For example here is my work [...]

Ever got a project which was already started but you had to finish it? If so, you must know how much anger can a non commented code bring to a developer.
This article is meant to advice developers into creating and updating comments for each line of code they write. For example here is my work flow:

  1. Before i start writing any line of code, i update(insert) the bellow comments at the beginning of the file.
  2. I make a @todo list.
  3. I start checking items after i finished them.
  4. I come back to each TODO and then add comments explaining what each does

Also, whenever i add a new line of code to the file – updating – i add the following:


One more important thing. Until the application goes LIVE, i never delete any lines of code. If i need to change a line of code then i just comment it and leave it as it is ( but always with // ). This is good for future references since you can see whatever differences are between the LIVE code and the DEV code without trying to figure out.

  • azhararmar
    Thank you for that Suggestion,.. will have to add that in my project.. :)
blog comments powered by Disqus


Popular tags

Partner Blogs

Latest tweets


Get Adobe Flash playerPlugin by wpburn.com wordpress themes
Web Analytics