Don’t comment you code while writing it – comment it two weeks later

From my experience it seems like two weeks are enough to forget what you were doing. More or less. Probably it’s an individual factor, but you can try yourself.

Anyways, if you want to document your code, do it later, like these mentioned two weeks. The reason here is that you will already look at your code from slightly different perspective. It will feel like you are looking at it for the first time. I know, I know, I over exaggerate.

Now, the difference between commenting little bit later (comparing to commenting it while writing) is that you will document all these fancy small details that you have assumed in a first place. Two weeks later it will turn out that some of these assumptions where not that clear after all.