You read it in the beginning of every programming book, and hear in the first lecture of every programming class; it has become like a programmer’s commandment:
Thou shalt comment thy code.
Yet there’s always a great temptation not to do it. I know that writing comments is important, but this is not what I particularly like. I don’t want to spend time on them, I want to continue with my code, and writing comments involves organizing my thoughts in readable English which requires an extra effort. Every time when it comes to adding comments, I have to force myself to do it.
I think I found a tip how to make this job easier.
Open the settings of your editor, and choose some very attractive colour and font for comments. Make them look beautiful in your code. Then it will be easier to write them. At least it works for me.
I think that this tip is applicable to any unpleasant job. Make it look attractive, and it will become bearable.
P.S. a good article about writing comments: 13 Tips to Comment Your Code