[comp.lang.pascal] source code formatters

CDCKAB%EMUVM1.BITNET@cunyvm.cuny.edu ( Karl Brendel) (09/12/90)

<mounting soapbox>

In a series of articles, Gisa Stein <Jochen Bruening 049 7531/882410>
(whatever that is--a phone number, perhaps) has asked for a lead on a
source code formatter and been greeted with replies of "why not format
your code nicely in the first place?" (One or two helpful replies were
also made.)

The "why not" replies represent a complete waste of transmission expense
and readers' time. If you have no value to add to the discussion, please
do not participate. Instead, write your reply, dump it to the printer,
delete it without mailing, and post the printout above your terminal
where you may admire your own intelligence. Spare the rest of us.

<dismounting soapbox>

In addition to the quite reasonable point that Gisa Stern has made (that
one sometimes wishes to format code produced elsewhere), let me propose
these reasons for having a source code formatter:

  1) Within a shop and even within one's individual practice, formatting
standards may change over time.

  2) One may change employers or clients and formatting standards along
with them.

  3) One may change from using a system (terminal, editor, etc.) which
supports various features (mixed case, left brackets, variable tabbing)
to one which doesn't.

  4) Code which is formatted to display well on an 80 column screen may
not display well on a wider screen.

  5) Code which is formatted to display well on a screen may not print
well.

  6) During different phases of development, different formatting styles
may be appropriate. (E.g., using a format which features scope-sensitive
capitalization of user-defined identifiers may help locate scope
problems.)

  7) Etc.

If there were no useful purpose for source code formatters, I doubt that
so many texts would feature them as projects for study.

In the event that these sources have not been mentioned already, here
are some references to source code formatters, which may or may not be
specific to Turbo Pascal:

From the SIMIBM listings, supposedly available via Trickle:
"PD1:","<MSDOS.TURBOPAS>","PP50.ARC"
  "Pascal pretty printer/reformatter, w/TP5.0 src"
"PD1:","<MSDOS.TURBOPAS>","ZINDENT7.ARC"
  "Pascal pgm to format dBASE/Pascal"

TurboPower Software (phone 408/438-8608; PO Box 66747, Scotts Valley, CA
95066 USA; CompuServe ID 72457,2131) includes a source code formatter as
part of their Turbo Analyst package. This is a commercial "pay-up-front"
package which is well worth the money (under $100 by mail order in the
US, including full source code; possibly higher directly from
TurboPower). The major utility in the package is a "lint"-type program
which reports on almost all conceivable types of errors within a
program. (I use Turbo Analyst, and my office uses it, but this referral
does not constitute endorsement of TurboPower Software or its products
by the US Government in general or the Centers for Disease Control in
particular. However, if I had to give up TurboPower's products, I'd
probably switch to C.)

+-------------------------------------------------------------------------+
| Karl Brendel                                Centers for Disease Control |
| phone 404/639-2709                          Epidemiology Program Office |
| fts       236-2709                          Atlanta, GA                 |
|                                                                         |
|                        Home of Epi Info 5.0                             |
+-------------------------------------------------------------------------+