WEBVTT

1
00:00:00.120 --> 00:00:03.680
<v Speaker 1>You know, you open a banking app and your balance

2
00:00:03.720 --> 00:00:06.879
<v Speaker 1>just appears instantly, or you stream a movie and the

3
00:00:06.960 --> 00:00:08.400
<v Speaker 1>video renders without a stutter.

4
00:00:08.679 --> 00:00:10.560
<v Speaker 2>Right, it basically feels like magic, It.

5
00:00:10.480 --> 00:00:14.720
<v Speaker 1>Really does, but it's actually driven by this invisible, ancient architecture.

6
00:00:14.919 --> 00:00:18.719
<v Speaker 1>An architecture built on rules so rigid that well, as

7
00:00:18.719 --> 00:00:22.039
<v Speaker 1>we found in today's source material, asking a computer for

8
00:00:22.079 --> 00:00:25.640
<v Speaker 1>the absolute value of a negative number can actually spit

9
00:00:25.719 --> 00:00:27.199
<v Speaker 1>out a negative result.

10
00:00:26.879 --> 00:00:28.719
<v Speaker 2>Which is pretty wild to think about.

11
00:00:29.000 --> 00:00:32.320
<v Speaker 1>Yeah, it completely breaks your brain at first. So welcome

12
00:00:32.359 --> 00:00:35.719
<v Speaker 1>to this deep dive. Today we are digging into excerpts

13
00:00:35.719 --> 00:00:40.079
<v Speaker 1>from the widely respected computer science textbook Algorithms, fourth Edition,

14
00:00:40.280 --> 00:00:44.000
<v Speaker 1>Part one by Robert Sedgrick and Kevin Wayne from Princeton University.

15
00:00:44.039 --> 00:00:46.479
<v Speaker 2>Then we should clarify our mission today isn't to, you know,

16
00:00:46.840 --> 00:00:48.439
<v Speaker 2>teach you how to code line by line?

17
00:00:48.600 --> 00:00:49.960
<v Speaker 1>No, definitely not right.

18
00:00:50.000 --> 00:00:52.799
<v Speaker 2>This is for you, the intellectually curious listener. We want

19
00:00:52.840 --> 00:00:55.960
<v Speaker 2>to extract the profound logic, the physical quirks, and the

20
00:00:56.000 --> 00:00:59.759
<v Speaker 2>elegant problem solving strategies that programmers use to build well

21
00:01:00.159 --> 00:01:01.880
<v Speaker 2>much everything in your digital life.

22
00:01:02.119 --> 00:01:05.879
<v Speaker 1>Exactly. We're treating this material not as some dry programming

23
00:01:05.920 --> 00:01:09.640
<v Speaker 1>manual but really as a philosophy of efficiency, because there

24
00:01:09.719 --> 00:01:14.840
<v Speaker 1>is a vast unseen gulf between just hacking together code

25
00:01:14.840 --> 00:01:19.239
<v Speaker 1>that technically runs and designing an elegant algorithm.

26
00:01:19.319 --> 00:01:22.319
<v Speaker 2>Yeah, that difference is what separates a process that takes

27
00:01:22.439 --> 00:01:25.000
<v Speaker 2>ten seconds from one that takes ten thousand years.

28
00:01:25.159 --> 00:01:28.760
<v Speaker 1>Literally, and we hear the word algorithm tossed around constantly,

29
00:01:28.840 --> 00:01:32.560
<v Speaker 1>right like the YouTube algorithm or stock trading algorithms.

30
00:01:32.120 --> 00:01:34.079
<v Speaker 2>Become a huge Silicon Valley buzzword.

31
00:01:34.239 --> 00:01:37.000
<v Speaker 1>It really has. But stripped of all that, the text

32
00:01:37.079 --> 00:01:40.879
<v Speaker 1>defines an algorithm as simply a finite, deterministic, and effective

33
00:01:40.879 --> 00:01:42.239
<v Speaker 1>method for solving a problem.

34
00:01:42.519 --> 00:01:46.519
<v Speaker 2>Right. Finite meaning it actually has an end, deterministic meaning

35
00:01:46.640 --> 00:01:50.400
<v Speaker 2>it behaves predictably every time, and effective meaning it actually

36
00:01:50.560 --> 00:01:52.439
<v Speaker 2>solves the thing you wanted to solve. It's just a

37
00:01:52.439 --> 00:01:53.519
<v Speaker 2>step by step procedure.

38
00:01:53.560 --> 00:01:55.079
<v Speaker 1>And what really stood out to me in the text

39
00:01:55.120 --> 00:01:57.840
<v Speaker 1>is that algorithms are not a modern invention at all.

40
00:01:57.879 --> 00:02:00.560
<v Speaker 1>They aren't born in the age of microchips, not at all.

41
00:02:00.719 --> 00:02:04.000
<v Speaker 2>The authors highlight Euclid's algorithm for finding the greatest common

42
00:02:04.040 --> 00:02:06.120
<v Speaker 2>divisor of two numbers, and that.

43
00:02:06.079 --> 00:02:09.159
<v Speaker 1>Was devised over two thousand, three hundred years ago.

44
00:02:09.240 --> 00:02:12.800
<v Speaker 2>Yeah, over two millennia before the first computer was even plugged.

45
00:02:12.439 --> 00:02:16.319
<v Speaker 1>In, just a guy in a toga writing algorithms. But

46
00:02:16.719 --> 00:02:19.560
<v Speaker 1>you know, applying that to our modern context brings up

47
00:02:19.560 --> 00:02:22.199
<v Speaker 1>a bit of skepticism for me. Also, well, we have

48
00:02:22.280 --> 00:02:24.599
<v Speaker 1>phones in our pockets with more computing power than the

49
00:02:24.599 --> 00:02:28.639
<v Speaker 1>apall emissions. Right, So if my program is running slow today,

50
00:02:29.159 --> 00:02:31.919
<v Speaker 1>I have to wonder why we obsess so much over

51
00:02:32.000 --> 00:02:36.800
<v Speaker 1>algorithmic efficiency, Like why not just buy a faster processor.

52
00:02:37.199 --> 00:02:40.080
<v Speaker 2>Yeah, throwing hardware at a software problem is a really

53
00:02:40.080 --> 00:02:44.159
<v Speaker 2>common instinct, but it completely breaks down when you hit

54
00:02:44.199 --> 00:02:47.439
<v Speaker 2>the reality of big data. Okay, the text asserts that

55
00:02:47.479 --> 00:02:50.439
<v Speaker 2>a well designed algorithm can make a program millions of

56
00:02:50.479 --> 00:02:54.759
<v Speaker 2>times faster. Millions, Right, Buying new hardware might speed you're

57
00:02:54.800 --> 00:02:57.879
<v Speaker 2>processing up by say a factor of ten, or if

58
00:02:57.879 --> 00:03:00.759
<v Speaker 2>you buy a massive supercomputer, maybe a factor of one.

