Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

35KB

The Psychology of Computer Programming — Front-Matter: Front matter, contents, Silver Anniversary preface, original preface, and course-use suggestions

  • Source: /library/The Psychology of Computer Programming/source-file.pdf
  • PDF pages: 1–25
  • Pages without text: 1, 2, 25
  • OCR note: OCR is supplied below for image-only pages; multi-column reading order may be imperfect, so consult the PDF for layout and visuals.
  • Note: Silver Anniversary Edition (1998).

[OCR from image-only PDF page; verify layout and illustrations in the PDF.]

THE PSYCHOLOGY COMPUTER PROGRA MMING SILVER ANNIVERSARY EDITION DH GERALD M. WEINBERG

[OCR from image-only PDF page; verify layout and illustrations in the PDF.]

[Image-only page; OCR found no readable text. Consult the PDF for visual content.]

ab yt Los Pah ea he LO) TATA TET iT 7 AEA ey | mmeEy A To’ PEA ey LibmaAes ret Baw Y Ak Point. Park Callece Point Park College ID

  • required for check-out.

Also Available from DORSET House. Are Your Lights On? How to Figure Out What the Problem Really Is by Donald C. Gause and Gerald M. Weinberg ISBN: 0-932633-16-1 Copyright ©1990 176 pages, softcover Becoming a Technical Leader: An Organic Problem-Solving Approach by Gerald M. Weinberg foreword by Ken Orr ISBN: 0-932633-02-1 Copyright ©1986 304 pages, softcover Complete Systems Analysis: The Workbook, the Textbook, the Answers by James & Suzanne Robertson foreword by Tom DeMarco ISBN: 0-932633-50-1 Copyright ©1998,1994 624 pages, softcover Creating a Software Engineering Culture by Karl E. Wiegers ISBN: 0-932633-33-1 Copyright ©1996 384 pages, hardcover Exploring Requirements: Quality Before Design by Donald C. Gause and Gerald M. Weinberg ISBN: 0-932633-13-7 Copyright ©1989 320 pages, hardcover Quality Software Management Series by Gerald M. Weinberg Vol. 1: Systems Thinking ISBN: 0-932633-22-6 Copyright ©1992 336 pages, hardcover Vol. 2: First-Order Measurement ISBN: 0-932633-24-2 Copyright ©1993 360 pages, hardcover Vol. 3: Congruent Action ISBN: 0-932633-28-5 Copyright ©1994 328 pages, hardcover Vol. 4: Anticipating Change ISBN: 0-932633-32-3 Copyright ©1997 504 pages, hardcover Rethinking Systems Analysis & Design by Gerald M. Weinberg ISBN: 0-932633-08-0 Copyright ©1988 208, softcover Understanding the Professional Programmer by Gerald M. Weinberg ISBN: 0-932633-09-9 Copyright ©1988 240 pages, softcover What Every Programmer Should Know About Object-Oriented Design by Meilir Page-Jones foreword by Larry L. Constantine ISBN: 0-932633-31-5 Copyright ©1995 392 pages, hardcover Find Out More about These and Other DH Books: Contact us to request a Book & Video Catalog and a free issue of The Dorset House Quarterly, or to confirm price and shipping information. DORSET HOUSE PUBLISHING Co., INC. 353 West 12th Street New York, NY 10014 USA 1-800-DH-BOOKS (1-800-342-6657) 212-620-4053 fax: 212-727-1044 dhpubco@aol.com_ http://www.dorsethouse.com

NOV 095 1999 Dorset House Publishing 353 West 12th Street New York, New York 10014 Computer Scie mle LIBRARY CENTER LIBRARY CENTER/AC ADEMIC SERVICES OF PITTSBURGH NEGIE LIBRARY iTS re POINT PARK COLLEGE

