It might be one of the most basic things, but I think it is worth a mention in a Debugging 101 thread:
Use comments as much as possible to explain what you are doing with the code and why. Your code might look crystal clear to you now, but if you go back to that same piece of code 5 months later, you might not see immediately why you wrote the code the way you did. It can also help if you need to do a search within your code for a specific section.
I can't tell you how many times I've gone back to a file months after the fact and if it hadn't been for my comments it would have taken me an hour or two just to figure our why I wrote the page that way.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)