Code clean up

Can anybody suggest a shareware C++ code beautifiers (indents and what not) for the PC?

Thanks!

dave
esdaveAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jan LouwerensSoftware EngineerCommented:
I don't know what you use now, but I know MS VC++ has code formatting. (At least v5.0.. haven't used 6.0 yet)
0
dspectorCommented:
It is true that Visual C++ has formatting (automatic indentation): you select the lines and issue the (poorly-named) command 'SelectionFormat'. It handles most, but not all, situations correctly, but is poorly parameterized (you can set the number of characters to indent and whether braces are at the same level as or indented from the previous statement).

However, this question is probably written by someone who doesn't have MSVC and doesn't want to spend $100 (more or less) to get it just to use it as a formatter.

I've previously looked and not found such shareware, which surprised me. I started to write my own, but it is one of many projects that I haven't had time to complete.
0
Jan LouwerensSoftware EngineerCommented:
and I also know Rational Rose had a code formatter for many languages, but once again, it's certainly not shareware, and probably more expensive then MSVC++
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Anju111599Commented:
You'll find it here:

ftp://ftp.gnu.org/gnu/indent/

Anju
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
esdaveAuthor Commented:
Anju,

When I said PC I guess I should have said Windows based. I tried the ftp link you suggested and I'm thinking that this is for Unix/Linux and not Windows based. Am I correct?

Thanks!

Dave P
0
esdaveAuthor Commented:
Anju,

When I said PC I guess I should have said Windows based. I tried the ftp link you suggested and I'm thinking that this is for Unix/Linux and not Windows based. Am I correct?

Thanks!

Dave P
0
Anju111599Commented:
Dave,

It's a cross-platform application.  It works on UNIX *and* PCs.  It's a console application, so it isn't windows native, but I have compiled and run it in a Windows DOS box.  In fact, the source code is included and I've hacked the source to produce indentation which conforms to my own perverse coding style ;)

If you want a truly Windows native application, check out CodeWright from Premia: www.premia.com
It's the hands-down best Windows programmers editor and development environment available.  Among many other things, it does re-indentation and the indent style is configurable to your taste.  If you check around on their web site, I believe you'll find a very early version of the gnu indent which evolved over the years into what they're using in CodeWright.

Anju
0
jasonclarkeCommented:
emacs/xemacs has a good and easily configurable code formatting utility.  It may be a bit of a big download if this is all you want it for, however.

you can download xemacs (including the Win32 xemacs binary kit) from www.xenacs.org.
0
jasonclarkeCommented:
sorry, the link should have been www.xemacs.org
0
proskigCommented:
Hi,
check a link
http://www.codeproject.com/macro/MakeCodeNicer.asp
This is a macro for Visual C++.

Regards,
Igor
0
esdaveAuthor Commented:
Igor,

That look interesting. Can you tell me how to "plug-in" a macro? I downloaded the .dsm file. Do I just put it in the right location and magically I have a macro?

Thanks!

Dave P
0
proskigCommented:
Hi,
You are right. You put dsm file in a right place (c:\Program Files\Microsoft Visual Studio\Common\MSDev98\Macros\ on my machine). Then go to Tools->Customize->Add Ins and Macros, select this file as active. Close and reopen this dialog go to tab Keyboard, choose macro and assign Alt+F8 to a new macro called MakeCodeNicer.

Regards,
Igor
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.