Library of Congress Cataloging-in-Publication Data Weinberg, Gerald M. The psychology of computer programming / Gerald M. Weinberg. ——- Silver anniversary ed. prot Clie ISBN 0-932633-42-0

  1. Electronic digital computers — — Programming — — Psychological aspects. |. Title. QA76.6.W45 1998 005.1'019 — — dc21 98-38794 CIP Dedication: To my teachers, friends, students. Trademark credits: All trade and product names are either trademarks, reg- istered trademarks, or service marks of their respective companies, and are the property of their respective holders and should be treated as such. Cover Design: Jeff Faville, Faville Design Cover Photograph by David Dale Copyright © 1998, 1971 by Gerald M. Weinberg. Published by Dorset House Publishing, 353 West 12th Street, New York, NY 10014. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without prior written permission of the publisher. Distributed in the English language in Singapore, the Philippines, and Southeast Asia by Toppan Co., Ltd., Singapore; in the English language in India, Bangladesh, Sri Lanka, Nepal, and Mauritius by Prism Books Pvt., Ltd., Bangalore, India; and in the English language in Japan by Toppan Co., Ltd., Tokyo, Japan. Printed in the United States of America Library of Congress Catalog Number: 98-38794 ISBN: 0-932633-42-0 12 SEIS OMORe eee! 6b) Ae Bue

Contents Preface to the Silver Anniversary Edition xi Original Preface xvii Comments on the Original Preface Suggestions for Course Use xxi PART 1. PROGRAMMING AS HUMAN PERFORMANCE 2 Comments on Part 1 P1.i 1 Reading Programs 5 Anexample 6 Machine limitations 7 Language limitations 9 Programmer limitations 10 Historical traces 11 Specifications 12 Summary 13 Bibliography 14 Comments on Chapter 1 1.i 2 What Makes a Good Program? 15 Specifications 17 Schedule 19 Adaptability 20

vi Contents Efficiency 22 Summary 25 Questions 25 Bibliography 26 Comments on Chapter 22. 3 How Can We Study Programming? 27 Introspection 28 Observation 30 Experiment 32 Psychological measurement 35 Using behavioral science data 38 Summary 39 Questions 40 Bibliography 41 Comments on Chapter 3 __3.i PART 2. PROGRAMMING AS A SOCIAL ACTIVITY 44 Comments on Part 2 4 The Programming Group 47 Formal and informal organization 47 Physical environment and social organization 50 Errorandego 52 Egoless programming 56 Creating and maintaining the programming environment 60 Summary 64 Questions 64 Bibliography 65 Comments on Chapter 4 4.i 5 The Programming Team 67 How ateam forms 68 Establishing and accepting goals 72 Team leadership and team leaders 78 The team incrisis 85 Summary 91 Questions 92 Bibliography 93 Comments on Chapter 5 i5.zi

Contents vii G6 The Programming Project 95 Stability through change 96 Measuring performance 100 Project structure 106 Common social problems of large projects 109 Summary 112 Questions 113 Bibliography 115 Comments on Chapteré6 __ G.i PART 3. PROGRAMMING AS AN INDIVIDUAL ACTIVITY 118 Comments on Part 3 sC~P°33.. i ¢ ‘Variations in the Programming Task 121 Professional versus amateur programming 122 What the programmer is tryingtodo 126 Stages of programming work 132 Summary 137 Questions 138 Bibliography 139 Comments on Chapter 7 = 7.i 8 Personality Factors 141 Personality changes 143 Personality invariants 145 Critical personality traits 148 Personality testing 153 Personality testing of programmers 156 Summary 158 Questions 158 Bibliography 159 Comments on Chapter 8 __i8.i 9 intelligence, or Problem-Solving Ability 161 Psychological set 162 Some dimensions of problem solving 164 Facets of programming intelligence 166 Aptitude tests 170

viii Contents Aptitude tests for programming 171 Summary 176 Questions 177 Bibliography 177 Comments on Chapter9 = 9.z.i 10 Motivation, Training, and Experience 180 Motivation 181 Training, schooling, and education 184 Forces against learning 188 How to learn programming 193 Summary 198 Questions 198 Bibliography 199 Comments on Chapter 10 = 10.i PART 4. PROGRAMMING TOOLS 202 Comments on Part 4 P4.i 11 Programming Languages 205 Programming language and natural language 206 Programming language design 211 Summary 214 Questions 214 Bibliography 215 Comments on Chapter 11 11.i 12 Some Principles for Programming Language Design 217 Uniformity 218 Compactness 224 Locality and linearity 229 Tradition and innovation 232 Special-purpose, multipurpose, and toy languages 237 Summary 241 Questions 242 Bibliography 243 Comments on Chapter12 12.i