59
00:03:00.680 --> 00:03:02.439
<v Speaker 1>Hundred, So a factor of one hundred versus a factor

60
00:03:02.479 --> 00:03:02.919
<v Speaker 1>of a million.

61
00:03:03.039 --> 00:03:03.439
<v Speaker 2>Exactly.

62
00:03:03.479 --> 00:03:05.560
<v Speaker 1>To really visualize how that scales, we can look at

63
00:03:05.599 --> 00:03:09.319
<v Speaker 1>the book's credit card whitelist scenario. I loved this exam

64
00:03:09.439 --> 00:03:11.919
<v Speaker 1>it's a great one. So imagine you're a credit card

65
00:03:11.919 --> 00:03:16.319
<v Speaker 1>company and you have a database of one million valid

66
00:03:16.560 --> 00:03:19.719
<v Speaker 1>customer account numbers. That's your white list. Okay, On a

67
00:03:19.759 --> 00:03:24.159
<v Speaker 1>busy day, you need to process ten million incoming transactions,

68
00:03:24.719 --> 00:03:28.479
<v Speaker 1>and for every single transaction, the computer has to verify

69
00:03:28.599 --> 00:03:31.800
<v Speaker 1>if that specific account number exists on the one million

70
00:03:31.879 --> 00:03:33.360
<v Speaker 1>number whitelist, right.

71
00:03:33.360 --> 00:03:36.159
<v Speaker 2>And if you approach that using what programmers call a

72
00:03:36.240 --> 00:03:38.919
<v Speaker 2>brute force algorithm, it's a nightmare.

73
00:03:39.080 --> 00:03:40.919
<v Speaker 1>How does the brute force way work?

74
00:03:41.000 --> 00:03:43.520
<v Speaker 2>Well, you take the first of those ten million transactions

75
00:03:43.719 --> 00:03:45.759
<v Speaker 2>and you compare it to the first number on your whitelist,

76
00:03:46.120 --> 00:03:47.560
<v Speaker 2>then the second number, then the.

77
00:03:47.520 --> 00:03:51.680
<v Speaker 1>Third, just checking every single card in a massive unsorted pile,

78
00:03:52.199 --> 00:03:53.680
<v Speaker 1>one by one exactly.

79
00:03:53.719 --> 00:03:55.960
<v Speaker 2>You might have to check hundreds of thousands of records

80
00:03:56.240 --> 00:03:58.159
<v Speaker 2>just to verify one single transaction.

81
00:03:58.280 --> 00:04:00.240
<v Speaker 1>I actually ran the math on this while reading. If

82
00:04:00.240 --> 00:04:02.960
<v Speaker 1>you do that route force search for ten million transactions,

83
00:04:03.159 --> 00:04:06.680
<v Speaker 1>your computer is performing up to ten trillion operations.

84
00:04:06.800 --> 00:04:07.520
<v Speaker 2>Ten trillion.

85
00:04:07.639 --> 00:04:10.400
<v Speaker 1>Yeah, even a modern processor is going to absolutely choke

86
00:04:10.479 --> 00:04:13.560
<v Speaker 1>on ten trillion operations just to clear a day's worth

87
00:04:13.560 --> 00:04:15.280
<v Speaker 1>of coffee purchases, Which is.

88
00:04:15.240 --> 00:04:19.120
<v Speaker 2>Why the text introduces the concept of binary search. Now,

89
00:04:19.160 --> 00:04:22.399
<v Speaker 2>this requires the underlying data to be perfectly sorted in

90
00:04:22.480 --> 00:04:23.319
<v Speaker 2>numerical order.

91
00:04:23.439 --> 00:04:26.199
<v Speaker 1>First, right, keeping the pile perfectly sorted.

92
00:04:26.360 --> 00:04:29.639
<v Speaker 2>Yes, So when a new transaction comes in, instead of

93
00:04:29.680 --> 00:04:32.399
<v Speaker 2>starting at the very beginning of the white list, the

94
00:04:32.439 --> 00:04:36.160
<v Speaker 2>algorithm jumps straight to the exact middle of that sortid

95
00:04:36.160 --> 00:04:37.160
<v Speaker 2>million record list.

96
00:04:37.319 --> 00:04:39.879
<v Speaker 1>And since it's sorted, it just asks, is the transaction

97
00:04:40.000 --> 00:04:42.480
<v Speaker 1>number larger or smaller than this middle number?

98
00:04:42.639 --> 00:04:46.319
<v Speaker 2>Exactly if it's smaller, you know, for a mathematical fact,

99
00:04:46.319 --> 00:04:48.000
<v Speaker 2>it has to be in the first half of the data.

100
00:04:48.040 --> 00:04:50.920
<v Speaker 1>So you instantly throw away five hundred thousand records.

101
00:04:51.000 --> 00:04:54.360
<v Speaker 2>You just have the problem in one single stepw Then

102
00:04:54.399 --> 00:04:56.279
<v Speaker 2>you jump to the middle of the remaining half, and

103
00:04:56.319 --> 00:04:59.199
<v Speaker 2>you repeat the process. You keep dividing the data in half.

104
00:04:59.720 --> 00:05:02.160
<v Speaker 2>So so what used to take hundreds of thousands of

105
00:05:02.240 --> 00:05:05.199
<v Speaker 2>linear checks now takes about twenty steps.

106
00:05:05.480 --> 00:05:08.920
<v Speaker 1>That is insane. Doing twenty steps for those ten million

107
00:05:08.959 --> 00:05:12.240
<v Speaker 1>transactions means you only do two hundred million operations in total.

108
00:05:12.680 --> 00:05:15.600
<v Speaker 1>We went from ten trillion operations down to two hundred

109
00:05:15.639 --> 00:05:19.399
<v Speaker 1>million just by organizing the data and changing the search strategy.

110
00:05:19.680 --> 00:05:22.160
<v Speaker 1>You didn't buy a faster computer at all. You just

111
00:05:22.279 --> 00:05:23.720
<v Speaker 1>used an elegant algorithm.

112
00:05:23.920 --> 00:05:27.199
<v Speaker 2>And that is really the philosophical core of computer science.

113
00:05:27.279 --> 00:05:30.879
<v Speaker 1>It's fascinating, but to execute that twenty step binary search

114
00:05:30.920 --> 00:05:33.600
<v Speaker 1>at lightning speed. The computer has to build it out

115
00:05:33.600 --> 00:05:35.439
<v Speaker 1>of raw materials right right.

116
00:05:35.839 --> 00:05:39.040
<v Speaker 2>In Java and a lot of other programming languages, the

117
00:05:39.319 --> 00:05:43.079
<v Speaker 2>absolute bedrock is what we call primitive data types.

118
00:05:42.920 --> 00:05:45.040
<v Speaker 1>The basic atoms of the language.

119
00:05:44.600 --> 00:05:49.160
<v Speaker 2>Exactly your standard integers, real numbers, boollions, characters. And what

