Indicating Code Sample Line Breaks

Andrew Warren awarren at synaptics.com
Thu Nov 29 13:44:52 PST 2007


Neil Tubb wrote:

> It was a developer that told me to put in a visual indicator.

Of course.  This is a new low, though... I mean, you expect programmers
to be incapable of putting themselves in their users' shoes, but this
one can't even put himself in his OWN shoes.

I doubt that he's ever seen code samples formatted with "carriage-return
arrow icons" to indicate wrapped lines, and I KNOW he'd be annoyed if
those arrow symbols were embedded in text he tried to copy-and-paste
from code samples... Yet he came up with this boneheaded idea anyway.

As others have said, indentation alone will usually be enough to
indicate to your readers that a long line has wrapped.  If the code
samples themselves contain multiple levels of indentation, you may need
to slightly adjust your vertical spacing so that the pieces of a wrapped
line are grouped more tightly than unwrapped lines.

And... If a visual wrapped-line indicator MUST be included, it'd be best
to use whatever character the programming language uses (e.g., backslash
for C or C++), so the code has a chance of working if your reader copies
it straight from the docs into his or her program.

-Andrew

=== Andrew Warren  - awarren at synaptics.com
=== Synaptics, Inc - Santa Clara, CA



More information about the framers mailing list