Contents 13 Other Programming Tools 246 Program testing tools 247 Operating systems 251 Time sharing versus batch 259 Documentation 262 Summary 270 Questions 270 Bibliography 272 Comments on Chapter 13 = 13. PART 5. EPILOGUE 275 Comments on Part 5 = P5.i Index 281

Tiere Ce
ae
ee
ay
Ae
RRP
K4
e
7
i b ers ¥
.
.
|
meg ea aueouda 2 |
SNe OS
3 ria in
atnaice
RR wena
3
WO
c
’
;
oy ‘
AGT 4, Gee CRAMBANG TOOL 702 one
Cevemmnnnrts an, iact S Put.
10
gen ete) a Langunges
2o8-
;
im
Wegner ued raat
fd
ar
asrtts
0
ey ce Sige Sy
asi
as
aa
Age
a
*,
,
,
¥
‘
WS
i
+
|
ek
ety’.
ina
as
Li
a
ty
PTE i Aa ek Ls ys oF a Pla al ST 4
; €¢ 4
|
7
o
aa
;

j iattaat ay: 7 om ff a a te ‘ Hh: ‘i il bert ‘ pT iy mat iS orm: Ueinaipion fer Progremnemliny 0

iepinnges Uaigve = aN. sti: nese ey: a Dae ‘ oF: ity a j =

:
%
;
ve
Ps
7
A
‘
uals, myigat
2u4
;
)
wo.
ees | dS
ise)
a a
‘
;
ae
ran
iam
Lipcaiy aril arwienity — ta
a
on i Ne has Tiaaon HE PK ytd V4 ff Syeeass: ‘a-purpede, EMA inten ronda ARG ESE ie

Silver Anniversary Notes x Preface to the Silver Anniversary Edition The Psychology of Computer Programming is an astonishing book—astonish- ing in the sense that a person who lives to be one hundred twenty-five years old is astonishing. We are in a fast-changing business. No other first-edition com- puter book, as far as | know, has lived to be twenty-five years old—and still counting. Even more astonishing to me is the fact that at the time | wrote it, | never imagined there was anything special going on. | had been writing code, leading groups of programmers, and training and consulting with programmers for about fifteen years. | thought of writing a novel about the computer programming busi- ness (which was then little known to the outside world), but | realized | wasn’t a sufficiently skilled fiction writer to make anyone believe it. So, on an inspired eight-week vacation in Italy in 1969, | wrote the first draft of The Psychology of Computer Programming. | had, by that time, written a couple of best-selling technical books on how to program various machines, but Psychology was a new venture for me. | hada hard time getting it published—something that hadn’t happened with my previ- ous books. McGraw-Hill, my publisher up to that time, got great comments from early reviewers of the manuscript, but said they didn’t believe anybody would buy such a book. | offered it to Prentice-Hall, and they said, with reluctance, they would publish it—if | would agree to publish some of my money-making “technical” books with them. | decided | needed a publisher with a bit more