120
00:05:49.199 --> 00:05:51.199
<v Speaker 2>the text points out is that because these primitives are

121
00:05:51.240 --> 00:05:54.879
<v Speaker 2>so closely tied to the physical hardware memory, they carry

122
00:05:54.920 --> 00:05:56.680
<v Speaker 2>some pretty dangerous limitations.

123
00:05:56.759 --> 00:05:59.680
<v Speaker 1>Oh yeah, they are deeply bound by the physical laws

124
00:05:59.680 --> 00:06:01.959
<v Speaker 1>inside the machine. You see this right away in the

125
00:06:01.959 --> 00:06:04.759
<v Speaker 1>textbook's Q and A section regarding how arrays work.

126
00:06:04.959 --> 00:06:06.000
<v Speaker 2>The zero index thing.

127
00:06:06.199 --> 00:06:08.959
<v Speaker 1>Yes, an array is just the sequence of these primitive

128
00:06:09.040 --> 00:06:12.920
<v Speaker 1>value stored together, and programmers famously do not start counting

129
00:06:12.959 --> 00:06:15.319
<v Speaker 1>an array at one. They start at zero. The first

130
00:06:15.319 --> 00:06:17.000
<v Speaker 1>item is at index zero.

131
00:06:17.079 --> 00:06:19.720
<v Speaker 2>Which is entirely counterintuitive to human counting.

132
00:06:19.879 --> 00:06:21.759
<v Speaker 1>Right. If I have three apples, I don't call the

133
00:06:21.800 --> 00:06:22.959
<v Speaker 1>first one apple zero.

134
00:06:23.240 --> 00:06:25.680
<v Speaker 2>No, But it makes perfect sense to the hardware. You see,

135
00:06:25.720 --> 00:06:28.879
<v Speaker 2>in physical memory, an array is a contiguous block of space.

136
00:06:29.439 --> 00:06:32.079
<v Speaker 2>The index isn't actually a human tally at all. It

137
00:06:32.160 --> 00:06:34.879
<v Speaker 2>is a mathematical offset from the starting memory address of

138
00:06:34.920 --> 00:06:35.399
<v Speaker 2>that array.

139
00:06:35.680 --> 00:06:38.160
<v Speaker 1>Ah. Okay, So the first item has an offset of

140
00:06:38.279 --> 00:06:41.319
<v Speaker 1>zero because it sits exactly at the starting address.

141
00:06:41.040 --> 00:06:44.279
<v Speaker 2>Precisely, and the second item is offset by one memory slot.

142
00:06:44.560 --> 00:06:47.720
<v Speaker 2>It was designed that way historically to save the CPU

143
00:06:47.839 --> 00:06:50.720
<v Speaker 2>from having to do an extra subtraction step every single

144
00:06:50.800 --> 00:06:51.560
<v Speaker 2>time it looked.

145
00:06:51.399 --> 00:06:54.600
<v Speaker 1>Up a value, because ringing every last drop of efficiency

146
00:06:54.600 --> 00:06:56.120
<v Speaker 1>out of those old machines.

147
00:06:55.759 --> 00:07:01.120
<v Speaker 2>Was paramount exactly. But prioritizing hardware speed over human logic

148
00:07:01.680 --> 00:07:05.480
<v Speaker 2>creates these bizarre anomalies, which brings us to that math

149
00:07:05.519 --> 00:07:07.360
<v Speaker 2>dot abs function you mentioned in the intro.

150
00:07:07.519 --> 00:07:10.680
<v Speaker 1>This mind bending anomaly drove me crazy when I read it. Okay,

151
00:07:10.720 --> 00:07:13.240
<v Speaker 1>So if you ask Java to give you the absolute

152
00:07:13.319 --> 00:07:17.319
<v Speaker 1>value of negative two billion, one hundred forty seven million,

153
00:07:17.560 --> 00:07:20.399
<v Speaker 1>four hundred eighty three thousand, six hundred thirty eight, that's

154
00:07:20.399 --> 00:07:22.680
<v Speaker 1>a mouthful, it is. But if you put that into

155
00:07:22.680 --> 00:07:26.040
<v Speaker 1>the math dot apps function, it returns negative two billion,

156
00:07:26.319 --> 00:07:29.360
<v Speaker 1>one hundred forty seven million, four hundred eighty three thousand,

157
00:07:29.519 --> 00:07:30.360
<v Speaker 1>six hundred.

158
00:07:30.120 --> 00:07:31.639
<v Speaker 2>Forty eight, a negative answer.

159
00:07:31.800 --> 00:07:35.879
<v Speaker 1>Yes, a computer is essentially a giant calculator, spitting out

160
00:07:35.920 --> 00:07:39.839
<v Speaker 1>a strictly negative answer when explicitly asked for an absolute value,

161
00:07:40.240 --> 00:07:43.000
<v Speaker 1>feels like it's breaking its own fundamental laws.

162
00:07:43.079 --> 00:07:46.839
<v Speaker 2>It totally feels broken, but it perfectly illustrates something called

163
00:07:46.959 --> 00:07:48.240
<v Speaker 2>inser overflow.

164
00:07:48.399 --> 00:07:49.680
<v Speaker 1>Okay, break that down for me.

165
00:07:49.800 --> 00:07:53.600
<v Speaker 2>Well, primitive data types are not abstract mathematical concepts floating

166
00:07:53.600 --> 00:07:56.920
<v Speaker 2>out in the ether. They have strict physical memory limits.

167
00:07:57.560 --> 00:08:01.279
<v Speaker 2>A standard injure in Java gets exactly thirty two bits

168
00:08:01.319 --> 00:08:02.920
<v Speaker 2>of physical memory space.

169
00:08:03.160 --> 00:08:05.079
<v Speaker 1>So it's kind of like the physical dials on a

170
00:08:05.120 --> 00:08:05.920
<v Speaker 1>cars er doometer.

171
00:08:06.319 --> 00:08:07.800
<v Speaker 2>That's a really good way to think about it.

172
00:08:07.839 --> 00:08:10.639
<v Speaker 1>If the odomeinter only has six physical dials, it can

173
00:08:10.680 --> 00:08:13.920
<v Speaker 1>only roll up to nine hundred ninety nine thousand, nine

174
00:08:14.000 --> 00:08:16.560
<v Speaker 1>hundred and ninety nine, and then it runs out of

175
00:08:16.560 --> 00:08:19.199
<v Speaker 1>space and clicks back over to all zeros.

176
00:08:19.560 --> 00:08:22.720
<v Speaker 2>Right, and the binary architecture works similarly. A thirty two

177
00:08:22.759 --> 00:08:26.360
<v Speaker 2>bit integer has a maximum positive limit of two billion,

178
00:08:26.720 --> 00:08:29.519
<v Speaker 2>one hundred and forty seven million, four hundred eighty three thousand,

179
00:08:29.600 --> 00:08:33.120
<v Speaker 2>six hundred forty seven Okay, But because of how the

