|
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.
The audience for the book is the programmer
desiring to take his/her craft to a new level or the serious
student seeking additional insight in the process of achieving
program correctness.
The focus is on program content rather
than form. The approach is to use assertions to reflect properties
of a programs state or semantic content. Admittedly, the
use of assertions is not new. What is new is the semantically-based
approach to the use of asseritons.
There are two aspects of persuasive programming:
the semantics of program statements and the integration of the
semantics into the text of the program. The first can be learned;
the second must be experienced. The approach to presenting statement
semantics is to determine for each statement type a pattern of
assertions which describes the semantics. This book works from
the obvious pattern (often the most clumsy) and then, analyzing
examples, works its way toward a more useful pattern.
|