Code Comments

I am a firm believer in code comments among other things.   So when I came across a blog post at talking about amusing comments coders leave in their code for people to find later I followed the links and found this:


// Dear maintainer:
// Once you are done trying to 'optimize' this routine,
// and have realized what a terrible mistake that was,
// please increment the following counter as a warning
// to the next guy:
// total_hours_wasted_here = 42

The code comment above does however highlight an issue for consideration when writing code. Who will support and maintain your code? Write comments to help them as they have to live with your creation.

When coaching youngsters I would always challenge them to write code that people less able than themselves could read and follow.  By doing this it allows you to easily handover your code to a support group and you can move on and write new applications.

Code Comments

Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s