180
00:08:33.120 --> 00:08:37.519
<v Speaker 2>computer represents negative numbers in binary using a system called

181
00:08:37.600 --> 00:08:41.360
<v Speaker 2>two's complement, the absolute lowest negative number it can hold

182
00:08:41.440 --> 00:08:44.960
<v Speaker 2>is one unit larger. It's negative two billion, one hundred

183
00:08:45.000 --> 00:08:47.440
<v Speaker 2>and forty seven million, four hundred and eighty three thousand,

184
00:08:47.480 --> 00:08:48.399
<v Speaker 2>six hundred and forty eight.

185
00:08:48.440 --> 00:08:51.120
<v Speaker 1>Wait, so it can hold one more negative number than

186
00:08:51.120 --> 00:08:52.480
<v Speaker 1>it can positive numbers.

187
00:08:52.559 --> 00:08:55.480
<v Speaker 2>Yes, because the zero takes up one of the positive

188
00:08:55.519 --> 00:08:56.759
<v Speaker 2>slots in the binary structure.

189
00:08:56.799 --> 00:08:57.559
<v Speaker 1>Oh, that makes sense.

190
00:08:57.639 --> 00:09:00.399
<v Speaker 2>So here's the key. Would you try to find the

191
00:09:00.519 --> 00:09:04.519
<v Speaker 2>absolute positive value of the absolute bottom floor number. The

192
00:09:04.559 --> 00:09:07.919
<v Speaker 2>resulting positive number is one unit larger than the thirty

193
00:09:07.960 --> 00:09:09.759
<v Speaker 2>two bit limit can physically hold.

194
00:09:09.879 --> 00:09:12.000
<v Speaker 1>So the memory overflows exactly.

195
00:09:12.240 --> 00:09:15.240
<v Speaker 2>It rolls past the maximum positive limit and clicks right

196
00:09:15.279 --> 00:09:18.600
<v Speaker 2>back over into the extreme negative numbers, just like your odometer.

197
00:09:18.919 --> 00:09:22.240
<v Speaker 1>That is wild. But the natural question here is why

198
00:09:22.240 --> 00:09:25.960
<v Speaker 1>doesn't the programming language automatically catch that? I mean, we

199
00:09:26.000 --> 00:09:29.159
<v Speaker 1>assume software should warn us if our math just broke

200
00:09:29.240 --> 00:09:31.159
<v Speaker 1>the laws of physics inside the computer.

201
00:09:31.639 --> 00:09:34.320
<v Speaker 2>Well, the designers made a very conscious choice there, speed

202
00:09:34.399 --> 00:09:35.039
<v Speaker 2>over safety.

203
00:09:35.200 --> 00:09:36.279
<v Speaker 1>Really yeah.

204
00:09:36.559 --> 00:09:38.440
<v Speaker 2>The authors point out that if the computer had to

205
00:09:38.480 --> 00:09:42.399
<v Speaker 2>run a secondary check on every single edition subtraction and

206
00:09:42.519 --> 00:09:46.559
<v Speaker 2>multiplication to ensure it didn't overflow, programs would slow to

207
00:09:46.639 --> 00:09:48.120
<v Speaker 2>an absolute.

208
00:09:47.559 --> 00:09:50.960
<v Speaker 1>Crawl, So they just leave the responsibility entirely on the programmer.

209
00:09:51.039 --> 00:09:53.440
<v Speaker 2>Pretty much, a little knowledge goes a long way. The

210
00:09:53.480 --> 00:09:55.720
<v Speaker 2>program just has to use larger data types like a

211
00:09:55.799 --> 00:09:58.960
<v Speaker 2>sixty four bit long integer if they anticipate working with

212
00:09:59.080 --> 00:10:00.000
<v Speaker 2>numbers in the billions.

213
00:10:00.279 --> 00:10:03.519
<v Speaker 1>So speed is king, even if it means silently returning

214
00:10:03.519 --> 00:10:07.000
<v Speaker 1>a mathematically impossible answer. It kind of makes you realize

215
00:10:07.000 --> 00:10:10.639
<v Speaker 1>that naked thirty two bit integers are way too risky

216
00:10:10.679 --> 00:10:14.960
<v Speaker 1>and rigid for modeling complex real world systems. Oh absolutely,

217
00:10:15.039 --> 00:10:17.159
<v Speaker 1>I mean, if we're building software for a bank account

218
00:10:17.279 --> 00:10:19.440
<v Speaker 1>or an election system, we need a higher level of

219
00:10:19.440 --> 00:10:24.000
<v Speaker 1>thinking than just passing around primitive numbers that might secretly overflow, which.

220
00:10:23.799 --> 00:10:27.639
<v Speaker 2>Brings us directly to the architectural solution, which is data

221
00:10:27.639 --> 00:10:32.159
<v Speaker 2>abstraction and object oriented programming or oop right.

222
00:10:32.120 --> 00:10:33.759
<v Speaker 1>Object oriented programming.

223
00:10:34.000 --> 00:10:37.600
<v Speaker 2>Basically, we stop treating the computer like a naive calculator

224
00:10:38.080 --> 00:10:40.799
<v Speaker 2>and we start teaching it how to model reality. We

225
00:10:40.879 --> 00:10:43.519
<v Speaker 2>use data abstraction to create abstract data.

226
00:10:43.240 --> 00:10:45.919
<v Speaker 1>Types, and we define an object exactly.

227
00:10:45.519 --> 00:10:50.440
<v Speaker 2>In the text notes. An object has three distinct properties, state, identity,

228
00:10:50.679 --> 00:10:51.320
<v Speaker 2>and behavior.

229
00:10:51.600 --> 00:10:53.799
<v Speaker 1>Let's try to ground this with a real world metaphor,

230
00:10:53.799 --> 00:10:56.559
<v Speaker 1>because it gets pretty abstract. Sure, if a primitive integer

231
00:10:56.639 --> 00:10:59.720
<v Speaker 1>is just like the role ingredients of a cake flour

232
00:10:59.799 --> 00:11:02.720
<v Speaker 1>and sugar, an object is the fully baked.

233
00:11:02.480 --> 00:11:05.480
<v Speaker 2>Cake, or to use a mechanical metaphor, if the primitive

234
00:11:05.519 --> 00:11:09.080
<v Speaker 2>data is just a loose exposed AA battery, an object

235
00:11:09.120 --> 00:11:10.279
<v Speaker 2>is a digital stopwatch.

236
00:11:10.559 --> 00:11:12.799
<v Speaker 1>Oh I like that. So the battery the raw data

237
00:11:12.879 --> 00:11:15.639
<v Speaker 1>is locked inside. Its state is whatever time is currently

238
00:11:15.639 --> 00:11:16.840
<v Speaker 1>displayed on the screen right.

239
00:11:17.159 --> 00:11:20.759
<v Speaker 2>Its identity is the literal physical stopwatch sitting in your hand,

