Coding Standards. was: a style question

Peter da Silva peter at ficc.ferranti.com
Wed Nov 21 02:06:06 AEST 1990


(crossposted to comp.lang.misc... this is a general coding problem and
 not C-specific)

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
};

The only real solution to this is to include formatter commands in comments
or something of that nature, so the code ends up as:

ARGDESC	Args[] =
{
/*.TS	L	L		L		L		L */
	'T',	ARGOPT,		argChar,	__ &TabChar,	"Tab",
...
	'f',	ARGOPT|ARGLIST,	listStr,	__ &Files,	"File",
/*.TE */
	ENDOFARGS
};

Which is probably a good idea, especially if you make the format command
syntax loose enough:

/*.TS	option	flags		function	variable	keyword */

But I don't know any fprmatter that supports this...
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.   'U`
peter at ferranti.com 



More information about the Comp.lang.c mailing list