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.
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.
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.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
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.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.