[Swan] visual distinctions in C: function calls vs. control flow

D. Hugh Redelmeier hugh at mimosa.com
Sat Mar 2 21:40:59 EET 2013


Function calls and control flow statements can look similar in C:
name followed by open paren:

	if(test) ...
	fi(arg) ...

I think that it makes sense to make these visually distinct:

- never put a space between a function name and the following paren.
  (This matches most mathematical usage.  I admit that in math there
  are other important notational differences.)

- always put a space between a keyword and a following paren.

So:
	if (test) ...
	fi(arg) ...

Although sizeof is a keyword, it looks best if formatted as a function
-- it behaves more like a function than a control-flow command.

This style was observed in Pluto code until I stopped working on it.
I recommend that it be adopted.

I welcome debate.


More information about the Swan mailing list