240
00:11:21.080 --> 00:11:24.919
<v Speaker 2>and its behavior represents the buttons on the outside start stop, reset.

241
00:11:25.080 --> 00:11:27.679
<v Speaker 1>So the abstract data type, or the API as programmers

242
00:11:27.720 --> 00:11:29.919
<v Speaker 1>call it, is basically the instruction manual or the menu.

243
00:11:30.279 --> 00:11:33.720
<v Speaker 2>Yes, the API tells you exactly what the stopwatch does

244
00:11:33.759 --> 00:11:36.639
<v Speaker 2>and which buttons to push, without requiring you to know

245
00:11:36.720 --> 00:11:39.480
<v Speaker 2>how the battery connects to the circuit board inside.

246
00:11:39.600 --> 00:11:41.600
<v Speaker 1>You don't need to know the recipe. You can't touch

247
00:11:41.639 --> 00:11:43.720
<v Speaker 1>the battery directly at all. You can only interact with

248
00:11:43.799 --> 00:11:44.879
<v Speaker 1>the buttons, and.

249
00:11:44.799 --> 00:11:47.919
<v Speaker 2>The text has a very specific term for locking that

250
00:11:47.960 --> 00:11:50.279
<v Speaker 2>battery away, encapsulation.

251
00:11:50.480 --> 00:11:51.200
<v Speaker 1>Encapsulation.

252
00:11:51.440 --> 00:11:55.519
<v Speaker 2>It is the defensive wall of modern programming. It means

253
00:11:55.679 --> 00:11:59.240
<v Speaker 2>hiding the internal representation of data from the client code

254
00:11:59.240 --> 00:12:02.279
<v Speaker 2>that is using it. You force the outside world to

255
00:12:02.320 --> 00:12:06.039
<v Speaker 2>interact with the object only through approved behaviors, and.

256
00:12:06.000 --> 00:12:09.639
<v Speaker 1>The text cites this incredible historical example to illustrate what

257
00:12:09.720 --> 00:12:13.039
<v Speaker 1>happens when you fail to build that defensive wall. It

258
00:12:13.080 --> 00:12:15.639
<v Speaker 1>was during the two thousand US presidential election.

259
00:12:15.480 --> 00:12:16.840
<v Speaker 2>Right in Vallujah County, Florida.

260
00:12:16.960 --> 00:12:21.200
<v Speaker 1>Yeah, an electronic voting machine registered negative sixteen twenty two

261
00:12:21.279 --> 00:12:22.279
<v Speaker 1>votes for Al Gore.

262
00:12:22.679 --> 00:12:25.840
<v Speaker 2>Now completely regardless of the politics here, we are just

263
00:12:25.879 --> 00:12:28.919
<v Speaker 2>looking at this from a pure software architecture standpoint.

264
00:12:29.000 --> 00:12:31.759
<v Speaker 1>Exactly, how does a tally mathematically count backward?

265
00:12:32.000 --> 00:12:36.399
<v Speaker 2>It is the ultimate example of failed encapsulation. If you

266
00:12:36.480 --> 00:12:40.200
<v Speaker 2>think about a counter object for an election, A properly

267
00:12:40.360 --> 00:12:43.840
<v Speaker 2>architected voting counter should have only one approved behavior, right,

268
00:12:43.960 --> 00:12:46.120
<v Speaker 2>an increment button that adds exactly one vote.

269
00:12:46.159 --> 00:12:48.679
<v Speaker 1>It can only go up. But if the programmer simply

270
00:12:48.759 --> 00:12:51.639
<v Speaker 1>used a primitive integer to store the votes and left

271
00:12:51.679 --> 00:12:55.600
<v Speaker 1>it completely exposed. If they left the AA battery sitting

272
00:12:55.639 --> 00:12:58.759
<v Speaker 1>out on the table instead of locking it in the stopwatch, then.

273
00:12:58.639 --> 00:13:02.159
<v Speaker 2>Any outside glitch, memory corruption, or even a malicious actor

274
00:13:02.200 --> 00:13:05.879
<v Speaker 2>could bypass the increment logic entirely. They could reach directly

275
00:13:05.919 --> 00:13:08.480
<v Speaker 2>into the raw data and overwrite the tally with the

276
00:13:08.519 --> 00:13:09.240
<v Speaker 2>negative number.

277
00:13:09.399 --> 00:13:09.919
<v Speaker 1>Wow.

278
00:13:10.200 --> 00:13:13.919
<v Speaker 2>Proper encapsulation ensures that the internal integer is heavily guarded

279
00:13:13.919 --> 00:13:17.120
<v Speaker 2>as a private variable. The data maintains its integrity because

280
00:13:17.120 --> 00:13:19.159
<v Speaker 2>the only way to alter it is through the heavily

281
00:13:19.200 --> 00:13:20.440
<v Speaker 2>restricted public methods.

282
00:13:20.559 --> 00:13:23.360
<v Speaker 1>Okay, so encapsulation builds this vault around our data. That

283
00:13:23.399 --> 00:13:26.000
<v Speaker 1>makes sense, But reading further, I realize that creates a

284
00:13:26.000 --> 00:13:27.080
<v Speaker 1>whole new vulnerability.

285
00:13:27.200 --> 00:13:27.480
<v Speaker 2>Also.

286
00:13:27.840 --> 00:13:30.600
<v Speaker 1>Well, if you have a massive software program and multiple

287
00:13:30.600 --> 00:13:32.720
<v Speaker 1>different parts of the system need access to that vault,

288
00:13:33.320 --> 00:13:35.919
<v Speaker 1>how does the computer keep track of who holds the key?

289
00:13:36.360 --> 00:13:39.919
<v Speaker 2>Ah? Yes, that requires a big mental shift in how

290
00:13:40.000 --> 00:13:43.600
<v Speaker 2>we understand variables and memory. There is a fundamental difference

291
00:13:43.600 --> 00:13:47.279
<v Speaker 2>between passing a primitive value and passing an object. If

292
00:13:47.279 --> 00:13:49.440
<v Speaker 2>you have a primitive integer variable let's call it A,

293
00:13:49.960 --> 00:13:52.679
<v Speaker 2>and you set it to five, then you assign variable

294
00:13:52.720 --> 00:13:56.240
<v Speaker 2>B to equal A, the computer physically cars out new

295
00:13:56.240 --> 00:13:59.480
<v Speaker 2>memory and makes a brand new, independent copy of the

296
00:13:59.559 --> 00:14:00.000
<v Speaker 2>number five.

297
00:14:00.320 --> 00:14:03.000
<v Speaker 1>They are completely isolated from each other, exactly.

298
00:14:03.399 --> 00:14:05.559
<v Speaker 2>Changing B to ten has zero effect on A.

299
00:14:05.720 --> 00:14:07.759
<v Speaker 1>But with objects, it doesn't work that way.

300
00:14:08.039 --> 00:14:10.759
<v Speaker 2>No, it does not. If you assign object A to

301
00:14:10.840 --> 00:14:13.840
<v Speaker 2>object B, the computer does not copy the stopwatch.

302
00:14:13.919 --> 00:14:15.519
<v Speaker 1>It doesn't copy the object itself.

303
00:14:15.759 --> 00:14:19.919
<v Speaker 2>Right with objects, variables do not store the physical object itself.

304
00:14:20.320 --> 00:14:23.759
<v Speaker 2>They store a reference to the object a memory address. Okay,

305
00:14:23.840 --> 00:14:26.360
<v Speaker 2>so if you find variable A to variable B, you're

306
00:14:26.399 --> 00:14:29.720
<v Speaker 2>literally just copying the address. Both A and B are

307
00:14:29.759 --> 00:14:32.639
<v Speaker 2>now pointing to the exact same object in the computer's memory.

308
00:14:33.360 --> 00:14:34.480
<v Speaker 2>The text refers to this.

309
00:14:34.399 --> 00:14:37.480
<v Speaker 1>As aliasing aliasing, So it's kind of like giving two

310
00:14:37.559 --> 00:14:40.279
<v Speaker 1>different people remote controls to the exact same television.

311
00:14:40.360 --> 00:14:41.559
<v Speaker 2>That is a perfect analogy.

312
00:14:41.759 --> 00:14:44.960
<v Speaker 1>If person A uses their remote to change the channel,

313
00:14:45.320 --> 00:14:48.559
<v Speaker 1>person B is suddenly watching a different show, even if

314
00:14:48.559 --> 00:14:50.320
<v Speaker 1>they didn't touch their own remote at all.

315
00:14:50.519 --> 00:14:53.600
<v Speaker 2>And in large scale software development, that is a total

316
00:14:53.720 --> 00:14:54.600
<v Speaker 2>nightmare scenario.

317
00:14:54.759 --> 00:14:56.159
<v Speaker 1>I can imagine you might have.

318
00:14:56.039 --> 00:14:59.279
<v Speaker 2>One developer working on a module that uses a specific

319
00:14:59.320 --> 00:15:03.360
<v Speaker 2>data object, assuming they have a safe, independent copy, so

320
00:15:03.440 --> 00:15:05.919
<v Speaker 2>they tweak the data for their specific.

321
00:15:05.440 --> 00:15:09.039
<v Speaker 1>Feature, unknowingly changing the channel on a totally different developers

322
00:15:09.120 --> 00:15:12.320
<v Speaker 1>module across the system because they were both holding references

323
00:15:12.320 --> 00:15:13.679
<v Speaker 1>to the same memory address.

324
00:15:13.759 --> 00:15:18.240
<v Speaker 2>It is a massive source of subtle cascading bugs. Understanding

325
00:15:18.279 --> 00:15:21.759
<v Speaker 2>aliasing is really crucial for programmers, and it also brings

326
00:15:21.799 --> 00:15:23.600
<v Speaker 2>up the issue of memory management.

327
00:15:23.799 --> 00:15:27.080
<v Speaker 1>Right because what happens when a variable is reassigned to

328
00:15:27.080 --> 00:15:29.759
<v Speaker 1>something else and an object is left with no references

329
00:15:29.799 --> 00:15:30.759
<v Speaker 1>pointing to it at all.

330
00:15:31.200 --> 00:15:35.080
<v Speaker 2>Exactly, say we throw away both TV remotes. The TV

331
00:15:35.240 --> 00:15:37.360
<v Speaker 2>is still sitting there, taking up physical space in the

332
00:15:37.399 --> 00:15:40.080
<v Speaker 2>living room, but nobody can ever interact with it again.

333
00:15:40.320 --> 00:15:42.519
<v Speaker 1>The text calls this an orphaned object.

334
00:15:42.919 --> 00:15:46.799
<v Speaker 2>Yes, and in older programming languages like C or C

335
00:15:46.919 --> 00:15:50.000
<v Speaker 2>plus plus, the human developer actually had to write manual

336
00:15:50.039 --> 00:15:53.799
<v Speaker 2>code to go find that abandoned TV and throw it

337
00:15:53.840 --> 00:15:54.399
<v Speaker 2>in the dumpster.

338
00:15:54.600 --> 00:15:58.399
<v Speaker 1>And knowing human fallibility, developers probably constantly forgot to write

339
00:15:58.399 --> 00:15:59.519
<v Speaker 1>the cleanup code all.

340
00:15:59.440 --> 00:16:03.039
<v Speaker 2>The time, those orphaned objects would sit in the RAM indefinitely,

341
00:16:04.799 --> 00:16:07.480
<v Speaker 2>and this cause what we call memory leaks, where a

342
00:16:07.480 --> 00:16:11.159
<v Speaker 2>program running for several days would slowly consume all the

343
00:16:11.159 --> 00:16:14.320
<v Speaker 2>computer's available memory until the entire system.

344
00:16:14.039 --> 00:16:17.159
<v Speaker 1>Just crashed, or I guess they would accidentally delete memory

345
00:16:17.200 --> 00:16:20.080
<v Speaker 1>that another part of the program is still actively using.

346
00:16:19.879 --> 00:16:22.120
<v Speaker 2>Which causes an immediate catastrophic failure.

347
00:16:22.200 --> 00:16:25.080
<v Speaker 1>Yeah, so I'm assuming modern Java doesn't trust humans to

348
00:16:25.120 --> 00:16:26.080
<v Speaker 1>handle this anymore.

349
00:16:26.159 --> 00:16:29.879
<v Speaker 2>It definitely does not. Java introduced an automated system called

350
00:16:29.960 --> 00:16:30.799
<v Speaker 2>garbage collection.

351
00:16:31.000 --> 00:16:32.559
<v Speaker 1>Garbage collection, Yeah.

352
00:16:32.360 --> 00:16:35.759
<v Speaker 2>It acts as this invisible, highly efficient custodian running in

353
00:16:35.799 --> 00:16:40.440
<v Speaker 2>the background. It essentially traces the active reference trees starting

354
00:16:40.440 --> 00:16:43.080
<v Speaker 2>from the core roots of the running program. It follows

355
00:16:43.159 --> 00:16:45.840
<v Speaker 2>every active reference to see which objects are still.

356
00:16:45.639 --> 00:16:48.240
<v Speaker 1>Reachable, like tracing the wiring in a house to see

357
00:16:48.240 --> 00:16:51.200
<v Speaker 1>which outlets are actually connected to the breaker box exactly.

358
00:16:51.480 --> 00:16:54.360
<v Speaker 2>Any object that cannot be reached by tracing those active

359
00:16:54.360 --> 00:16:58.759
<v Speaker 2>wires is deemed an orphan. The garbage collector then performs

360
00:16:58.799 --> 00:17:02.240
<v Speaker 2>a sweep automatic reclaiming the memory space used by those

361
00:17:02.399 --> 00:17:04.880
<v Speaker 2>orphans and recycling it back into the system.

