`if` `(` expr `)` stmt vs `if` expr `then` stmt .....

Steven Maurer steven at qubix.UUCP
Tue May 22 11:44:32 AEST 1984

[forth love if honk then]

	Anyone who is a serious student of programming linguistics,
    should realize that a delimiter is neccessary to separate the
    expression from the statement in all conditional language-constucts
    -- if you want to keep your grammer LALR(1) (almost a given).

	With this in mind, it becomes only a matter of style as to
    which type(s) of delimiter you prefer.    I prefer the '(' ')'
    of C, to the 'if' 'then' of Pascal, because:  [1] It is shorter
    to type, [2] Is symmetrical, and [3] Does not disguise the true
    purpose of the construct.

    No doubt Pascal-o-philes have other opinions on the matter.

    Steven Maurer

    p.s.   I discount the return (expr)  vs return expr, argument
	as being patently silly; it is simply a matter of style,
	nothing else.  No C programmer I have EVER met, believes that
	return (expr) is actually a function call.

    p.p.s. Symmetry is very important as a programming tool, since
	it allows the programmer to develop a habit of writing each
	construct in a particular manner  (sort of a construct template
	in his mind), WITHOUT having to anaylize the surrounding program
	to see if the syntax is correct.  NON-symmetry is the most
	aggrivating part of programming Pascal, as anyone who has been
	bitten by the: <if> <stmt> <NO-SEMICOLON> <else> <stmt> <semicolon>
	can tell you.    Symmetry is a very important aspect of
	programming ergonomics.

More information about the Comp.lang.c mailing list