SE Silver Anniversary Notes enthusiasm, so | offered it simultaneously to four other publishers. Since two years had elapsed, | decided | would go with the first acceptance. All four pub- lishers accepted it, but the first was Van Nostrand Reinhold—and the book was finally published in 1971. Ironically, the day the book came out, my editor was fired, for “not understanding the computer publishing field.” In spite of Van Nostrand’s opinion of my editor’s judgment, Psychology quickly became a best-seller among technical books, running through twenty printings and staying in print for more than twenty-five years. Van Nostrand eventually sold the rights to it and all their computer books to another large house—where it sat dormant, out of stock, for months. After what seemed an eternity of negotia- tion, | reacquired the rights, enabling Dorset House to publish this Silver Anniversary Edition. | wanted to release a Silver Anniversary Edition for several reasons: 1. to make the original book available to a new generation of software people 2. to offer a historical perspective that is usually lacking in our young field 3. to take advantage of a once-in-a-lifetime opportunity—the chance to comment on an industry’s development and to revisit what | thought might have been | didn’t undertake this new edition to update the field of software psychology. For one thing, Ben Shneiderman and others are doing a much better job of that than | could do. For another, as Ben once remarked, the book is really less about software psychology and more about software anthropology—two topics I’ve continued to develop in my subsequent books. Most of all, | think, in reviewing the book and in writing my impressions, | want- ed to pause and take stock of how far | and the software industry have come in twenty-five years. Though the first edition may not have been a turning point for the industry, it was a turning point for me. Since that time, I’ve written far less code and done little managing of groups. On the other hand, I’ve trained thou- sands of programmers and team leaders, and consulted on hundreds of soft- ware projects. I’ve done more code reviewing, designing, design reviewing, developing requirements, and reviewing requirements. And, I’ve especially spent a lot of time training would-be software managers and consulting with them. Yet part of me still wishes | could return to the simpler life of writing code, full time, and not dwell on these other issues. That’s a common feeling in the industry, but few of us ever act upon it. One thing | can see clearly now is that the first edition of Psychology was a prescription for my own studies, such as the study of teams, of leadership, of problem solving, and of problem defining. I’ve spent more than two decades fill- ing in details of those topics that seemed both important and insufficiently under-

Silver Anniversary Notes stood. Looking at the books I’ve written since Psychology, | see that | was filling the “holes.” Taking the books chronologically, 1973: Structured Programming in PL/C, An Abecedarian, was the outcome of an experiment in new ways of teaching programming and of writ- ing programming texts.1 1975: An Introduction to General Systems Thinking was a direct exploration of the thought processes that go into thinking about systems.2 (This book is still in print after more than twenty years.) 1975: Structured Programming.? Dennis Geller, Tom Plum, and | produced this award-winning structured programming film series, again explor- ing new ways of thinking about and teaching programming. 1976: High-Level COBOL Programming was produced in an attempt to transform the thinking of COBOL programmers into new patterns.* It probably didn’t work. 1977: The Ethnotechnical Review Handbook. Daniel Freedman and | self- published the first edition of this handbook, attempting to motivate

and teach the reading of programs in all their stages of development. At the time, no commercial publisher wanted to handle the topic of technical reviews. (The latest edition of this book is still in print.5) 1977: Humanized Input: Techniques for Reliable Keyed Input was an early foray into human interface design.® 1979: The Ethnotechnical Review Handbook was revised to add the myriad things we were learning about reading and analyzing programs. 1979: The Principles of Specification Design: Film Series and Workbook, produced with Bob Marcus, represented our first crack at improving problem definition.” 1 Gerald M. Weinberg, Norie Yasukawa Freedman, and Robert Marcus, Structured Programming in PL/C: An Abecedarian (New York: John Wiley & Sons, 1973). Gerald M. Weinberg, An Introduction to General Systems Thinking (New York: Wiley-Interscience, 1975). Dennis P. Geller, Naomi Kleid, Thomas W-S. Plum, and Gerald M. Weinberg, Structured Programming: A Film Series and Workbook (Kansas City, Mo.: Edutronics Systems, 1975). Gerald M. Weinberg et al., High-Level COBOL Programming (Cambridge, Mass.: Winthrop, 1977). This book ultimately evolved into Daniel P. Freedman and Gerald M. Weinberg’s Handbook of Walkthroughs, Inspections, and Technical Reviews, 3rd ed. (New York: Dorset House Publishing, 1990). 6 Tom Gilb and Gerald M. Weinberg, Humanized Input: Techniques for Reliable Keyed Input (Cambridge, Mass.: Winthrop, 1977). 7 Robert Marcus and Gerald M. Weinberg, The Principles of Specification Design: Film Series and Workbook (Bowie, Md.: Brady Publishers, 1979). ine} wo on