362
00:17:04.599 --> 00:17:07.079
<v Speaker 1>Pool, so the programmer never has to write a single

363
00:17:07.160 --> 00:17:08.720
<v Speaker 1>line of memory management code.

364
00:17:08.799 --> 00:17:09.160
<v Speaker 2>None.

365
00:17:09.440 --> 00:17:12.920
<v Speaker 1>That invisible automation is incredible for preventing memory leaks. But

366
00:17:13.000 --> 00:17:15.839
<v Speaker 1>you know, we still haven't solved the remote control problem. Sure,

367
00:17:16.079 --> 00:17:18.960
<v Speaker 1>garbage collection cleans up the abandoned TVs, but as long

368
00:17:19.000 --> 00:17:21.839
<v Speaker 1>as a TV is active, aliasing means multiple remotes can

369
00:17:21.880 --> 00:17:25.000
<v Speaker 1>still secretly change its channel. Is there a way to

370
00:17:25.000 --> 00:17:27.319
<v Speaker 1>build data that just never changes so we don't have

371
00:17:27.359 --> 00:17:29.279
<v Speaker 1>to stress about who holds a reference to it.

372
00:17:29.440 --> 00:17:34.240
<v Speaker 2>Yes. The architectural solution to aliasing is immutability. Immutability and

373
00:17:34.319 --> 00:17:36.960
<v Speaker 2>immutable data type is designed so that once the object

374
00:17:37.000 --> 00:17:41.000
<v Speaker 2>is constructed in memory, its value can never ever be altered.

375
00:17:41.480 --> 00:17:44.880
<v Speaker 2>In Java, a string of text is immutable, a date

376
00:17:44.920 --> 00:17:46.039
<v Speaker 2>object is immutable.

377
00:17:46.319 --> 00:17:47.880
<v Speaker 1>Wait. I have to push back on this a bit

378
00:17:47.960 --> 00:17:51.880
<v Speaker 1>because it sounds horrifyingly inefficient for a system that's supposed

379
00:17:51.920 --> 00:17:55.599
<v Speaker 1>to be obsessed with speed. How so, well, if I

380
00:17:55.680 --> 00:17:58.599
<v Speaker 1>have an immutable date object set to Tuesday and I

381
00:17:58.680 --> 00:18:01.440
<v Speaker 1>simply want to update it to way Wednesday, you're telling

382
00:18:01.519 --> 00:18:04.200
<v Speaker 1>me I can't just change the day. The computer has

383
00:18:04.240 --> 00:18:07.799
<v Speaker 1>to completely destroy the Tuesday object and build an entirely

384
00:18:07.880 --> 00:18:10.319
<v Speaker 1>new Wednesday object in a new memory address.

385
00:18:10.599 --> 00:18:14.799
<v Speaker 2>That is correct. Creating new objects constantly does incur performance cost,

386
00:18:15.880 --> 00:18:18.519
<v Speaker 2>and it triggers the garbage collector more frequently to clean

387
00:18:18.599 --> 00:18:19.759
<v Speaker 2>up the discarded Tuesday.

388
00:18:19.920 --> 00:18:22.599
<v Speaker 1>That seems like a massive waste of processing power just

389
00:18:22.640 --> 00:18:24.119
<v Speaker 1>to change one piece of data.

390
00:18:24.319 --> 00:18:27.319
<v Speaker 2>It is a deliberate trade off. Programmers realize that the

391
00:18:27.319 --> 00:18:31.559
<v Speaker 2>performance hit is entirely worth the architectural security. Immutable objects

392
00:18:31.559 --> 00:18:33.839
<v Speaker 2>are exponentially safer in complex.

393
00:18:33.480 --> 00:18:35.480
<v Speaker 1>Systems because they can't be changed.

394
00:18:35.200 --> 00:18:39.200
<v Speaker 2>Right, especially when dealing with concurrent programming where multiple threads

395
00:18:39.200 --> 00:18:40.440
<v Speaker 2>are running simultaneously.

396
00:18:40.720 --> 00:18:44.960
<v Speaker 1>Ah okay. Because if a date object is physically incapable

397
00:18:45.000 --> 00:18:48.319
<v Speaker 1>of changing, I don't care if fifty different modules have

398
00:18:48.440 --> 00:18:51.160
<v Speaker 1>alias references to it. I don't have to worry about

399
00:18:51.160 --> 00:18:54.160
<v Speaker 1>someone else's remote control changing my channel because the TV

400
00:18:54.359 --> 00:18:56.680
<v Speaker 1>is permanently locked to one station.

401
00:18:56.680 --> 00:18:59.319
<v Speaker 2>Exactly if they want to watch something else, they are

402
00:18:59.319 --> 00:19:00.720
<v Speaker 2>forced to go build their own TV.

403
00:19:00.960 --> 00:19:03.640
<v Speaker 1>That makes a lot of sense. You completely eliminate an

404
00:19:03.759 --> 00:19:06.200
<v Speaker 1>entire category of aliasing bugs.

405
00:19:06.279 --> 00:19:09.440
<v Speaker 2>You can confidently pass an immutable object across a massive

406
00:19:09.480 --> 00:19:13.680
<v Speaker 2>code base, knowing its integrity is absolute. And this philosophy,

407
00:19:14.119 --> 00:19:18.920
<v Speaker 2>choosing ironclad safety and predictability over raw, unchecked speed, it

408
00:19:18.960 --> 00:19:22.559
<v Speaker 2>extends to a broader engineering principle the author's emphasize, which

409
00:19:22.640 --> 00:19:25.480
<v Speaker 2>is fail fast programming and designed by contract.

410
00:19:25.759 --> 00:19:28.559
<v Speaker 1>Fail Fast is such an evocative term it kind of

411
00:19:28.599 --> 00:19:31.720
<v Speaker 1>implies that crashing is actually a desirable outcome in.

412
00:19:31.680 --> 00:19:34.920
<v Speaker 2>A well designed system. Crashing immediately is far preferable to

413
00:19:35.279 --> 00:19:39.200
<v Speaker 2>limping along with corrupted data. Programmers enforced contracts using what

414
00:19:39.200 --> 00:19:43.279
<v Speaker 2>they call assertions, assertions like a rule right. An assertion

415
00:19:43.440 --> 00:19:47.319
<v Speaker 2>is a hard mathematical rule embedded directly in the code.

416
00:19:47.400 --> 00:19:51.279
<v Speaker 2>For example, a programmer might assert that a specific calculation

417
00:19:51.480 --> 00:19:54.920
<v Speaker 2>used for an array index must never yield a negative number,

418
00:19:55.119 --> 00:19:55.559
<v Speaker 2>and if.

419
00:19:55.400 --> 00:19:58.759
<v Speaker 1>The system state shifts and that calculation suddenly produces a

420
00:19:58.799 --> 00:19:59.880
<v Speaker 1>negative number.

