Guide to Persuasive Programming

Guide to Persuasive Programming

Jerud Mead and Anil Shende

ISBN 1-887902-65-1, $15.00

 

Contents

  1. Introduction
  2. Semantics—Perspective Matters
  3. Semantic Building Blocks
  4. Semantics of Simple Statements
  5. Semantics and High-Level Statements
  6. Semantics of Selection
  7. Semantics of Repetition
  8. Semantics of Abstraction
  9. Are You Persuaded?
  10. Semantics and Data Abstraction
  11. More on Selection
  12. More on Repetition
  13. Recursion and Recursive Data Structures
  14. Are You Persuaded?

Overview

For years computer programmers have created programs with formal syntax and informal semantics. They have produced nicely formatted programs with imprecise comments documenting more the structure of the code than the semantics. This book presents frequently encountered problems and reviews them within the context of semantics to arrive at better solutions. It is language independent. The authors use it as a supplement to a standard first course programming textbook in the CS1 course.

This book’s focus is on program content rather than form. The approach is to use assertions to reflect properties of a program’s state or semantic content. Admittedly the use of assertions is not new. But what is new is the semantically-based approach to the use of assertions.

There are two aspects of persuasive programming: the semantics of program statements and the integration of the semantics into the text of a program. The first can be learned, the second must be experienced. The authors’ approach to presenting statement semantics is to determine for each statement type a pattern of assertions that describes the semantics. The book works from the obvious pattern (often the most clumsy) and then, analyzing examples, works its way toward a more useful pattern.

Persuasive programming is a tool that can be used with either of the leading programming paradigms (structured programming or object-oriented programming). With practice, it becomes quite natural.

Back to Our Catalog