Re: #define<TAB> in share/misc/style [was: CVS commit: src/share/misc]

John Hawkinson <[email protected]>
Newsgroups gmane.os.netbsd.devel.general
Message-ID <[email protected]>
There being insufficient clarity on the subject, I've backed this out
and replaced it:

 /*
  * Macros are capitalized, parenthesized, and should avoid side-effects.
- * Use one TAB between #define and the macro name; spacing after the macro
- * name may be any whitespace, as appropriate.
+ * Spacing before and after the macro name may be any whitespace, though
+ * use of TABs should be consistent through a file.
  * If they are an inline expansion of a function, the function is defined
  * all in lowercase, the macro has the same name all in uppercase.
  * If the macro is an expression, wrap the expression in parenthesis.


Greg A. Woods <[email protected]> wrote on Mon, 24 Feb 2003
at 18:07:37 -0500 in <[email protected]>:


> I've never ever seen even the barest hint of reasonable rationale for
> using a tab instead of a space beteen the "#define" and the macro name
> which follows it.

Well, I believe the rationales are a) consistency b) a desire to
use TABs as a generalized seperator. b) doesn't hold a huge amount
of weight, but it allows consistency with other kinds of syntaxes
where spaces may not be the conceptual seperator.



In any event, a few statistics are also instructive:

Out of 33k #defines in the tree, 22k are #define<SP> and 10k are
#define<TAB>. Moreover, out of 20k files that contain #defines,
14k use spaces and 6k use tabs.

Personally, I have an irrational attachment to the use of tabs here,
and would like to see a bit more inter-BSD consistency, but I don't
think those reasons are strong enough here.

--jhawk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.