Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Feb 1997 08:16:58 -0700 (MST)
From:      Wes Peters <softweyr@xmission.com>
To:        Nate Williams <nate@mt.sri.com>
Cc:        chat@freebsd.org
Subject:   Re: cvs commit: CVSROOT avail
Message-ID:  <199702051516.IAA08885@obie.softweyr.ml.org>
In-Reply-To: <199702041933.MAA28784@rocky.mt.sri.com>
References:  <199702041559.IAA27474@rocky.mt.sri.com> <199702041941.TAA11400@veda.is> <199702041933.MAA28784@rocky.mt.sri.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Nate Williams writes:
 > [ moved to chat, as we're now discussing religion ]

As apprpriate! ;^)

Nate was arguing with somebody about:

	for(...)
	    ;

vs.

	for(...)
	    continue;

 % I beg to disagree. The previous example is far clearer, since the empty
 % statement stands out as empty rather than being a coincidental noop.

 > The empty statement stands out like a mistake IMHO.

Neither is particularly elegant.  I suggest:

	for (...)
	{
	}

This has the advantage of looking like an explicitly empty code block,
which it is.  It also has the advantage of letting you insert and
delete, by editor or #if, as many debugging lines as you need inside the
trailing code block.

 % Use
 % of 'continue' in this context suggests that a line was deleted or has yet
 % to be inserted.

 > I say the exact opposite.  The continue line implies to me that it's
 > intentional, vs. the other way.

Obviously, the use of continue vs. empty statement does not clarify the
issue, so let's explicitly clarify it.

 % Of course, style also favours inserting a space before the parenthesis.

 > True, but in this manner everyone I've spoken with tends to prefer the
 > former over the latter (continue vs. empty semi-colon).

Yes, please.  Always: keyword ( and functionname(, no deviations
allowed!  ;^)

-- 
          "Where am I, and what am I doing in this handbasket?"

Wes Peters                                                       Softweyr LLC
http://www.xmission.com/~softweyr                       softweyr@xmission.com






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702051516.IAA08885>