TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
Subject:Re: Documenting Code/Why Is It So Ugly? From:Ben Kovitz <apteryx -at- CHISP -dot- NET> Date:Tue, 2 Mar 1999 12:18:52 -0700
Kathleen Melly wrote:
>When I import code into a Frame doc it is so ugly. Does anyone have any
>tips for making it more readable? Is there a filter for importing code into
>Frame/PC (I know there's one for Frame/UNIX)? Is there a standard font and
>tab settings that I should be using?
Usually code looks best in Courier, no larger than 10-point, with tabs
every three or four spaces. Set the tabs to match the way the programmer
set them. If not Courier, then some other monospace font.
The big problem with code in documents is that often the code is wider than
the margins, forcing it to word-wrap. Code should *never* word-wrap. If
that happens, you need to manually reformat it the way the programmers do.
This usually means indenting the wrapped line another level in, although
you should wrap comments differently. Best to ask the programmers for some
examples of how they deal with extremely wide lines.
Now that our displays let you easily edit lines of code wider than 80
characters, wide lines are a worse problem when importing, and some
programmers just don't *ever* wrap wide lines. Some let lines of code go
off to the right for hundreds or even more than a thousand characters! If
your programmer is the sort who does that, try asking a different
programmer for help with formatting.