PATCH for java.nio FileChannel and MappedByteBuffer

Boehm, Hans hans.boehm@hp.com
Fri Feb 27 18:53:00 GMT 2004


> -----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



More information about the Java mailing list