Topic: program listing

topics > computer science > Group: programming

flow diagrams and flow charts
literate programming
open systems
program source as truth
programming style
sections of a program
software documentation
source-rich system
understanding systems


A consistent format for program listings increases a program's readability. Such formats can be enforced by a "prettyprinting" list program. Level numbers can be generated to show program structure and scoping. Line numbers aid editing from marked-up listings. Listings can be numbered by an alphabetical page reference followed by a line number. (cbb 5/80)

Weiser (QuoteRef: weisM11_1987) discusses the importance of a 'source-full' environment. (cbb 1/93)

Subtopic: importance of source up

Quote: a source-full environment, like Lisp, includes access to all functions; yet usually no access to operating system, compiler, or applications [»weisM11_1987]
Quote: programmers should have access to source code just as an auto mechanic can look at the engine [»weisM11_1987]
Quote: source code is the truth about a system; defines its worldview, underlying assumptions, and hidden limitations and strengths [»weisM11_1987]
Quote: source-sparse programs is like kitchen appliances with only vague labels to distinguish them [»weisM11_1987]
Quote: if we have complete source code then the correctness of a system is completely knowable [»weisM11_1987]
Quote: access to source code does not violate information hiding because access is to people, not modules [»weisM11_1987]

Subtopic: top-down, stepwise readability up

Quote: a program listing should represent a breadth-first traversal of the program tree; gives top-down, step-by-step, readability [»richF12_1977]

Subtopic: book formatting up

Quote: use book typography for source code: identify code segments, code paragraphs, sentence structures, intramodule comments [»omanPW5_1990]
Quote: use book format for source code: preface comments, automatically generated table of contents, chapters for modules [»omanPW5_1990]
Quote: book format significantly better than normal formatting of program listing for modifying a program [»omanPW5_1990]

Subtopic: indentation -- pretty printing up

QuoteRef: sattEH5_1975 ;;5 shows blocking on program listing by 1-start block at level 1 and -1 end block at level one very readable
QuoteRef: ledgHF7_1977 ;;101 "Notice that both the standards and the program show a great concern for the prettyprinting of programs
QuoteRef: sammJE5_1962 ;;143 computer listing in "reference format" which is fixed

Subtopic: coding sheet up

Quote: produce a coding sheet and diagram that specify all details of the coding; allocate storage counters to the computation; indicate prints, interpolations, and checks

Related Topics up

Topic: comments (23 items)
Topic: flow diagrams and flow charts (21 items)
Topic: literate programming (16 items)
Topic: open systems (33 items)
Topic: program source as truth (17 items)
Topic: programming style (47 items)
Topic: sections of a program (9 items)
Topic: software documentation (64 items)
Topic: source-rich system (27 items)
Topic: understanding systems
(48 items)

Updated barberCB 11/04
Copyright © 2002-2008 by C. Bradford Barber. All rights reserved.
Thesa is a trademark of C. Bradford Barber.