Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

For fun - a poor man's code beautifier  RSS feed

 
Saloon Keeper
Posts: 5140
54
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Time and time again I see Java beginners not taking the time to clean up their code before posting it so I whipped up this very rudimentary code beautifier "Indentify". My beautifier of choice is the Eclipse IDE but most beginners haven't gotten to the point of using IDEs yet.  Maybe, just maybe, this will help someone out and make our collective lives easier.

 
Greenhorn
Posts: 23
1
Chrome IBM DB2 Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tend to do something like shown below for the beginning { and ending }...
But the most important question is "Did you use spaces or tabs?"

LOL


 
Carey Brown
Saloon Keeper
Posts: 5140
54
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Michael Billiot wrote:I tend to do something like shown below for the beginning { and ending }...
But the most important question is "Did you use spaces or tabs?"
LOL


Four spaces (not tabs) per indent level. Would be trivial to substitute tabs if you wanted.

Ah, yes. K&R style. Depending on my audience, I've used both. I find the "one brace over the other" style to be helpful to beginners. It was also easier to make a beautifier for.
 
Bartender
Posts: 19972
95
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, I used Jalopy (http://jalopy.sourceforge.net), which actually blows away the built-in IDE beautifiers when it come to customization. It ran stand-alone or as a plug-in to most popular IDEs. Could even be set up to do batch processing to enforce formatting on entire projects.

Originally, and in the SourceForge version, it was free software. It seems to have been converted to commercial software now ($40/seat). And it may be orphaned entirely now, alas - last update seems to have been in 2010.
 
Carey Brown
Saloon Keeper
Posts: 5140
54
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
 
Tim Holloway
Bartender
Posts: 19972
95
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Carey Brown wrote:The Downloads section of the link you provided gives a 404 error.



He moved it to github - there's a link (jalopy2).

Although I'm not sure exactly what the project builds - most of what I saw in there was interface code, not anything that looked like parsing and formatting.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!