Correct way of conjugating 3rd person singular in comments

88 Views Asked by At

I know this is a strange question, but I have been really confused about this lately.

I have been looking in some repositories in github, and both approaches seem to be used in practise. So, what's the correct way in english grammar to write comments in this pattern?

// create an integer to store the sum.
int i = 1 + 1;

// creates an integer to store the sum.
int i = 1 + 1;
1

There are 1 best solutions below

0
On BEST ANSWER

Google's style guide recommends to use third person instead of imperative.

Recommended: tasks.insert: Creates a new task on the specified task list.
Not recommended: tasks.insert: Create a new task on the specified task list.

Your question is probably a duplicate of this one, so take a look over there. I guess, in the end, it's down to your personal preference, whether you use imperative or 3rd person. This is also reflected in the different opinions in the linked question. Just be consistent within your project/organization and everything is fine.