Silver Anniversary Notes 1979: On the Design of Stable Systems, written with my partner, Dani Weinberg, extrapolated thinking patterns into how systems are designed to survive. (This book’s second edition is still in print, enti- tled General Principles of Systems Design.8) 1982: Are Your Lights On? How to Figure Out What the Problem Really Is. Don Gause and | continued the work in problem definition with this work, which is still a popular introduction to the subject.9 1982: Rethinking Systems Analysis & Design looked at how systems ana- lysts think, or ought to think.1° 1982: Understanding the Professional Programmer |looked at how program- mers think, or ought to think.” 1985: Computer Information Systems: An Introduction to Data Processing. Dennis Geller and | continued our explorations into teaching methods and thought processes for software work. 12 1985: The Secrets of Consulting addressed the consultative relationship between software developers (and others) and their clients. This innovative book remains a strong seller today, demonstrating that there are universal principles of consulting.13 1986: Becoming a Technical Leader expanded on the topic of leadership and teams, and is also still very much in demand.14 1989: Exploring Requirements: Quality Before Design, written by Don Gause and myself, carried problem definition to a deeper level.15 8 The current edition is: Gerald M. Weinberg and Daniela Weinberg, General Principles of Systems Design (New York: Dorset House Publishing, 1988). 9 The current edition is: Donald C. Gause and Gerald M. Weinberg, Are Your Lights On? How to Figure Out What the Problem Really Is (New York: Dorset House Publishing, 1990). 10The current edition is: Gerald M. Weinberg, Rethinking Systems Analysis & Design (New York: Dorset House Publishing, 1988). 11 The current edition is: Gerald M. Weinberg, Understanding the Professional Programmer (New York: Dorset House Publishing, 1988). 12Gerald M. Weinberg and Dennis P. Geller, Computer Information Systems: An Introduction to Data Processing (Boston: Little, Brown, 1985). 13 Gerald M. Weinberg, The Secrets of Consulting (New York: Dorset House Publishing, 1985). 14 Gerald M. Weinberg, Becoming a Technical Leader (New York: Dorset House Publishing, 1986). 15Donald C. Gause and Gerald M. Weinberg, Exploring Requirements: Quality Before Design (New York: Dorset House Publishing, 1989).

Silver Anniversary Notes 1991: What Did You Say? The Art of Giving and Receiving Feedback, writ- ten with Edie and Charlie Seashore, summarized what is known about the human interaction of passing information back and forth.16 1991-1997: Quality Software Management, a four-volume series, wrapped up all | knew about the management of software efforts and software people. The series takes up the psychological subjects of systems thinking, measurement, action, and change.17 With the Quality Software Management series, | felt | had concluded the sub- ject that | started to explore a quarter-century earlier. Looking back over these years, especially with the perspective of the first edition of Psychology, | see that | turned out to be a worse prognosticator than | thought; but to my credit, | thought | would be a worse prognosticator than | thought. Actually, it was just like any technical review—worse than | hoped, but not as bad as | feared. For this Silver Anniversary Edition, | decided to take my own advice to people whose work is reviewed in technical reviews: | would not try to hide my errors, for they may be the source of the most learning for my readers. | have left the original text as it was—antiques and all—for your illumination, and have simply added some “wisdom of hindsight” remarks whenever the spirit moved me. | hope you find the perspective brought by this time-capsule contrast as useful to you as it was enlightening to me. 16 Charles N. Seashore, Edith Whitfield Seashore, and Gerald M. Weinberg, What Did You Say? The Art of Giving and Receiving Feedback (Columbia, Md.: Bingham House Books, 1991). For copies of this book, contact Bingham House at 1001 Windstream Drive, Suite 900, Columbia, MD 21044. 17 Gerald M. Weinberg, Quality Software Management, Vol. 1: Systems Thinking (New York: Dorset House Publishing, 1992); Quality Software Management, Vol. 2: First-Order Measurement (New York: Dorset House Publishing, 1993); Quality Software Management, Vol. 3: Congruent Action (New York: Dorset House Publishing, 1994); Quality Software Management, Vol. 4: Anticipating Change (New York: Dorset House Publishing, 1997).

