Comments should discuss the current functionality.

Don’t let your comments ramble on about the past or future.

Don’t have comments describing what a function used to do. That information is in the version control. Instead, the comments should only discuss why the current functionality is the way it is.

Similarly, don’t speculate on the future. You don’t know what the future business requirements will be. (cf. YAGNI)

When you update your code, update the comments as well. Don’t turn the comments into lies.

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 )

Connecting to %s

%d bloggers like this: