Go To Statement Considered Harmful - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Go To Statement Considered Harmful

Description:

programmer's activity ends when correct program is constructed. ... use of the go to statement has an immediate consequence that it becomes terribly ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 10
Provided by: Comp933
Category:

less

Transcript and Presenter's Notes

Title: Go To Statement Considered Harmful


1
Go To Statement Considered Harmful
  • by E.W. Dijkstra Mar. 1968
  • presented by Yuanhua Qu
  • for spring 2003 CS5391

2
Go To Statement Considered Harmful
  • Overview
  • Two Remarks
  • Process
  • The Go To Statement
  • Acknowledgment

3
Overview
  • The quality of programmers is a decreasing
    function of the density of go to statements in
    the programs they produce.
  • The go to statement should be abolished from all
    "higher level" programming languages (i.e.
    everything except, perhaps, plain machine code).

4
Two Remarks
  • First remark
  • programmers activity ends when correct program
    is constructed.
  • Process is the true subject matter of his
    activity
  • accomplish the desired effect
  • satisfy the desired specifications in its dynamic
    behavior

5
Two Remarks
  • Second remark
  • Our intellectual powers are rather geared to
    master static relations.
  • Our powers to visualize processes evolving in
    time are relatively poorly developed.
  • Therefore should shorten the gap between the
    static program and the dynamic process

6
Process (continued)
  • textual index
  • is a pointer to a suitable place in the text
  • The progress of a process
  • can always be uniquely characterized by a (mixed
    ) sequence of textual and/or dynamic indices.

7
Process (continued)
  • Indices provide independent coordinates in which
    to describe the progress of the process.
  • An independent coordinate system can describe the
    process in a helpful and manageable way.

8
The Go To Statement
  • Unbridled use of the go to statement has an
    immediate consequence that it becomes terribly
    hard to find a meaningful set of coordinates in
    which to describe the process progress.
  • The go to statement as it stands is just too
    primitive it is too much an invitation to make a
    mess of ones program.

9
Acknowledgment
  • The remark about the undesirability of the go to
    statement is far from new. Trace back to
    C.A.R.Hoare and Wirth.
  • Guiseppe Jacopini seems to have proved the
    (logical) superfluousness of the go to statement.
  • The end.
Write a Comment
User Comments (0)
About PowerShow.com