A tip on commenting your code (and doing other unpleasant work)

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

Published in: on 23/06/2011 at 01:53  Leave a Comment  

The URI to TrackBack this entry is: https://burubaxair.wordpress.com/2011/06/23/a-tip-on-commenting-your-code-and-doing-other-unpleasant-work/trackback/

RSS feed for comments on this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: