| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Re: Bob`s question |
From: rbs{at}snippets.org
To: c_echo{at}yahoogroups.com
On Sun, 27 Jul 2003, Jari J. Laaksonen wrote:
> > A wonderful companion which is also available is "C Clearly", an
> > excellent code reformatter and pretty printer. Originally published by
> > V Communications for $130, it's now available exclusively from Mix
> > Software for only $30. As with some other excellent C tools (e.g.
> > Software Blacksmiths' C-Doc, Gimpel's PC-Lint), it's a bit long in the
> > tooth and its DOS command line ancestry shows through clearly.
> > However, all are still pretty much indispensable, being unique at
> > their price points.
>
> Talking about code formatter: how about Artistic Style:
> http://astyle.sourceforge.net/
I checked the web site and it looks as if this only handles indentation
and space/tab usage. Is this correct?
> It's free, sources are available, and therefore you can even add your
> own (or your company's) style configuration in it if the built-in are
> not enough.
C-Clearly is a complete reformatter with options for where to put braces,
whether you use spaces around parentheses (which can be set differently
for different types of parenthetical statements, e.g. function calls,
conditional statements, etc.), column alignments for trailing comments,
and a whole host of other things. Best yet, it uses template configuration
files which look like what the formatted source will look like. Edit a
template and you've created a new style to enforce. It has a few rough
edges, but for $30 it's hard to beat when you just inherited a few MB of
jumbled spaghetti from some long-gone predecessor.
For example, for this client, after discussion with the other programmers
there, I set up a template to implemented what Straker refers to a the
"Allman style" of bracketing and structure, the "comb
style" of switch
statements, to use 4 character indentation tab stops, trailing comment tab
stops at 40, 60, and 80, no spaces with parentheticals except in the case
of conditionals which use 1 leading space before the opening parenthesis.
I also instructed it to expunge blank line between opening or closing
braces and immediately adjacent block comments, and other stuff which
doesn't come immediately to mind. After setting it up, it reformatted a
115k source file with multiple nested state machines and no discernible
structure into an easily readable file in about 5 seconds.
That's easily worth $30 to me - YMMV... ;-)
-------------------------------------------------------------
Consulting: http://www.MicroFirm.biz/
Web graphics development: http://Image-Magicians.com/
Software archives: http://snippets.org/snippets/
Audio and loudspeaker design:
http://LDSG.snippets.org/
http://www.diyspeakers.net/
--- SoupGate-Win32 v1.05
* Origin: rbs{at}snippets.org (2:292/516.666)SEEN-BY: 633/267 270 @PATH: 292/516 854 140/1 106/2000 633/267 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.