Latest indent request

Brandon S. Allbery allbery at ncoast.UUCP
Mon Dec 12 02:51:42 AEST 1988


As quoted from <810 at quintus.UUCP> by ok at quintus.uucp (Richard A. O'Keefe):
+---------------
| In article <9063 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
| >In article <1748 at solo3.cs.vu.nl> maart at cs.vu.nl (Maarten Litmaath) writes:
| >>gaspar at almsa-1.arpa (Al Gaspar) writes:
| >>\	if (test)
| >>\		{
| >>\		whatever;
| >>\		}
| >>What a DISGUSTING format!
| >
| >Most programmers I know that have tried vertical alignment of braces
| >for a while have come to prefer that to the style in K&R.
+---------------

A small comment here:  "vertical alignment" can also mean:

	if (test)
	{
		whatever;
	}

Which might be preferable to some people.

+---------------
| (book reference deleted)
| The use of braces in C is discussed on pages 111 and 117.  I use the "comb"
| style of layout (Ledgard's preference) because it makes sense in all the
| languages I use.
| 
| Ledgard is no more God than Henry Spencer, but I need a good reason to
| disagree with either of them.
+---------------

Actually, the indent format I find clearest is:

	if (test)
	  {
	    whatever;
	  }

It works in most languages I've used (including Lisp, in many cases), and
shows by indent level exactly what's going on.  The main problems I have
with it are (1) unless you use a very short indent (like 2 spaces above),
lines start wrapping or disappearing off the end of the screen rather
quickly; and (2) Jove isn't quite smart enough to handle it.  (On the other
hand, I have a patch to enable the C-indent hook in Jove; maybe I'll find the
time to get the Jove sources back onto ncoast and patch them.)

If this is what the above poster was referring to, my apologies; I don't
have much access to technical books, alas.

++Brandon
-- 
Brandon S. Allbery, comp.sources.misc moderator and one admin of ncoast PA UN*X
uunet!hal.cwru.edu!ncoast!allbery  <PREFERRED!>	    ncoast!allbery at hal.cwru.edu
allberyb at skybridge.sdi.cwru.edu	      <ALSO>		   allbery at uunet.uu.net
comp.sources.misc is moving off ncoast -- please do NOT send submissions direct
      Send comp.sources.misc submissions to comp-sources-misc@<backbone>.



More information about the Comp.unix.wizards mailing list