This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
Saloon Keeper
Posts: 5478
55
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: 5478
55
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: 20348
111
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: 5478
55
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
 
Tim Holloway
Bartender
Posts: 20348
111
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!