a ee eee,
a
‘
ree
TEM
ite
aon We
HAN
fe
Fb ” ae
&
as
‘get serif
ry
sakanens Ye neti
M atolls Noi RCE
chy eH paiwutemeityed pis pe Sealand
nicl
are
isvo HOBUiymiiog
a i
Binae YOinwoneNsup 6 etolqxs oF betas |
y ss | YQoOroN2” io favibe tent orl to pies ert tiie vicongee 2
Rhea wemen ¢
‘OF “ie igEST i
aR
faul ew 4 VNU
9G
GOTRM ppeorpaae onow 8 sat
oes) | ap Daten ton jd
ewyir a Fi
r
x an ag
et
4 she
/
a
iS
HIG ‘ott Kae Tet es
ve
ys
eyes yin ail at, Nii ren dilunies |,
a2 eiMO)., PESeDIe
2 me ‘bow
ee. is 04
ont Hel
overt | evebRiey yer i! grnine at tpoer siit fo anwoe ae mv
Cigars oust mes ancgrimesicnntih init’ Nhe AE, La
NR BOLE eR
ae
aa
| ver bovanuihkys ecifmavennewseemontigtahaie to loti” seen be
Ut kulesy |e ein histoire ‘wicif eS eA tI Seige
ORI
FCG
8 10 Sai
org a a
" a
Sg
ee ie rcs! fedigla er oe
tpt wi rent
Ef Aah,
8 A GORY it wey ay aa
cal
aaa
+
7
Wage“ ya
~
pb:
nyt
Lr Eee
eyige, Morcremeusy Quality Balure Dias/gi, nanan tid
‘wh wy Bits
A
eters ing af vay Oren: chotinnitiony te fy near ae, ole
’
f
~ *
hy
ty
}
a
an
|
i?
f
,
—
J
i

ay. ae, be Poats \ i } i — ; , et i iy ‘ Aue 4 WR ; \ ” atl +1 Yaa ina Fe Mabbalis y oaregek heb ieie be Saini #, Val berg wre sane sty, ein Liebe: lt Nee (gr The Yeo) bu ray ye me vin hg, Te, “e BT a crsmmmeyy miley ah) MnmiabO tS: Neon are diread a ‘rnc 5 ih i . (D4 EWP icat Wit Sp “a Bay 5008 Wiahe Sessa nia tata 7 NK. ae % ant Sse ; ge es, ee pf “in we ; | ; 7

    • t
:
4
Mel
4
NN
, ,
7
’
bags
mht
Sete
peace
Ma
tea Vi ee
ie
va:
this
‘ a kasd
“ies
2.
x
rican ;
iv ae af .
| 2

. an waren TY ak enced , be ”, j 4 ‘ . } i: lal a an | iy Wie wont ia ce ) *

Original Preface This book has only one major purpose—to trigger the beginning of a new field of study: computer programming as a human activity, or, in short, the psychology of computer programming. All other goals are subservient to that one. For instance, | have tried to make the book interesting and nontechnical, insofar as is possible, so as to encourage the greatest number of people to read it: not just programmers, but pro- gramming managers and others connected with programming in the many ways we are connected with programming these days. What! am trying to accomplish is to have the reader say, upon finishing the book, “Yes, programming is not just a matter of hardware and software. | shall have to look at things in a new way from now on.” Because this is a new field—a new way of looking at familiar things—it has not always been possible to support certain ideas with “scientific” evidence. Indeed, many of the views in the book are merely the author’s opinions—often strong opin- ions, but not based on anything better than personal observation over many years. No doubt, many of these opinions are just plain wrong, as are many of the ideas supported by more evidence. But there is a world of difference between a wrong idea and a sterile one. If any reader takes issue with something expressed here, my fondest hope is that he will set up an experiment and prove me wrong. As | hope the text demonstrates with numerous examples, our profession suf- fers under an enormous burden of myths and half-truths, many of which my stu- dents and | have been able to challenge with extremely simple experiments. But our resources are limited and the problem is great. There are, by various esti- xvii

