|
|
Авторизация |
|
|
Поиск по указателям |
|
|
|
|
|
|
|
|
|
|
Kernighan B.W., Plauger P.J. — The elements of programming style |
|
|
Предметный указатель |
39
142
absolute test, relative vs. 4 8 118
acceptance of comments, subconscious 142
agreement of code and comments 142
airplane weight program 43
Algorithm complexity 135
algorithm, choice of 5 74 130 134
algorithm, inefficient 5 13 49 70 116 129
AMAX1 function 8
Ambiguity, if-else 45
ambiguity, operator precedence 14 21 102
AMIN1 function 9
ANSI Fortran Standard 6 15
ANY function 84
appropriate data representation 20 47 53 63 74 90 97 127
appropriate modularization 24 62 63 77 95 150
arguments, function 3 62 72 96
Arithmetic if statement 16 131 132 145
arithmetic statement function 12
arithmetic, mixed-mode 6 104
array bounds, reference outside 51 85 106 112
Assembly language 3
assembly language, recoding in 138
asterisk subscript 88
Asymptotic correctness 113
Atan function 12
average-computing program 113
avoiding GOTO's and labels 9 17 18 19 31 35 39 108 150
avoiding special cases 112 126 130 131
bad code, commenting 44 45 143 144
bad code, patching 71 110
bad data, identifying 87 91
BASIC 3
BEGIN-END statement 31
binary search program 107 110
binary, decimal to 12
blank-counting program 10
Boolean operators 20
boundary condition error 43 50 112 125
Boundary condition testing 112
bowling program 36 145
branch on equality, wrong 107 125 142
branch, multi-way 37
branches after IF 17 31
branching around branches 3 18 32
Bug, performance 13 136
built-in functions 9 10
bushy decision trees 47
Case statement 37
centralized input and output 97
change, ease of 2 12 25 28 90 123 128 155
change-making program 48
character input function, READCH 97
Checker-playing program 60
choice of algorithm 5 74 130 134
clarity before efficiency 11 130
cleverness 1 10 73 102 123
COBOL 3
code and comments, agreement of 142
color-counting program 86
combining logical operators 20 21
commenting bad code 44 45 143 144
commenting variables 150
comments, agreement of code and 142
comments, excessive 104 151
comments, incorrect 70 88 142 143 151
comments, subconscious acceptance of 142
comments, useless 142
comparing LOGICAL variables 19
comparisons, sorting run-time 133 134 135
Compilation, separate 59
compiler, debugging 105
compiler, outsmarting the 11 127
complexity, algorithm 135
complexity, program 16 76 95
composite design 77
Computational complexity 130
computed GOTO statement 17
condition, default 37
condition, ENDFILE 65 86 88
condition, impossible 16 37 115
condition, SUBSCRIPTRANGE 85
construction, incremental 72
continuation character 14
control cards 138
control flow explicit, making 35 36 104
Convergence tests 4 8
conversion, output 130
Conversion, type 12 24
correctness before efficiency 123 125 126
correctness, asymptotic 113
counting characters 6 24
Counting input data 86
coupling between modules 28 62 95
criticism, rules for 6
current-computing program 103
customer account program 66
data representation, appropriate 20 47 53 63 74 90 97 127
DATA statement, initialization with 105
Data structures, recursive 77
data type, incorrect 13 104
data, counting input 86
data, debugging 87
data, identifying bad 87 91
data, mnemonic input 87 90 92
data, plausible input 84
data, validating input 84 91 150 151
date conversion program 52
dating-service program 19
De Morgan's rules 21
Debugging 2 10 61
debugging compiler 105
debugging data 87
Decimal to Binary 12
decision tree, minimum depth 46 53
decision trees, bushy 47
decision, multi-way 37
decisions, forcing order of 45
decisions, order of 38 44 47
decisions, rearranging 38 44 46
declaration, explicit type 14 153
declaration, implicit type 14 104 153
declaring all variables 14
default condition 37
Default parameters 94
defensive programming 16 65 114 133
Design, top-down 41 71
dice simulation program 57
Dijkstra, E. W. xii
Divisibility test 53 63 91
Division by zero 4 13 152
division, truncating integer 1 49 53 91 128
Do statement 34
DO statement done once 112
DO, extended range 5 70
DO-END statement 31
DO-WHILE in Fortran 36 39 87 103 131
DO-WHILE statement 34
documentation, pseudo-code as 141
ease of change 2 12 25 28 90 123 128 155
Efficiency 25 123
efficiency, clarity before 11 130
efficiency, correctness before 123 125 126
Efficiency, false 11 12 24 45 61 124 127 131
Electric bill program 125
ELSE GOTO 45 47
else if statement 37
ELSE IF statement, indentation of 38 147
else statement 32
| employee wage program 123
end of file marker 86
end of file test 65 88 97
END= statement 86 97
ENDFILE condition 65 86 88
equality tests, floating point 118 120
equality, wrong branch on 107 125 142
Eratosthenes, sieve of 139
error, boundary condition 43 50 112 125
error, off by one 51 66 95 105 106 108 113
error, typographical 5 13 15 45 48 110 125 143
errors, floating point 115
errors, multiple 102 113
Euclidean Algorithm program 130
excessive comments 104
exits from loop, multiple 48 108 150
explicit type declaration 14
explicit, making control flow 35 36 104
extended range DO 5 70
factorial program 126 129
failure to initialize 101 104 125
false efficiency 11 12 24 45 61 124 127 131
floating point equality tests 118 120
floating point errors 115
floating point incrementation 13 104 116
floating point numbers as sandpiles 117
floating point truncation 4 116 118
Floor function 49 128
flow, top to bottom 25 37 39 66 76 89 108 124
Flowcharts 114 141
Fn.O input format 92
forcing order of decisions 45
FORMAT statements, variables in 51
format, program 146 148 150
format, uniform input 92
formats, uniform input 93
Fortran 77 6 39 97
Fortran preprocessors 39
Fortran verifier 7
Fortran with semicolons 18
Fortran, DO-WHILE in 36 39 87 103 131
Fortran, grouping of statements in 32
Fortran, IF-ELSE in 33 39 41 124
Fortran, recursion in 77
free-form input 88 93 99 138
function arguments 3 62 72 96
function, AMAX1 8
function, AMIN1 9
function, ANY 84
function, ATAN 12
function, character input 97
Function, floor 49 128
Function, index 10
function, MOD 49 53 91 128 130
function, SUBSTR 10
function, TRUNC 63
functions, built-in 9 10
Functions, library 9
Garbage in, garbage out 98
Gauss — Seidel iteration program 150
generality, lack of 3 5 9 25
GET DATA statement 94
GOTO's and labels, avoiding 9 17 18 19 31 35 39 108 150
grouping of statements 31
grouping of statements in Fortran 32
hazards, numerical 4 42 118
hiding, information 24 62 65
identifying bad data 87 91
Identity matrix 1
If statement 17 31
IF, branches after 17 31
If-else ambiguity 45
IF-ELSE in Fortran 33 39 41 124
implicit type declaration 14 104 153
impossible condition 16 37 115
inaccessible code 20
incorrect comments 70 88 142 143 151
incorrect data type 13 104
incremental construction 72
incrementation, floating point 13 104 116
Indentation 20 31 32 43 146
indentation of ELSE IF statement 38 147
indentation, random 18 24
INDEX function 10
indexed loop 34
inefficient algorithm 5 13 49 70 116 129
infinite loop 4 73 110 115
Information hiding 24 62 65
initialization with DATA statement 105
initialization with INITIAL attribute 105
initialize, failure to 101 104 125
input and output, centralized 97
input conversion program 99
input data, counting 86
input data, mnemonic 87 90 92
input data, plausible 84
input data, validating 84 91 150 151
input format, Fn.O 92
input format, uniform 92
input formats, uniform 93
input function, separate 65 67 71 94 150
input, free-form 88 93 99 138
Insertion sorting 105
Instrumentation 135
integer division, truncating 1 49 53 91 128
integration program 120
interchange sort program 132
internal modularity 53 95 126
Knuth, D. E. 136
labels, mnemonic 85 108 145
lack of generality 3 5 9 25
language features, non-standard 6
Library functions 9
logarithm program 117
logical IF statement 16 17 85
logical operators, combining 20 21
LOGICAL variables, comparing 19
loop done zero times 51 109 111 112 131
loop, indexed 34
loop, infinite 4 73 110 115
loop, multiple exits from 48 108 150
Maintenance 10 25 123 128 155
making control flow explicit 35 36 104
marker, end of file 86
McCracken, D. D. xii
median program 63
metal cost program 90
Mills, Harlan xii
minimum depth decision tree 46 53
minimum-computing program 9
mixed-mode arithmetic 6 104
mnemonic input data 87 90 92
mnemonic labels 85 108 145
mnemonic variable names 11 14 15 104 144
MOD function 49 53 91 128 130
modularity, internal 53 95 126
modularization 60
modularization, appropriate 24 62 63 77 95 150
modules, coupling between 28 62 95
monthly payment program 107
mouse in a maze program 69
Multi-way decision 37
Multiple errors 102
multiple exits from loop 48 108 150
named parameters 94
Namelist statement 94
Newton's method for square root 4
non-local variables 24 62
non-standard language features 6
null ELSE statement 18 45 47 125
|
|
|
Реклама |
|
|
|