CODING_STYLE: Allow single-sentence comments without full stops
PATCH 1/1 CODING_STYLE: Allow single-sentence comments without full stops
One of the common ways in which contributors trip up over the CODING_STYLE guides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.
Modify CODING_STYLE to allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.
---
CC: Andrew Cooper <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>
--- CODING_STYLE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
CODING_STYLE +3 -1
@@ -93,7 +93,9 @@ Comments Only C style /* ... */ comments are to be used. C++ style // comments should not be used. Multi-word comments should begin with a capital -letter and end with a full stop. +letter. Comments containing a single sentence may end with a full +stop; comments containing several sentences must have a full stop +after each sentence. Multi-line comment blocks should start and end with comment markers on separate lines and each line should begin with a leading '*'.
Signature · 7 lines
2.1.4 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 7 lines · George Dunlap
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.
Quoted 6 lines
Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.Signed-off-by George Dunlap <[email protected]>
Quoting myself from another thread:
---
I think the issue here as that to me, these kinds of comments are not "plain written text"; they're more like signs or labels. If you search Google Images for "sign" or "clothing label", you'll find that no single-sentence signs have full stops at the end.
That's why to me it actually feels like having a full stop at the end of a comment like this is actively wrong -- it changes it from one type of speech into another type of speech. I wouldn't bike-shed over the issue by insisting a full stop be removed; but it would definitely irritate me to be told that I had to add one.
---
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 15 lines · George Dunlap
Quoted 7 lines · George Dunlap
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.Quoted 6 lines
Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.Signed-off-by George Dunlap <[email protected]>
Quoted 7 lines
Quoting myself from another thread:
---
I think the issue here as that to me, these kinds of comments are not "plain written text"; they're more like signs or labels. If you search Google Images for "sign" or "clothing label", you'll find that no single-sentence signs have full stops at the end.
Or perhaps to be more accurate -- these comments are like labels on a flow chart, designed to be high-level actions to help the reader figure out what's going on. If you Google flow chards you'll also find that none of the flow chart labels include full stops.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 30 lines · George Dunlap
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.Signed-off-by George Dunlap <[email protected]>---
CC: Andrew Cooper <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>--- CODING_STYLE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)CODING_STYLE +0
-0
CODING_STYLE Comments · line 98
Quoted 7 lines
CODING_STYLE +3
-1@@ -93,7 +93,9 @@ Comments Only C style /* ... */ comments are to be used. C++ style // comments should not be used. Multi-word comments should begin with a capital -letter and end with a full stop. +letter. Comments containing a single sentence may end with a full +stop; comments containing several sentences must have a full stop +after each sentence.
I would suggest a coding style that specifies the useful properties of a comment and not call out some irrelevant, minor grammar point.
So, I think this should be.
"Comments should be clear and understandable."
Reviewers should be advised to not nit-pick grammar or spelling issues in comments unless they harm clarity or readability.
Committers who particularly care should be prepared to fix any minor grammar or spelling issues when committing.
David
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 42 lines · David Vrabel
Quoted 30 lines · George Dunlap
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.Signed-off-by George Dunlap <[email protected]>---
CC: Andrew Cooper <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Konrad Wilk <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Tim Deegan <[email protected]>
CC: Wei Liu <[email protected]>--- CODING_STYLE | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)CODING_STYLE +0
-0CODING_STYLE Comments · line 98
Quoted 7 lines
CODING_STYLE +3
-1@@ -93,7 +93,9 @@ Comments Only C style /* ... */ comments are to be used. C++ style // comments should not be used. Multi-word comments should begin with a capital -letter and end with a full stop. +letter. Comments containing a single sentence may end with a full +stop; comments containing several sentences must have a full stop +after each sentence.I would suggest a coding style that specifies the useful properties of a comment and not call out some irrelevant, minor grammar point.
Quoted 3 lines
So, I think this should be.
"Comments should be clear and understandable."
"I'm not happy with this idea but I would not argue against it." :-)
Or not very strenuously. I think having spelling and grammar mistakes does detract from my experience as a reader, and I think it makes the code itself look bad to other people. Lots of people are quite judgemental about spelling and grammar and would have a worse opinion of the quality of our code if the language quality in our comments were poor.
Quoted 5 lines
Reviewers should be advised to not nit-pick grammar or spelling issues in comments unless they harm clarity or readability.
Committers who particularly care should be prepared to fix any minor grammar or spelling issues when committing.
For the most part I think submitters want to have proper grammar and spelling; and I think if grammar and spelling mistakes in comments are the only thing that needs changing most committers already offer to change it when they check it in.
If there are other more substantial changes, then I don't think it's too much to ask someone who's re-submitting a patch anyway to fix things up while they're at it.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
CODING_STYLE Comments · line 98
Quoted 11 lines
Quoted 1 line
Quoted 1 line · On 04.08.16 at 11:37, <[email protected]> wrote:
CODING_STYLE +3
-1@@ -93,7 +93,9 @@ Comments Only C style /* ... */ comments are to be used. C++ style // comments should not be used. Multi-word comments should begin with a capital -letter and end with a full stop. +letter. Comments containing a single sentence may end with a full +stop; comments containing several sentences must have a full stop +after each sentence.
If we no longer demand a full stop, why would we demand an upper case letter at the start?
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 5 lines · Jan Beulich
Quoted 5 lines
Quoted 1 line
Quoted 1 line · On 04.08.16 at 11:37, <[email protected]> wrote:
CODING_STYLE +0
-0@@ -93,7 +93,9 @@ Comments
Quoted 9 lines
CODING_STYLE Comments · line 98
Quoted 6 lines
CODING_STYLE +3
-1Only C style /* ... */ comments are to be used. C++ style // comments should not be used. Multi-word comments should begin with a capital -letter and end with a full stop. +letter. Comments containing a single sentence may end with a full +stop; comments containing several sentences must have a full stop +after each sentence.If we no longer demand a full stop, why would we demand an upper case letter at the start?
Because that "looks right" to me; and indeed, if you look at images of flow charts, you'll find that they all start with a capital letter.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
George Dunlap writes ("[PATCH] CODING_STYLE: Allow single-sentence comments without full stops"):
Quoted 7 lines
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.
Quoted 6 lines
Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.Signed-off-by George Dunlap <[email protected]>
Seriously ?
Yes, the bike shed can be purple with occasional mauve.
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 13 lines · Ian Jackson
George Dunlap writes ("[PATCH]
CODING_STYLE: Allow single-sentence comments without full stops"):Quoted 12 lines
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.
Quoted 7 lines
Quoted 1 line
Signed-off-by George Dunlap <[email protected]>Seriously ?
Yes, the bike shed can be purple with occasional mauve.
Acked-by Ian Jackson <[email protected]>
Thanks Ian.
The other comments so far don't seem to be objections to this relaxation, but about whether standards should be relaxed further. If I don't hear any objections by Monday I'll check this patch in and let others submit follow-on patches if they want.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Quoted 20 lines · George Dunlap
Quoted 19 lines · Ian Jackson
George Dunlap writes ("[PATCH]
CODING_STYLE: Allow single-sentence comments without full stops"):Quoted 7 lines
One of the common ways in which contributors trip up over the
CODING_STYLEguides is by not putting a full stop at the end of a comment when there is only a single sentence. Calling these out is a waste of everybody's time: The full stop at the end of a comment with a single sentence (or a single phrase) adds absolutely nothing to the legibility of the code.Quoted 6 lines
Modify
CODING_STYLEto allow comments with a single sentence or sentence fragment to either have a full stop or not, while making it clear that comments with multiple sentences must have a full stop at the end of each sentence.Signed-off-by George Dunlap <[email protected]>Seriously ?
Yes, the bike shed can be purple with occasional mauve.
Quoted 8 lines
Quoted 1 line
Acked-by Ian Jackson <[email protected]>Thanks Ian.
The other comments so far don't seem to be objections to this relaxation, but about whether standards should be relaxed further. If I don't hear any objections by Monday I'll check this patch in and let others submit follow-on patches if they want.
And pushed.
-George
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel