Cambridge University Press 978-1-108-78987-5 — How to Write Good Programs Perdita Stevens Index More Information

Index

A bold page number indicates where a term is deined.

abstract syntax tree, 105 , 35, 45, 189 abstraction, 29, 141 C♯,35 see also model C++, 35, 190 agile, 64, 159, 198 camel case, 89 algorithm, 29, 147, 148, 196 change, 141, 144, 197 Alice, 44 checklist, 127 arguments, 25,28 cloud, 66 functions as, 45 code order of, 108 commented-out, 62 type of, 41, 108 completion, 52,90 assert, 71 dead, 64 assignment, 131 line length, 99 vs. comparison, 126 reputable body of, 46, 63, 94, 99 Atom, 18 spaghetti, 98, 122 autocompletion, 52,90 unreachable, 64 autosave, 57 code sense, 3, 133 coding, 4 backups, 65 coding dojo, 153 bar, see metasyntactic variable coding interview, 148 BASIC, 44, 125 command line, 15, 49 baz, see metasyntactic variable comment, 27, 70, 85–88 BlueJ, 44, 54 commenting-out, 62 breakpoint, 111 comparison bug, 32, 101, 190, 191 of booleans, 126 after removing, 124 of objects, 130 avoiding, 138 vs. assignment, 126 avoiding recurrence of, 77 compiler, 13, 35 in compiler, 109 bug, 109 removing, 122 incremental, 51 the Lauren bug, 78 computational complexity, 148 see also debugging content assist, 52,90 build, 51, 53 contract, 88 202

© in this web service Cambridge University Press www.cambridge.org Cambridge University Press 978-1-108-78987-5 — How to Write Good Programs Perdita Stevens Index More Information

Index 203

crash, 118 time, 146 currying, 23 user, 146 Emacs, 18, 49, 58, 90, 95 data science, 192 embedded systems, 190 , 189 encapsulation, 45, 114 debugger, 111 enterprise systems, 190 debugging, 101–133 error, 104 by rewriting, 112 compared with warning, 104 cardboard, 120 compile-time, 103 crash, 118 non-termination, 118 interactive, 111 null pointer exception, 119, 130 non-termination, 118 off-by-one, 130 rubber duck, 120 using print statements, 110 run-time, 118 defensive programming, 132 type, 107 see also demonstration, 175 bug dependency, 37, 42, 51, 138, 163, 188 error indicator, 51 design, 134, 141, 144, 183, 197 error message, 103 notes, 29, 88, 152 recurrent, 160 design pattern, 197 ethics, 10 development exam, 179 iterative, 30 exception, 118 test-driven, 79, 151 exercises, 157 Dijkstra, Edsger, 82 directory, 17 failure, see bug disk, 56 fault, see bug domain concept, 144 Fizz Buzz, 19, 20, 25, 28, 138, 153 domain-speciic language, 198 folder, 17 duplication foo, 32 eliminating, 136 for loops, 127 Fortran, 190 Eclipse, 51, 53, 54, 90, 92 framework, 76, 190, 192 editor, 16, 49, 55, 90 dumb, 49, 53 logging, 111 mode, 49, 95 testing, 75 vs. word processor, 16 froboz, 32 effect, 25 function, 42 eficiency, 134, 145 pure, 25 maintainer, 146 Pareto, 146 Git, 60 programmer, 146 GitHub, 53, 61, 66 space, 146 graphical user interface, 188

© in this web service Cambridge University Press www.cambridge.org Cambridge University Press 978-1-108-78987-5 — How to Write Good Programs Perdita Stevens Index More Information

204 Index