Xviil Original Preface mates, hundreds of thousands of programmers working today. If our experi- ences are any indication, each of them could be functioning more efficiently, with greater satisfaction, if he and his manager would only learn to look upon the pro- grammer as a human being, rather than as another one of the machines. | think that great strides are possible in the design of our hardware and soft- ware too, if we can adopt the psychological viewpoint. | would hope that this book would encourage our designers to add this new dimension to their design philosophy. Not that the few ideas and speculations in this book will give them all the information they need; but hopefully the book will inspire them to go to new sources for information. At the moment, programming—sophisticated as it may be from an engineering or mathematical point of view—is so crude psycho- logically that even the tiniest insights should help immeasurably. My own experi- ence, and the experience for my students, in teaching, learning, and doing pro- gramming with psychological issues in mind, bears out this assertion. | hope each of my readers will try it for himself. As will be obvious from reading it, this book represents a composite of ideas from many people, most of all my students at the IBM Systems Research Institutes in New York and Geneva and The State University of New York at Binghamton. Having had so many working programmers as students over ten years, | have been able to extend vicariously my own small experience into all sorts of programming situations which no one person could hope to experience in a lifetime. Needless to say, some of these experiences have had to be fiction- alized to protect the innocent, and sometimes the guilty. Without the many long hours of discussion with my students, without their many clever experiments, this book could never have been written. There is no sense assuming a position of false modesty by saying that all of the mistakes in the book are mine—no doubt some of the experiences related to me were dis- torted in one way or another. What /s my responsibility is the acceptance of these experiences as the basis for certain ideas—just as it is the reader’s responsibility to weigh each idea herein in the light of his own experiences and needs. The last thing | should wish to happen is to have anything said in this book taken as gospel—that is just the attitude we are trying to abolish. The material which follows is food for thought, not a substitute for it. | wish to thank all of my students who have contributed so much to me person- ally as well as to this book, just as | wish to thank all my teachers and my friends. Teachers, friends, students—really they are all one and the same, and | hope they have found me to be so. To them the book is dedicated, not just on the dedi- cation page, but in every sentence and paragraph. To my wife, who, in addition to her usual contribution to my life, read every page of this book from an anthropolo- gist’s point of view, | owe more than can be expressed in a mere dedication. Gerald M. Weinberg

Silver Anniversary Notes XC Comments on the Original Preface This book has only one major purpose—to trigger the begin- ning of a new field of study: computer programming as a human activity, or, in short, the psychology of computer pro- gramming. (p. xvii) So the Preface began, more than a quarter-century ago. What has changed? Did | succeed in this high-blown purpose? Well, I’m a quarter-century older and, if not wiser, at least more humble. There are, now, many people studying computer programming as a human activity, but | wouldn’t say that this book triggered that new field—or if indeed it can truly be considered a “field.”

|
2

i, y i Tp ot ieriitat a Gdpk of peoareeieas ok CF OO ety ice ence Oar: could. Die Mis wie ortet. srubteaiion, + f= men rt ay ban 2 rome. on @ hee Nien. aisinte Hay 48 por th ree inet Gree Aes ee ceowaible ww ha, rotor hardware 4 wart

7 eo cm dem fees eyo! pp lamer, 1 wets hese i j AS Gotu qe aus tt ir cg war an T orig eV + ce RS aa * Soe TaN Ha eras Pere, ee soy, “ne lhhent eights uheotd ya feinasurabh. My owt ene gee! Mo aber orn ToT fey Slucanht, -leRing, hoary, ark! cum pi egy st . coychogicd ingeya o mind, Sem oul ‘Ale aceetion £ mary « Uiue ws By Peay ge loan ‘oo concing 7 ie hook saoreeenis 4. compoaie of ide “itty stuctente atthe 1M Syetere Ay ) ¢ Geneva und The Gile Cinnvaenelty of haw . ae i 3m InRey wok CragAriMens 4 wudemh,, anit . Be + lo 4k? vo eily ep Gay) een ee ALAM SN — Fes QUA ZaTIG eR MOS. ae | VE TINTIQENG, Yevaqmes! ngusidnliRonnncatestine % arenes tai wee een ara Hivos nara. a (o.. 5 OF scueshon sith CkeU aap aghianrnstapgsct any file o oi die book wit raya a: 98 se “neg respec asa Joon Yibesse- shear s nedingiay SR eet ~ . (ei) chads Game “Tasos mmewceigh ai ae KE Srv AO essi, 1 aatw tae ai fone 188 re . 2g NST. utes 28 GRR IO IR Seatti ii 8 ; dW es9ote

  • ro Halel wea Tecbbeepoht Foot aMlyIRG! yae Seablecied ted adigite he ak “Dire. gaa wrsh, to happen ‘ole wheaeiones anit biach 4gt ae GOA ia & pial “ye ahoude wes. we kyrg ie sei eater: «tip Sopot eed ty thought. cock sustvetidt tor ft | oan 40 Daath Ue pony aie tte ete, Neer Gi) ) 50. NERY Ae Qity sy eee om OO BOO, cams | with i: Shaye, mit y eacir ard Va Pe. ale ik, NN ne Cantey trey, ane, all < Riighan ivicin they ar tetas Mah Seb an $i; own tab. biadk bag Cat a mp Br Dera of tv pat | Larne Reanay Yt, passionate en ee ee en = 2 i +e. = ye aa be

