This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: PATCH for java.nio FileChannel and MappedByteBuffer
- From: "Boehm, Hans" <hans dot boehm at hp dot com>
- To: "'Andrew Haley'" <aph at redhat dot com>,"Boehm, Hans" <hans dot boehm at hp dot com>
- Cc: Ranjit Mathew <rmathew at hotmail dot com>, java at gcc dot gnu dot org
- Date: Fri, 27 Feb 2004 10:53:20 -0800
- Subject: RE: PATCH for java.nio FileChannel and MappedByteBuffer
> -----Original Message-----
> From: Andrew Haley
>
> > I don't use emacs, so I don't know. But I'm also not a great
> > believer in fully automatic indentation:
> >
> > do_something;
> > /* informal assertion */
> > do_something_else;
> > and_something_else;
> >
> > looks to a formatter just like
> >
> > do_something;
> > /* Informal description of big task */
> > step1_of_big_task;
> > step2_of_big_task;
>
> I don't see your point here: the former is right, the latter is wrong.
> If you really want the block to be indented, put in some braces.
>
It seems to me that if indentation is meant to show the structure of
the program, and step1_of_big_task; step2_of_big_task; is a refinement
of the comment, then it should be indented under the comment. Otherwise
you also introduce an ambiguity about the amount of code the comment
applies to. I certainly use this kind of indentation all the time,
mostly in non-GNU-formatted code. I wasn't able to find
a statement about it one way or the other in the GNU
coding standards.
I agree that brackets work around the problem, if the reader understands
that the brackets identify the range of the comment. But the same
"use brackets" argument could be made for not indenting the body of an if.
I'd certainly be in favor of indentation standards that are not deterministic
enough to preclude actually conveying some real information with the indentation.
Hans