forked from psoberoi/stepanov-conversations-course
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlec01.txt
131 lines (115 loc) · 3.56 KB
/
lec01.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---------------
Lecture 1
Is programming a discipline?
- clearly there is a discipline called "computer science"
- is it the same as programming?
- there are several great computer scientists who never wrote code
- and there are good programmers who don't know computer science
- does Ken Thompson know type theory?
- does he follow research on complexity theory?
- common view: programming is not a discipline, just grunt work
Claim: programming is a discipline
- a wonderful, glorious discipline
- a view not commonly held or stated
- for example, Ken Thompson stated, "it's all solved. study newer emerging
fields instead"
- not just great programming; day-to-day programming is a discipline
Have other people held this view?
- Once upon a time, there people who held this view
- 1960-70
- Dijkstra: "The Humble Programmer"
- Nicklaus Wirth: "Alex, write the code yourself. Let your students write
papers."
Great books
- Wirth, Systematic Programming
- Wirth, Algorithms + Data Structures = Programs
- Dijkstra, Discipline of Programming
- Dijkstra, EWD
- Dahl, Dijkstra, Hoare, On Structured Programming
- Knuth, The Art of Computer Programming
Why classic books?
- Good taste
- Should aspire to them
Knuth
- Bible
- Starts with math for programmers - Discrete Mathematics
- Memory Management
- 2: Random number generation
- 2: Arithmetic algorithms
- 3: Sorting & Searching
- then... TeX, Metafont
- and... Literate Programming (web)
- Stanford Graph Base
- No programming language - MIX, MMIX
- Need to know computer architecture
- Hennessy & Patterson, Computer Architecture
- After Knuth: belief that the computer must be hidden
Computer Science
- Created out of Math and Electrical Engineering
- Europe: "Informatics"
- If a discipline has science after its name...
- 1965-68: departments founded by programmers
- No split between CS and programmers
- Knuth, at symposium on theoretical cs: All of you should write code during
your sabbatical. You should also consider writing code between your
sabbaticals...
Programmer?
- No, I'm an architect
- Programmer has become a disreputable title
- Earlier, "analyst"
- No! - We should be proud to be programmers
Profession
- Canon
- Ethics
- Mastery
ACM
- Used to be a professional organization for programmers
- Was hijacked by CS professors
- Used to publish code
- ACM Collection of Algorithms
- was taken over by numerical analysts
- We need a professional organization
- with journals
- Programmers often describe themselves as Artists - by which they mean they
don't have to follow any rules. That is bad for the field, and bad for them.
We need t be professional and "boring" like lawyers
What is Programming?
- What unites us?
- Doctors: "Health"
- Lawyers: "Justice"
- Us?
- Write lots of code?
- for digital computers?
- to solve problems
- modeling reality?
- map problem into bits
BITS! - 0s and 1s
- great discovery
- Leibniz
- Turing
- real-world problem -> mathematics -> bits
- manipulate the bits with code
- bits are hidden these days
- we use "objects"
- can't even get to bits on modern platforms
- portability?
- no, bits are the same everywhere
- c abstract machine
- sequence of bytes
We must study real machines
- individual brilliant people can make mistakes
- but eventually bad architectures die out
- market dynamics
- Intel reacts to customer demands
- we we must take it seriously
- Late 90s - x86 is dead, long live itanium
Programmer needs to know the whole stack
- problem
- math
- bits
- algorithms
- compilers
- processors
- it's wonderful!
---------------
Lecture 2