Coding Standards. was: a style question

Rich Salz rsalz at bbn.com
Thu Dec 6 09:38:23 AEST 1990


In <L237B.5 at xds13.ferranti.com> peter at ficc.ferranti.com (Peter da Silva) writes:
>My objection to beautifiers is what they do to stuff like this:
	ARGDESC	Args[] =
	{
		'T',	ARGOPT,		argChar,	__ &TabChar,	"Tab",
		'a',	ARGOPT,		argBool,	__ &AllFlag,	"All",
		'1',	ARGOPT,		argBool,	__ &OneFlag,	"First",
		' ',	ARGREQ,		argStr,		__ &Format,	"Format",
		' ',	ARGREQ|ARGLIST,	listStr,	__ &CmdNames,	"Command",
		'f',	ARGOPT|ARGLIST,	listStr,	__ &Files,	"File",
		ENDOFARGS
	};
If you put the curly braces in then there would be no problem:
	{ 'T',    ARGOPT,         argChar,        __ &TabChar,    "Tab", }
Anyone who maintains the code after you will thank you for it.

The other problem is to not use the C pre-processor to change the syntax of
the language, as __ and ENDOFARGS apparently do.
	/r$
-- 
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.



More information about the Comp.lang.c mailing list