473,473 Members | 2,126 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Good C# Code Beautifier?

We've got a lot of code we're about to migrate from .Net 1.1 to .Net 3.5.

This code has, shall we say, a somewhat organic coding style. I would like
to run all the code thorugh a C# Beautifier that complies with the Microsoft
standards for formatting and such. I'm not looking to change variable names,
but I want a consistant style throughout in terms of indenting, spacing, and
the like.

So far, I've played with several beautifiers, none of which did a very good
job on our codebase:
- GreatCode didn't really do well at all with our C# codebase

- UnCrustify did an alright job, but seems to be very bug prone. It misses
many common cases and seems to hit others. I spent an hour getting the
options just right, only to have the options not work 1/2 the time.

- SourceFormatX did an ok job, but again, missed alot of common cases that
the options were defined to hit.

- Resharper's built-in Formatter does a great job, but seems to crash alot
with an OutOfMemoryException on our bigger files. (Did I mention the source
code is, um, organic. As in, "Grown and Grown, often in unpredictable
directions").

- Visual Studio does a lousy job.

Any suggestions for a really good C# source code formatter?

--
Chris Mullins
Oct 23 '07 #1
1 6027
Chris,

It might be a bit of a stretch, but I would say write your own. You
could use the classes in the System.CodeDom namespace to parse your code
into a CodeDom structure, and then output it in the way that you want.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Chris Mullins [MVP - C#]" <cm******@yahoo.comwrote in message
news:uU**************@TK2MSFTNGP05.phx.gbl...
We've got a lot of code we're about to migrate from .Net 1.1 to .Net 3.5.

This code has, shall we say, a somewhat organic coding style. I would like
to run all the code thorugh a C# Beautifier that complies with the
Microsoft standards for formatting and such. I'm not looking to change
variable names, but I want a consistant style throughout in terms of
indenting, spacing, and the like.

So far, I've played with several beautifiers, none of which did a very
good job on our codebase:
- GreatCode didn't really do well at all with our C# codebase

- UnCrustify did an alright job, but seems to be very bug prone. It misses
many common cases and seems to hit others. I spent an hour getting the
options just right, only to have the options not work 1/2 the time.

- SourceFormatX did an ok job, but again, missed alot of common cases that
the options were defined to hit.

- Resharper's built-in Formatter does a great job, but seems to crash alot
with an OutOfMemoryException on our bigger files. (Did I mention the
source code is, um, organic. As in, "Grown and Grown, often in
unpredictable directions").

- Visual Studio does a lousy job.

Any suggestions for a really good C# source code formatter?

--
Chris Mullins

Oct 23 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Freund | last post by:
I've been looking for a good and free code beautifier that runs on linux. About the only ones I found where Trita (www.trita.com), which costs money and only runs on windows. The other one was...
19
by: Diego Andres Alvarez Marin | last post by:
Hi all! Is there a linux tool that uses as input my ugly C/C++ code and outputs a pretty and nice formated source code? Regards, Diego
1
by: Sparhawk | last post by:
Hi, I want to integrate a code beautifier for C++ in the development process of my company. There are many beautifiers around which would meet our formatting requirements (SourceFormatX,...
0
by: guido.thelen | last post by:
Hello, maybe you are interested in this. I wrote a java applet on www.sqlinform.com which is a SQL Code beautifier. It is for all kind of SQL (SQL Server, DB2, ORACLE, Access, Informix, MySQL,...
8
by: Surendra Singhi | last post by:
Hello, Are there any good open source C/C++ source code formatter? Thanks for your help. -- Surendra Singhi http://www.public.asu.edu/~sksinghi/index.html ,---- | "O thou my friend! The...
18
by: Franz Steinhaeusler | last post by:
Hello, I did not find any reasonable pyhton source code beautifier program (preferable gui). Some would ask why? Program it immediatly good. (BTW: Would be a nice project, if I would have more...
2
by: Ole Mercano | last post by:
When I insert a new Eventhandler or function VS 2005 does this automatically with an indent which I don't like. Furthermore I would change the curly bracket handling. Is there soemthing like a...
1
by: Chris Mullins [MVP - C#] | last post by:
We've got a lot of code we're about to migrate from .Net 1.1 to .Net 3.5. This code has, shall we say, a somewhat organic coding style. I would like to run all the code thorugh a C# Beautifier...
2
by: sevak316 | last post by:
Searched the forum and didn't find any topics on this. Does anyone know where I can find a user friendly C beautifier. We are using Indent right now, but it doesnt have a friendly interface. If...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.