Suggestions for Course Use Oscar Wilde used to claim at parties that he could discourse on any subject for half an hour without advance preparation. When challenged by a listener to speak about the Queen, he replied haughtily, “Sir, the Queen is not a subject.” Even for so great a raconteur as Wilde, it is difficult to discourse on something that is not a subject, and many people are unconvinced that the psychology of computer programming is a subject. Certainly few university curricula offer such a course, so that any pioneer who wishes to inaugurate one is faced with an arduous path. A textbook, such as this one, should prove of some help, but for the first attempt at least, a number of suggestions for its use may not be pre- sumptuous. This book was developed in conjunction with a course titled “The Psychology of Computer Programming.” The course was for graduate students in our Computer Systems program, all with some programming experience and at least one year of graduate training. It does not seem advisable to give such a course to people who are not able to write programs themselves, or who are at lower than a graduate level or a senior level with a strong major in Computer Systems or Computer Science. The course was given in seminar form, for | am not inclined to lecture at peo- ple who know how to read. It was spread out over two semesters of two credits each, in order of give as much time as possible for students to pursue experi- ments of their own. Each student was required to plan and complete one small xxi

xxii Suggestions for Course Use experiment, and some of them made quite significant contributions, many of which are reported in this book. The class met once a week for two hours or more, with readings in advance from this text and from some of the references to prepare for specific discussion topics. One suggestion is in order about the readings. Since many of the works used are in obscure publications or in technical reports, we made a practice of provid- ing Xerox copies of such readings in advance to each student. This practice seemed to encourage people to read the assignments with great regularity. We got rather quickly into the subject of how to study programming, since few of the students had much background in behavioral sciences, let alone in behav- ioral science experimentation. Once this topic was covered, students were able to make a start on their projects, and we were able to proceed with the remain- der of the material. Although it is not necessary that such a course require each student to experiment, when students do experiment it is important that every effort be made to get them started early. lf experimentation is not required or desired, the course would fit nicely into a one-semester pattern—either as a seminar-discussion or lecture-discussion. In any case, it is strongly recommended that at least one period per week be devot- ed to discussion, and the questions at the end of each chapter are intended as guides to the sort of topics that can be prepared—in notes or as an actual written assignment. Another way this material can be used is in a one- or two-week intensive train- ing session, as in a summer institute or in management training workshops. In such situations, experimentation is ruled out, although it is useful to perform one simple experiment in which the students are the subject so that they get the fla- vor of experimentation. Any one of a number of experiments suggested in the text would be suitable, but the most careful advance preparation is necessary if the time constraints are to be met. Similarly, time constraints dictate in such a class that every piece of reading material be available in one copy for each par- ticipant. Finally, if only for the necessary break in intensity, frequent discussions must be interspersed with whatever lecturing is done. Discussion will be particu- larly important when the class consists of experienced programmers or program- ming managers, for they will have as much or more to contribute than the instructors or text. The topic is so important to them, and so close to them, that with the slightest of prompting and leadership by the instructor, the success of the course is assured.

[OCR from image-only PDF page; verify layout and illustrations in the PDF.]

THE PSYCHOLOGY OF COMPUTER PROGRAMMING SILVER ANNIVERSARY EDITION

Powered by TurnKey Linux.