421
00:20:00.319 --> 00:20:04.279
<v Speaker 2>Immediately throws a fatal exception, the program intentionally stops dead

422
00:20:04.359 --> 00:20:07.759
<v Speaker 2>in its tracks the exact millisecond the assumption is violated.

423
00:20:07.960 --> 00:20:11.079
<v Speaker 1>Rather than secretly letting an integer overflow roll over into

424
00:20:11.079 --> 00:20:14.160
<v Speaker 1>the negatives or letting a voting machine count backward, it

425
00:20:14.319 --> 00:20:15.559
<v Speaker 1>just pulls the fire alarm.

426
00:20:15.759 --> 00:20:19.000
<v Speaker 2>Exactly because if you allow a small mathematical error to

427
00:20:19.039 --> 00:20:23.720
<v Speaker 2>slide silently, it becomes a corrupted input for the next calculation. Right,

428
00:20:23.960 --> 00:20:27.519
<v Speaker 2>it cascades through the system, mutating data until it causes

429
00:20:27.519 --> 00:20:31.200
<v Speaker 2>an unexplainable catastrophic failure a million operations later.

430
00:20:31.480 --> 00:20:34.079
<v Speaker 1>So by failing fast, the bug is isolated.

431
00:20:34.200 --> 00:20:37.039
<v Speaker 2>Yes, the program points to the exact line of code

432
00:20:37.319 --> 00:20:40.720
<v Speaker 2>and the exact millisecond it happened, making it incredibly easy

433
00:20:40.759 --> 00:20:41.759
<v Speaker 2>for the developer to fix.

434
00:20:42.039 --> 00:20:44.400
<v Speaker 1>Wow. Okay, let's step back for a second and just

435
00:20:44.480 --> 00:20:47.359
<v Speaker 1>look at the sheer scale of the architecture we've uncovered today.

436
00:20:47.359 --> 00:20:48.559
<v Speaker 2>It's a lot to take in.

437
00:20:48.720 --> 00:20:52.079
<v Speaker 1>It really is. We moved from twenty three hundred year

438
00:20:52.079 --> 00:20:56.000
<v Speaker 1>old Euclidean logic to the mathematical elegance of binary search,

439
00:20:56.480 --> 00:20:59.920
<v Speaker 1>proving that how we structure data is infinitely more powerful,

440
00:21:00.039 --> 00:21:02.920
<v Speaker 1>and just buying faster hardware. Right then we hit the

441
00:21:02.920 --> 00:21:06.319
<v Speaker 1>physical walls of thirty two bit integer limits, forcing us

442
00:21:06.359 --> 00:21:10.000
<v Speaker 1>to build protective vaults around our data. Using encapsulation, we

443
00:21:10.119 --> 00:21:13.920
<v Speaker 1>navigated the treacherous waters of aliasing and shared memory, we

444
00:21:14.000 --> 00:21:17.680
<v Speaker 1>met the invisible custodian of garbage collection, and ultimately we

445
00:21:17.759 --> 00:21:21.240
<v Speaker 1>found stability by trading raw speed for the rigid safety

446
00:21:21.279 --> 00:21:24.000
<v Speaker 1>of immutability and fail fast assertions.

447
00:21:24.240 --> 00:21:27.079
<v Speaker 2>It really requires a profound shift in perspective, doesn't it.

448
00:21:27.200 --> 00:21:29.559
<v Speaker 2>Moving from a mindset of just getting the machine to

449
00:21:29.599 --> 00:21:34.039
<v Speaker 2>calculate quickly to architecting systems that are reliable, maintainable, and

450
00:21:34.359 --> 00:21:35.960
<v Speaker 2>structurally sound under pressure.

451
00:21:36.039 --> 00:21:38.599
<v Speaker 1>It completely changes how you look at the smooth interface

452
00:21:38.640 --> 00:21:42.440
<v Speaker 1>of your banking app. The magic is just rigorous, unforgiving

453
00:21:42.480 --> 00:21:44.160
<v Speaker 1>logic executed beautifully.

454
00:21:44.359 --> 00:21:47.640
<v Speaker 2>And you know that rigorous logic offers a surprisingly relevant

455
00:21:47.680 --> 00:21:49.720
<v Speaker 2>framework for outside the digital world too.

456
00:21:49.799 --> 00:21:52.039
<v Speaker 1>Oh really, how so, we'll think.

457
00:21:51.880 --> 00:21:54.799
<v Speaker 2>About the principles of fail fast programming and designed by

458
00:21:54.880 --> 00:22:00.519
<v Speaker 2>contract in software. Silently ignoring a small error or broken

459
00:22:00.559 --> 00:22:04.960
<v Speaker 2>assumption invariably leads to a catastrophic system failure downstream.

460
00:22:05.240 --> 00:22:07.519
<v Speaker 1>Right the silent corruption cascades.

461
00:22:07.160 --> 00:22:11.319
<v Speaker 2>Exactly the healthiest system immediately flags an error the moment

462
00:22:11.359 --> 00:22:14.400
<v Speaker 2>of core assumption is broken consider how that applies to

463
00:22:14.480 --> 00:22:16.599
<v Speaker 2>human relationships and team dynamics.

464
00:22:16.680 --> 00:22:18.240
<v Speaker 1>Oh wow, I see where you're going with this.

465
00:22:18.519 --> 00:22:22.160
<v Speaker 2>Yeah, when a small miscommunication occurs or an implicit agreement

466
00:22:22.200 --> 00:22:25.960
<v Speaker 2>is violated, do we let it silently slide, allowing resentment

467
00:22:26.000 --> 00:22:28.960
<v Speaker 2>to cascade into a massive argument months down the line,

468
00:22:29.559 --> 00:22:30.640
<v Speaker 2>or do we fail fast?

469
00:22:30.759 --> 00:22:33.160
<v Speaker 1>That's a great point. Do we assert our boundaries and

470
00:22:33.200 --> 00:22:36.799
<v Speaker 1>address the broken assumption the exact moment it happens exactly?

471
00:22:37.119 --> 00:22:39.720
<v Speaker 2>Applying a little designed by contract to our own lives

472
00:22:39.960 --> 00:22:42.640
<v Speaker 2>might prevent a lot of catastrophic downstream crashes.

473
00:22:42.960 --> 00:22:46.240
<v Speaker 1>Architecting our relationships with the same rigorous clarity we use

474
00:22:46.279 --> 00:22:49.200
<v Speaker 1>to build our software. That is a brilliant framework to

475
00:22:49.240 --> 00:22:51.759
<v Speaker 1>walk away with. Thank you for joining us on this

476
00:22:51.799 --> 00:22:55.279
<v Speaker 1>deep dive into the invisible logic of our digital world.

477
00:22:55.440 --> 00:22:57.720
<v Speaker 1>We encourage you to look past the surface magic and

478
00:22:57.799 --> 00:23:00.319
<v Speaker 1>keep questioning the systems running quietly in the back ground.