habit, 55, 65, 66, 122, 127, 129, 131, library, 43, 51, 162, 190, 192 132, 153 standard, 43, 47, 162 hackathon, 194 linking, 36 Hamilton, Margaret, 78, 196 Lisp, 192 Haskell, 45, 190 logging, 111 Haskell example, 15, 18, 22, 26, 40, Logo, 44 80, 107, 108, 113, 129, 139 Hello World, 38 machine learning, 192 Hoare, Tony, 183 magic constant, 139 hobbits, 155 maintainability, 134 Hollywood Principle, 76 maintenance, 134 Hopper, Grace, 101 MATLAB, 191 hubris, 155 memory, 56 metasyntactic variable, 32 see IDE, integrated development method, 25, 42, 72 environment main, 72 idiom, 39, 46, 97, 148 Milner, Robin, 35 impatience, 155 minimal non-working example, 164 integrated development environment, ML, 35 14, 18, 50–55, 90, 95 MNWE, 164 IntelliJ IDEA, 53 model, 197 interactive prompt, 15, 111 model-driven engineering, 198 interpreter, 13, 34 Moore’s Law, 145 invariant, 88 Moore, Gordon, 145 Java, 45, 190 multiple choice, 185 Java annotations, 130 mung, 32 Java example, 6, 22, 27, 39, 72, 73, mutable state, 45 84, 85, 87, 91, 93, 94, 106, 114, 115, 117, 125, 130, 131, name, 89–92, 142, 144 137, 138, 140 for constant, 140 JavaScript, 34, 190 NetBeans, 53 JUnit, 75 non-termination, 118, 128 Jupyter notebook, 16 Notepad, 17 Notepad++, 18 kata, 153 NPE, 119, 130 keyboard shortcut, 51 null pointer exception, 119, 130 Knuth, Don, 82 Objective-C, 35 layout, 52, 92 off-by-one error, 130 laziness, 155 open-source, 43, 61, 191, 192, 194 lexing, 105 operating system, 15, 49

© in this web service Cambridge University Press www.cambridge.org Cambridge University Press 978-1-108-78987-5 — How to Write Good Programs Perdita Stevens Index More Information

Index 205

pair programming, 159 REPL, 15 paradigms, 45 requirements, 196 parsing, 105 Perl, 34, 74, 191 Scheme, 192 PHP, 34, 191 scope, 42 pointer, 189 Scratch, 14, 44 polymorphism, 41 scripting language, 44, 74, 191 positive bias, 77 segmentation fault, 118 post-condition, 88 semantics, 21, 199 pre-condition, 88 sexism, 11 print statements, 110 skeleton, 28 program, 12 snake case, 89 good enough, 152 software engineering, 4, 134, 196 Hello World, 38 software process, 198 programming, 4 space character, 95 defensive, 132 spaghetti code, 122, 163 extreme, 198 speciication, 28, 68, 69, 80 functional, 45 stack overlow, 118 imperative, 45 stack trace, 119 logic, 45 standard out, 68, 110 object-oriented, 45, 143 static type-checking, 189 pair, 159 stdout, 68, 110 theory, 198 structure, 41, 99, 139, 141, 144, 152 project, 50, 173 Sublime, 18 Prolog, 45, 191 Subversion, 60 Python, 191 SVN, 60 Python example, 5, 15, 26, 28, 38, syntax, 21 68, 72, 97, 123, 128, 129, 142, syntax error, 21 143, 151 syntax highlighting, 49

quick ixes, 52 tab character, 95 TDD, 79, 85, 151 R, 192 team working, 174, 198 Racket, 192 template ile, 18 ratchet technique, 58 test, 69 RCS, 60 system, 74 recursion, 129 unit, 73 refactoring, 92, 121, 134–152 test-driven development, 79, 85, 151 relective writing, 177 testing, 68–82, 196 regression, 77 property-based, 79 see also testing quotations about, 81 repetitive strain injury, 51 regression, 77, 102, 109

© in this web service Cambridge University Press www.cambridge.org Cambridge University Press 978-1-108-78987-5 — How to Write Good Programs Perdita Stevens Index More Information

206 Index

testing main, 72 version control, 53, 59–61, 66 TextEdit, 18 vi, 18 Turing complete, 186, 187 Visual Basic, 44 Turing machine, 187 Visual Studio, 54 Turing, Alan, 187 Turing-computable functions, 187 Wall, Larry, 154 type-checking, 37 warning, 104 static, 189 web applications, 190 types, 37–41, 199 while loops, 127 TypeScript, 190 whitespace, 92, 95 worklow, 50 UML, 197 undo, 55 Y2K, 188

© in this web service Cambridge University Press www.cambridge.org