Page MenuHomeFreeBSD

style.9: Additional minor clarification and phrasing
ClosedPublic

Authored by cem on Sep 20 2016, 6:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 5:57 PM
Unknown Object (File)
Tue, Oct 29, 11:14 AM
Unknown Object (File)
Oct 21 2024, 6:31 AM
Unknown Object (File)
Oct 20 2024, 5:30 PM
Unknown Object (File)
Oct 14 2024, 5:04 AM
Unknown Object (File)
Oct 5 2024, 10:05 PM
Unknown Object (File)
Oct 2 2024, 9:50 PM
Unknown Object (File)
Oct 1 2024, 8:34 PM
Subscribers

Details

Summary

Bump .Dd as well.

Submitted by: bde (earlier version)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem retitled this revision from to style.9: Additional minor clarification and phrasing.
cem updated this object.
cem edited the test plan for this revision. (Show Details)
cem added reviewers: emaste, wblock.
cem updated this object.
cem removed a subscriber: imp.
imp added a reviewer: imp.
imp added inline comments.
share/man/man9/style.9
119 ↗(On Diff #20549)

This is a stray comma. i.e. is latin for 'That is' and you wouldn't put a comma after that phrase.

128 ↗(On Diff #20549)

This changes the meaning from 'include these first' to 'only include these first when you have to' which is not desirable and is more than a 'clarification'.

132–136 ↗(On Diff #20549)

I think this note should be removed entirely because the vast majority of files will have

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$")

at the top. This wasn't the case when this advise was written.

This revision is now accepted and ready to land.Sep 20 2016, 7:52 PM
share/man/man9/style.9
119 ↗(On Diff #20549)

(This change comes from bde@.)

I'm familiar with "id est." Actually, I would put a comma after that phrase in English as well. (That's why igor(1) suggests commas after i.e. and e.g.)

128 ↗(On Diff #20549)

This comes from bde@. I'm happy to change it.

I don't like the "Include foo or bar but not both and include it first" sentence as-is. I didn't want to drag you into grammar bikeshedding, since you had previously expressed disinterest in that.

132–136 ↗(On Diff #20549)

Fair enough.

share/man/man9/style.9
119 ↗(On Diff #20549)

I would also put a comma after that phrase; some random sites suggest the comma is typical in American English and not in British English.

The Chicago Manual of Style and AP Stylebook both ask for the comma.

cem edited edge metadata.
cem marked 2 inline comments as done.
  • Clarify section on kernel includes. Explicitly order cdefs.h, types/params, then alpha-sorted other headers.
  • Remove stale reference to types/param.h including cdefs.h.
This revision now requires review to proceed.Sep 20 2016, 11:56 PM
share/man/man9/style.9
119 ↗(On Diff #20549)

Checked with my wife who is a professional editor and you are correct. Always put a , after i.e.

share/man/man9/style.9
122–126 ↗(On Diff #20557)

I'm not sure this clarifies things. It seems to imply you might have

#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/foo.h>

while it's actually an optional

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
153 ↗(On Diff #20557)

Maybe Do not include files from /usr/include in files in the kernel.?

share/man/man9/style.9
122–126 ↗(On Diff #20557)

I'm not sure what you mean.

Last time I added a file, I was told __FBSDID() was non-optional. So in that case, cdefs.h is needed and comes first, with __FBSDID() .

153 ↗(On Diff #20557)

Sure.

emaste added inline comments.
share/man/man9/style.9
153 ↗(On Diff #20557)

@vangyzen's Do not include files from /usr/include in the kernel. is clearer and more concise.

share/man/man9/style.9
119 ↗(On Diff #20557)

In normal English, the need for the comma is clearer. Which helps to illustrate my normal suggestion, just use English. We are not worried about saving space and Latin is not the dominant language of computers. The concern here should be for clarity first.

124 ↗(On Diff #20557)

As above, please consider s/i.e./that is/ s/e.g./for example/.

127 ↗(On Diff #20557)

"one of" can be replaced with "either".

131 ↗(On Diff #20557)

This can be imperative rather than a suggestion (without markup):

If either sys/types.h or sys/param.h is needed, include it before other include files.

134 ↗(On Diff #20557)

Semicolons should be avoided in most documentation. Here, mixed with code, it is really bad, but easy to replace with a real sentence break:

.Po
.In sys/param.h
includes
.In sys/types.h .
Do not include both.
.Pc
153 ↗(On Diff #20557)

Agreed.

cem marked 8 inline comments as done.
cem edited edge metadata.
  • Replace two latin abbreviations with appropriate English substitutes
  • one of -> either
  • imperative types/param firstness
  • Adopt vangyzen's userspace header sentence

A couple of minor niggles

share/man/man9/style.9
119 ↗(On Diff #20652)

Actually do we even need "that is" here? It seems clear enough w/o it.

124 ↗(On Diff #20652)

It's only included first if it is needed for __FBSDID and other VCS tags, so this can be more clearly stated as

if sys/cdefs.h is needed for __FBSDID, include it first.

Otherwise, it had been included alphabetically. The only reason to include it these days, apart from some rare corner cases, is for FBSDID. WE should go for clarity over enumerating every possible edge case.

share/man/man9/style.9
119 ↗(On Diff #20652)

Agreed, simpler is better.

cem marked 3 inline comments as done.
cem edited edge metadata.
  • Remove unnecessary "that is"
  • Simplify cdefs sentence

(Oops, keep forgetting to submit this reply.)

share/man/man9/style.9
134 ↗(On Diff #20557)

Is it good style to put two sentences in a parenthesis?

The two clauses are extremely short and I think this is actually a clear use of a semicolon. The sentence as-is expresses one idea and justifies it.

(In code, it is nonsensical to use semicolons with C preprocessor directives like #include, so it is clearly a use of the English language semicolon.)

emaste edited edge metadata.

I'm fine with this iteration

This revision is now accepted and ready to land.Oct 6 2016, 1:33 AM
This revision was automatically updated to reflect the committed changes.