utility to reformat bad indentation

I see there are older threads that address this, but I want an up-to-date answer.

Are there any utilities or editors that will reliably reformat code with bad indentation?

I used at least one in the past that did more harm than good!


Personally I find that the act of focusing on the code so that I can properly reformat it manually is a useful part of the exercise.


Two years ago I tried a few options (probably because I stumbled over some very badly formatted programs, usually I don't encounter anything remotely as bad). I tried Piew, Notepad++ with 3GP plugin and Progress Developer Studio.
In my experience PDS was best, then 3GP and then Piew (closest to our coding conventions), but none was actually very good, they would all make correctly formatted code worse. I would only use these on code where the formatting is hopeless anyway as a first step. They might have gotten better in the meantime, though.
The developer of Piew is quite approachable, I reached out to him about some bugs and he fixed them.


ProgressTalk.com Moderator
Staff member
As a starting point for a program that is in a horrendous state, the indentation correction in PDSOE isn't actually that bad. Ok, so it probably doesn't match your coding practises, but it's a starting point to make sense of the blocks. Which is what I often find the hardest part. Then you need to use some brain-power to make it all right again.


Piew was based on the same functionality as famous beauty.p:

it has some small improvements on the top. Also there are some manual beautifiers based on user selection: ALIGN DEFINE VARIABLE and ALIGN ASSIGN functionality - can reformat definition, assign sections to the same "columns". On not complex sources works very well.