View Single Post
  #5 (permalink)  
Old 06-19-2009, 11:01 PM
Mark Rafn
Guest
 
Posts: n/a
Default Re: Condensed close curly braces at end of Java code blocks in Eclipse

Ion Freeman <ionfreeman@gmail.com> wrote:
>Hi!
> Frankly, most of the code I write is for publication somewhere, so
>I try to keep everything within eighty columns and use vertical space
>efficiently.


I'm down with that. I woudn't want to give up easy editing by myself or
others in pursuit of such, though.

>body or class, I'd like to compress them all. So
>class outer{
> class inner{
> method body(){
> for(){
> if(){
> finally{
> // would have the final line
>} } } } } }
>-- visually every block of code is closed, but it's strictly in the
>opposite order, so that all the closures happen on one line.


Eww. I'd object if I ever had to edit the code, but I guess for some
publications it'd be ok.

>I'm having some trouble getting Eclipse to do this


Yeah, it's probably a fairly uncommon formatting preference.

My recommendation: use java standards in your editor, including a bit more
indenting and spending the vertical space to give ending braces their own
line, and then format for publication as needed, based on the needs for that
specific use. Print snippets could compress the way you show, online could
stay more standard.

--
Mark Rafn dagon@dagon.net <http://www.dagon.net/>
Reply With Quote