1
00:00:01,080 --> 00:00:03,440
Welcome to Happy Path 
Programming. 

2
00:00:03,760 --> 00:00:05,560
I'm Bruce Eckel. 
I'm James Ward. 

3
00:00:07,800 --> 00:00:09,560
All right. 
Welcome to Happy Path 

4
00:00:09,560 --> 00:00:13,240
Programming. 
We have some exciting news. 

5
00:00:13,240 --> 00:00:16,440
Yes, we do. 
We finished our effect oriented 

6
00:00:16,440 --> 00:00:20,520
programming book and so we have 
our co-author, Bill Frazier with

7
00:00:20,520 --> 00:00:21,520
us. 
Welcome, Bill. 

8
00:00:21,680 --> 00:00:25,760
Hello everybody, I will argue 
Bill is the lead author because 

9
00:00:25,760 --> 00:00:28,520
he's the one that dragged us 
through the whole process. 

10
00:00:28,520 --> 00:00:32,159
I probably would have given up. 
Yeah, beforehand, that's a good 

11
00:00:32,159 --> 00:00:34,520
point. 
It wasn't for he led the way and

12
00:00:34,520 --> 00:00:37,080
and you and I were in a 
supporting role. 

13
00:00:37,080 --> 00:00:40,000
We were and. 
Plus Bill used to work for 

14
00:00:40,000 --> 00:00:44,800
Ziberge, so. 
The company behind yes Zeo, the 

15
00:00:44,800 --> 00:00:47,760
technology that we used in the. 
Book deep in the middle of it. 

16
00:00:48,720 --> 00:00:49,280
Yeah, yeah. 
So. 

17
00:00:49,760 --> 00:00:53,040
So this is kind of like a 
celebration episode. 

18
00:00:53,080 --> 00:00:58,920
It's absolutely a completion. 
We are all feeling relief, yeah,

19
00:00:59,120 --> 00:01:02,320
to it's actually done. 
But not just relief that it's 

20
00:01:02,320 --> 00:01:04,840
done. 
Relief that when we pick up the 

21
00:01:04,840 --> 00:01:07,160
book, we feel pretty good about 
it. 

22
00:01:07,360 --> 00:01:10,240
Yes. 
Yeah, I've actually now read it 

23
00:01:10,240 --> 00:01:13,480
many times and it's pretty good.
It is. 

24
00:01:14,960 --> 00:01:18,440
It's good and quick to read. 
Yeah, it is. 

25
00:01:18,560 --> 00:01:20,520
Yeah. 
You have to dedicate, you know, 

26
00:01:20,680 --> 00:01:24,240
a month or two of your life. 
You can get through it in a 

27
00:01:24,360 --> 00:01:27,800
sufficiently determined day if 
you want. 

28
00:01:27,840 --> 00:01:29,680
On your phone, on your phone 
it's. 

29
00:01:29,680 --> 00:01:33,600
We put a lot of work into making
it phone friendly and so you can

30
00:01:33,600 --> 00:01:37,000
just sit on a bus and scroll 
through and. 

31
00:01:37,880 --> 00:01:40,920
You don't have have to go 
through phone gymnastics to look

32
00:01:40,920 --> 00:01:42,840
at the examples cuz we've kept 
them narrow. 

33
00:01:42,840 --> 00:01:46,720
That would be small. 
Yeah, we oriented it for 

34
00:01:47,280 --> 00:01:51,000
portrait mode, right. 
So it's you can put it all in 

35
00:01:51,000 --> 00:01:52,920
portrait mode. 
Yeah, yeah. 

36
00:01:53,080 --> 00:01:57,760
And one of our tests is just 
looking at the line length of 

37
00:01:57,760 --> 00:02:01,720
the output and if it was above 
47 characters it fails the 

38
00:02:01,720 --> 00:02:03,240
build. 
Yeah, that's right. 

39
00:02:03,360 --> 00:02:06,520
Yeah. 
Yeah, got to keep it nice and 

40
00:02:06,520 --> 00:02:09,960
skinny. 
And we peeked at about what, 300

41
00:02:09,960 --> 00:02:12,680
pages? 
And then we started pruning it 

42
00:02:12,680 --> 00:02:15,000
back. 
And it's like, if this doesn't 

43
00:02:15,000 --> 00:02:17,640
move the story forward, it goes 
out. 

44
00:02:18,560 --> 00:02:23,440
Yeah, there's a lot of 
interesting, reasonably high 

45
00:02:23,440 --> 00:02:27,160
quality material that just 
didn't belong there. 

46
00:02:27,600 --> 00:02:33,440
We have cut out everything that 
doesn't fit that pretty narrow 

47
00:02:33,440 --> 00:02:35,600
focus. 
But I feel like it was also 

48
00:02:35,600 --> 00:02:40,920
useful in the evolution because 
we saw it and our understanding 

49
00:02:40,920 --> 00:02:44,320
was deeper, and then we 
realized, no, this isn't going 

50
00:02:44,320 --> 00:02:49,000
to help people. 
Yeah, four years in the making, 

51
00:02:49,000 --> 00:02:51,360
Yep, it is. 
It's been a journey. 

52
00:02:51,520 --> 00:02:54,840
So see on a lot of that four 
years, which we'll talk about 

53
00:02:54,840 --> 00:02:58,040
the the kind of journey later, 
but but a lot of it was was just

54
00:02:58,040 --> 00:03:00,920
figuring out what what was 
needed in this space. 

55
00:03:00,920 --> 00:03:06,440
We don't want to just create a 
book about Scala, Zeo or 

56
00:03:06,440 --> 00:03:08,640
functional programming. 
Functional programming. 

57
00:03:09,360 --> 00:03:12,600
We really wanted to and it took 
a while to get there, but we 

58
00:03:12,600 --> 00:03:15,320
really where we got to is we 
really wanted to help people 

59
00:03:15,320 --> 00:03:17,360
understand what effects were and
how they can help them. 

60
00:03:17,520 --> 00:03:20,880
Yeah, I. 
I was the test case because I 

61
00:03:20,880 --> 00:03:24,160
kept not understanding. 
I kept trying to read functional

62
00:03:24,160 --> 00:03:26,080
programming books and getting 
lost. 

63
00:03:26,520 --> 00:03:29,160
I kept not understanding what we
were doing. 

64
00:03:29,520 --> 00:03:35,480
And finally I realized, I don't 
know what the point of this is. 

65
00:03:35,960 --> 00:03:39,840
And so we started to kind of 
say, yeah, why are we? 

66
00:03:40,120 --> 00:03:42,400
What is what is the goal of all 
this? 

67
00:03:42,400 --> 00:03:47,440
And eventually we came to 
realize that it was the goal 

68
00:03:47,840 --> 00:03:52,040
ever since we dragged ourselves 
out of the mire of assembly 

69
00:03:52,040 --> 00:03:56,040
language programming, which is 
taking little pieces and putting

70
00:03:56,040 --> 00:03:58,240
them together and making big 
pieces. 

71
00:03:59,040 --> 00:04:03,000
And I think you not 
understanding some of the stuff 

72
00:04:03,000 --> 00:04:07,600
that James and I had already 
struggled through in years prior

73
00:04:08,560 --> 00:04:12,440
was really valuable because we 
could spend extra time getting 

74
00:04:12,440 --> 00:04:16,440
practice explaining it to you 
and either get better at 

75
00:04:16,440 --> 00:04:21,120
explaining a topic or realize 
this is not necessary. 

76
00:04:21,160 --> 00:04:25,840
Like, we don't have to explain 
this concept here, so let's just

77
00:04:25,840 --> 00:04:27,520
sidestep it. 
And. 

78
00:04:28,040 --> 00:04:31,240
Leave that to someone else to 
discuss in a different book. 

79
00:04:31,640 --> 00:04:33,800
Right, which has already been 
done. 

80
00:04:33,880 --> 00:04:36,520
There's there's lots of books on
functional programming. 

81
00:04:36,880 --> 00:04:39,320
I tried to read them. 
I got lost. 

82
00:04:39,320 --> 00:04:44,080
And I think lots of other people
got lost, mostly because it was,

83
00:04:44,320 --> 00:04:46,400
oh, this is a cool feature. 
This is a cool feature. 

84
00:04:46,400 --> 00:04:48,280
This is a cool feature. 
It's like, well, why? 

85
00:04:48,560 --> 00:04:50,920
I mean, some of it is like, 
yeah, that's pretty interesting 

86
00:04:50,920 --> 00:04:53,000
and neat. 
But I didn't get the big picture

87
00:04:53,320 --> 00:04:58,880
until we started to kind of 
focus and ask that question and 

88
00:04:59,240 --> 00:05:01,440
realize, oh, this is what we're 
doing. 

89
00:05:01,760 --> 00:05:06,400
And some things aren't even 
presented as a cool programming 

90
00:05:06,400 --> 00:05:08,480
feature. 
They're presented as a cool bit 

91
00:05:08,480 --> 00:05:11,240
of math. 
And it's kind of left up to you 

92
00:05:11,360 --> 00:05:17,920
to make the jump to, OK, this 
interesting bit of math here, 

93
00:05:18,680 --> 00:05:22,680
how do I actually bring that 
into my program? 

94
00:05:22,680 --> 00:05:28,400
Like how is it going to to help 
me out in my day-to-day career? 

95
00:05:28,440 --> 00:05:32,600
Interesting, but why? 
And we kept coming back to as we

96
00:05:32,600 --> 00:05:36,480
were formulating what we 
eventually got to as being the 

97
00:05:36,480 --> 00:05:39,320
book is we would we would look 
at things and be like, does this

98
00:05:39,320 --> 00:05:42,800
help illuminate what effects are
and why they're useful? 

99
00:05:43,200 --> 00:05:45,880
And if not, we mostly tossed. 
It it's like. 

100
00:05:46,120 --> 00:05:49,040
That was not not helpful. 
One of the important parts of 

101
00:05:49,040 --> 00:05:53,760
finally landing on this title 
because so much stuff kind of 

102
00:05:53,760 --> 00:05:57,800
came in and out of the book, you
know, when it was in an earlier 

103
00:05:57,800 --> 00:06:01,400
form. 
And once we struck on this 

104
00:06:01,400 --> 00:06:08,120
title, that was kind of our 
guiding light of, OK, is this 

105
00:06:08,120 --> 00:06:12,160
appropriate for teaching effect 
oriented programming? 

106
00:06:13,000 --> 00:06:17,360
And you know, just depending on 
the answer to that question, are

107
00:06:17,360 --> 00:06:22,240
we going to keep it in? 
So we've talked about effects 

108
00:06:22,280 --> 00:06:25,880
thinking a few times on the 
podcast, but since we've 

109
00:06:25,880 --> 00:06:29,720
finished the book on it, maybe 
it would be helpful to just give

110
00:06:29,880 --> 00:06:33,320
a little bit of what effects are
and how we talk about them in 

111
00:06:33,320 --> 00:06:37,200
the book and teaser to the book.
Why effects? 

112
00:06:37,400 --> 00:06:38,680
Why effects? 
Why effects? 

113
00:06:38,680 --> 00:06:41,600
I think is is really important 
because it's like, Oh yeah, it's

114
00:06:41,600 --> 00:06:45,440
interesting effects. 
So the way that we sort of 

115
00:06:45,440 --> 00:06:50,760
capture effects is the idea 
that, well, you have your 

116
00:06:50,760 --> 00:06:55,200
perfect functions that do 
everything in kind of the, the 

117
00:06:55,240 --> 00:06:59,520
Platonic ideal of a function is 
you pass it some arguments and 

118
00:06:59,520 --> 00:07:01,480
it gives you a result. 
Cool. 

119
00:07:02,280 --> 00:07:07,400
But, and, and that's kind of how
we teach it, but we sort of 

120
00:07:07,400 --> 00:07:11,760
sidestep the idea that, well, 
there are functions, like if you

121
00:07:11,760 --> 00:07:16,120
have a computer full of perfect 
functions that never interacts 

122
00:07:16,120 --> 00:07:19,600
with the outside world, then all
it does is heat the room up. 

123
00:07:19,840 --> 00:07:23,200
Yeah, it's not, you know, you 
gotta at least produce a result 

124
00:07:23,200 --> 00:07:27,560
or you gotta, you know, maybe 
check the temperature or look at

125
00:07:27,560 --> 00:07:31,920
the time or something. 
And those are all basically, I 

126
00:07:31,920 --> 00:07:34,480
mean, you don't know what's the 
temperature's going to be. 

127
00:07:34,480 --> 00:07:37,400
You don't know what, you don't 
even know if the temperature 

128
00:07:37,400 --> 00:07:40,880
sensor is working. 
There's all these messy things 

129
00:07:40,880 --> 00:07:44,240
that happen when you try and you
leave the world of perfect math 

130
00:07:44,240 --> 00:07:46,000
and you talk to the outside 
world. 

131
00:07:46,280 --> 00:07:48,840
But that's what makes the 
programs useful. 

132
00:07:49,240 --> 00:07:52,720
And I think what we've done in 
the past is we've said, Oh yeah,

133
00:07:53,000 --> 00:07:55,520
those things happen and you 
don't always know what's going 

134
00:07:55,520 --> 00:07:56,920
to happen. 
And it's the job of the 

135
00:07:56,920 --> 00:08:01,600
programmer to write the code to,
to compensate for all the, the 

136
00:08:02,120 --> 00:08:07,280
uncertainties of that. 
And they, they're people haven't

137
00:08:07,280 --> 00:08:11,120
really looked at it and said, 
why don't we look at those 

138
00:08:11,520 --> 00:08:14,640
uncertainties and those 
unpredictabilities and kind of 

139
00:08:14,680 --> 00:08:20,240
let's, let's step back and, and 
treat those as their own thing. 

140
00:08:20,880 --> 00:08:23,520
And maybe there's something we 
can do about it rather than just

141
00:08:23,520 --> 00:08:27,600
saying, well, you never know, 
the network might go down, who 

142
00:08:27,600 --> 00:08:29,200
knows, can't do anything about 
it. 

143
00:08:29,960 --> 00:08:33,360
And instead say, well, maybe 
there is something we can do 

144
00:08:33,360 --> 00:08:35,440
about it. 
Maybe, maybe we can put little 

145
00:08:35,440 --> 00:08:39,120
boxes around it. 
Maybe we can add that 

146
00:08:39,120 --> 00:08:47,080
information to the type of the 
function and do something with 

147
00:08:47,080 --> 00:08:51,960
it so that at least we're we're 
better prepared or we cover all 

148
00:08:51,960 --> 00:08:56,440
the error conditions, or we 
expect or we're able to test 

149
00:08:56,440 --> 00:09:00,440
things. 
For example, you know what, 

150
00:09:01,160 --> 00:09:05,160
there's an example that you 
inserted towards the end of the 

151
00:09:05,160 --> 00:09:10,800
process where you said, well, 
you know what, if it's 11:59, 

152
00:09:11,040 --> 00:09:14,840
you start a process and then 
that process checks and it goes,

153
00:09:14,840 --> 00:09:17,880
oh, it's the next day. 
Well, the previous days. 

154
00:09:18,680 --> 00:09:21,640
Well, how do you test for that? 
Because are you going to sit 

155
00:09:21,640 --> 00:09:26,440
there and wait and well, so if 
we can control those. 

156
00:09:26,640 --> 00:09:29,400
Like you can't wait until you 
know have a test that just 

157
00:09:29,440 --> 00:09:33,720
exactly right, exactly sorry. 
Your test could take 24 hours to

158
00:09:33,720 --> 00:09:36,000
run. 
Yeah, because at the right time.

159
00:09:36,040 --> 00:09:38,080
So it's like, well, it's kind of
obvious. 

160
00:09:38,640 --> 00:09:41,960
Isn't there some way we could 
make it the time that we want to

161
00:09:41,960 --> 00:09:44,480
test for? 
Yeah, you don't want to 

162
00:09:44,800 --> 00:09:49,720
incidentally discover that your 
code misbehaves at a certain 

163
00:09:49,720 --> 00:09:51,960
moment in time. 
Because it's inconvenient to 

164
00:09:51,960 --> 00:09:54,760
test it. 
Yeah, you want to dictate, hey, 

165
00:09:54,760 --> 00:09:59,600
let's just make, we are going to
force this thing to rhyme at all

166
00:09:59,600 --> 00:10:03,600
those inconvenient boundary 
times and we're going to do it 

167
00:10:03,600 --> 00:10:08,480
at 115959 on the last day of the
year. 

168
00:10:09,120 --> 00:10:14,240
And you know, if we want it to 
span over into the next day, we 

169
00:10:14,240 --> 00:10:19,000
explicitly say that in the test.
We say, OK, now insert a delay 

170
00:10:19,680 --> 00:10:24,600
and then you just have complete 
control over that timing in your

171
00:10:24,600 --> 00:10:27,040
test. 
Rather than I've worked at 

172
00:10:27,200 --> 00:10:30,600
companies and organizations 
where it's just kind of 

173
00:10:30,600 --> 00:10:36,560
understood if you run these 
after 5:00 PM, it's probably not

174
00:10:36,560 --> 00:10:42,440
going to work. 
And we don't really know at 

175
00:10:42,520 --> 00:10:45,040
heart, you know, what is causing
that. 

176
00:10:45,600 --> 00:10:49,840
But these were developed by 
someone during the work day and 

177
00:10:49,840 --> 00:10:53,320
they unintentionally made them 
found dependent. 

178
00:10:54,160 --> 00:10:56,280
And yeah, we don't even know how
to test for it. 

179
00:10:56,280 --> 00:11:02,480
And one of the huge things is 
the testability of stuff that is

180
00:11:02,520 --> 00:11:06,080
unpredictable. 
And so if we can control those 

181
00:11:06,080 --> 00:11:12,920
things and inject the kinds of 
situations that we want to test 

182
00:11:12,920 --> 00:11:15,480
for, then we can test for that 
all the time. 

183
00:11:15,840 --> 00:11:19,520
And of course, you know, 
obviously we want to catch 

184
00:11:19,520 --> 00:11:23,760
things as early as possible and 
we do that, some of that using 

185
00:11:24,040 --> 00:11:27,480
strong static checking and other
mechanisms. 

186
00:11:27,800 --> 00:11:31,800
But then ultimately you've got 
to be able to test things under 

187
00:11:31,800 --> 00:11:34,920
all the worst situations and 
you've got to be able to 

188
00:11:34,920 --> 00:11:37,880
reproduce those. 
And we haven't really been able 

189
00:11:37,880 --> 00:11:40,280
to do that consistently in the 
past. 

190
00:11:40,320 --> 00:11:44,880
And this allows you to do that. 
So the book is called Effect 

191
00:11:44,880 --> 00:11:47,680
Oriented Programming and we 
what's the subhead on it? 

192
00:11:47,680 --> 00:11:52,160
What do we say a paradigm for? 
We should have a copy of the 

193
00:11:52,160 --> 00:11:55,760
book right here to we do 
reference it so we make sure we 

194
00:11:55,760 --> 00:11:57,120
get it right. 
But here we go. 

195
00:11:57,320 --> 00:12:00,880
A paradigm for creating 
reliable, adaptable, testable. 

196
00:12:00,880 --> 00:12:05,360
Systems, yeah. 
And so really the book is 

197
00:12:05,360 --> 00:12:08,560
focused on exploring this 
concept of how effects can help 

198
00:12:08,560 --> 00:12:12,160
you do that. 
And we go through a bunch of the

199
00:12:12,280 --> 00:12:14,320
kind of why's, why are we doing 
this? 

200
00:12:14,320 --> 00:12:18,200
And then we go through the 
mechanics of what's needed to 

201
00:12:18,200 --> 00:12:24,080
get to those reliable, testable 
and adaptable. 

202
00:12:24,080 --> 00:12:25,680
Adaptable. 
Yeah, composability. 

203
00:12:26,000 --> 00:12:30,200
So we we kind of expand on on 
how how that's actually done in 

204
00:12:30,200 --> 00:12:33,120
this book. 
It was Scholar Zeo, because 

205
00:12:33,120 --> 00:12:35,000
that's something that Bill and I
are familiar with. 

206
00:12:35,280 --> 00:12:38,240
But there are other effect 
systems, other ways to do 

207
00:12:38,240 --> 00:12:42,560
effects, and so maybe in the 
future we'll have other versions

208
00:12:42,560 --> 00:12:47,320
of the book that explore the 
same concepts but using other 

209
00:12:47,320 --> 00:12:49,640
technologies. 
The point being that it's not 

210
00:12:50,360 --> 00:12:55,440
limited to this particular 
combination of things. 

211
00:12:55,440 --> 00:12:59,960
In fact, a lot of work was done 
with effect systems using other 

212
00:12:59,960 --> 00:13:04,360
approaches which were, I don't 
know, one could almost argue 

213
00:13:04,840 --> 00:13:09,400
eventually evolved into this 
through a series of experiments.

214
00:13:09,400 --> 00:13:11,520
I mean, some of them are being 
actively used. 

215
00:13:12,000 --> 00:13:14,240
Cats effects, and I can't 
remember. 

216
00:13:14,240 --> 00:13:17,800
There was something Zedd. 
Skull Zed. 

217
00:13:17,800 --> 00:13:21,400
Yeah, that was one of the 
original ones and I remember 

218
00:13:21,880 --> 00:13:25,160
watching some videos about that 
and having no clue. 

219
00:13:25,560 --> 00:13:27,120
Yeah. 
Zero clue it was. 

220
00:13:27,960 --> 00:13:30,720
Yeah. 
So there are those earlier 

221
00:13:30,720 --> 00:13:35,440
attempts within Scala, and then 
there are also other languages 

222
00:13:35,440 --> 00:13:40,560
which take it further than Scala
with Zeo, where all of these 

223
00:13:40,560 --> 00:13:43,720
things are baked into the 
language itself. 

224
00:13:45,280 --> 00:13:51,320
You you do need some discipline 
when writing effects in Scala. 

225
00:13:51,360 --> 00:13:54,840
You know, using a library as 
opposed to it's. 

226
00:13:55,280 --> 00:13:57,520
Not enforced by the language. 
Yeah, it doesn't that. 

227
00:13:57,880 --> 00:14:00,920
But even the Scala language is 
looking at adding some type of 

228
00:14:00,920 --> 00:14:03,960
effects to the language itself. 
I'll see where that goes, but 

229
00:14:04,360 --> 00:14:07,280
but I think what's important 
here is that we did use Scala 

230
00:14:07,280 --> 00:14:09,560
Zeo, but the book is not about 
Scala Zeo. 

231
00:14:09,640 --> 00:14:14,360
Scala Zeo is just the way that 
we teach the concepts and so 

232
00:14:14,360 --> 00:14:17,240
that's one reason why the the 
the book will hopefully be 

233
00:14:17,240 --> 00:14:20,080
pretty portable to other 
technology sets is that it's not

234
00:14:20,080 --> 00:14:22,360
about scholars EO. 
And one of the things that I 

235
00:14:22,360 --> 00:14:27,960
really like is I, I mean, I'm, 
I'm sort of presenting this as, 

236
00:14:27,960 --> 00:14:31,160
Oh, you guys, could, you kept 
seeing how I wasn't getting 

237
00:14:31,160 --> 00:14:32,720
this. 
And you said, well, how can we, 

238
00:14:32,920 --> 00:14:38,120
how can we, let's see if we can 
throw away or hide a whole bunch

239
00:14:38,120 --> 00:14:41,160
of stuff so that we just get 
down to the essence of the 

240
00:14:41,160 --> 00:14:44,680
examples. 
And then that's when it started 

241
00:14:44,680 --> 00:14:46,480
just becoming a lot clearer to 
me. 

242
00:14:46,480 --> 00:14:50,880
And then I could, I could more 
clearly write about it because 

243
00:14:50,920 --> 00:14:54,720
it it's really the essence and 
the examples have been reduced 

244
00:14:54,720 --> 00:14:58,000
to their like, I don't know if 
it'd be possible to make them 

245
00:14:58,000 --> 00:15:00,280
any smaller than that they're. 
Often just a thing that could 

246
00:15:00,280 --> 00:15:04,360
possibly work. 3 or 4 lines and 
it so it really zooms in. 

247
00:15:04,360 --> 00:15:09,760
You don't get distracted. 
We also used an extreme subset 

248
00:15:10,200 --> 00:15:12,760
of Scala. 
We didn't, you know, you don't 

249
00:15:12,760 --> 00:15:15,120
see type annotations. 
You don't see. 

250
00:15:15,120 --> 00:15:20,800
So it's so it's really clear and
it's, it's really hard to get 

251
00:15:20,800 --> 00:15:25,280
distracted by the extra stuff 
because that's hidden and it's 

252
00:15:25,280 --> 00:15:26,880
all tested. 
It's all there. 

253
00:15:27,080 --> 00:15:30,120
The code is there. 
When you download the code from 

254
00:15:30,120 --> 00:15:35,160
the repository, you can run 
everything but the the part that

255
00:15:35,160 --> 00:15:38,520
we show in the book is. 
Is just the, it's almost like 

256
00:15:38,520 --> 00:15:39,960
the whiteboard code that you 
would write. 

257
00:15:39,960 --> 00:15:44,280
Yes, it is like, it doesn't 
matter that it's Zeo, right? 

258
00:15:44,280 --> 00:15:47,280
It's like, yeah, we have to use 
some Zeo APIs to show the 

259
00:15:47,280 --> 00:15:51,680
concepts, but but it really is 
supposed to be the, the there's 

260
00:15:51,680 --> 00:15:53,800
some word for that, like, you 
know, the code that you write on

261
00:15:53,800 --> 00:15:56,640
the whiteboard that is really 
just agnostic to some 

262
00:15:56,640 --> 00:15:59,560
implementation. 
But it is all runnable of 

263
00:15:59,560 --> 00:16:02,000
course. 
And that that was another 

264
00:16:02,160 --> 00:16:08,080
guiding is OK, we want to show 
this bit of the Zeo API that 

265
00:16:08,080 --> 00:16:12,120
facilitates this example. 
Oh, what while while we are 

266
00:16:12,120 --> 00:16:17,240
explaining this API feature, 
let's do this other one as well.

267
00:16:17,320 --> 00:16:20,640
And then having to remind 
ourselves like, no, that's for 

268
00:16:20,800 --> 00:16:23,760
the Zeodocs. 
That is if you are really 

269
00:16:23,760 --> 00:16:27,640
focused on explaining Zeo, that 
is not our goal. 

270
00:16:28,080 --> 00:16:33,360
We we appreciate the Zeodocs for
what they are and you should 

271
00:16:33,360 --> 00:16:37,320
absolutely jump over to them. 
Consult them as needed. 

272
00:16:37,640 --> 00:16:41,920
Our book does not replace those.
That's not its goal. 

273
00:16:41,960 --> 00:16:46,640
No, no. 
And the one step at a time 

274
00:16:47,640 --> 00:16:52,280
approach, there's like 1 concept
per example. 

275
00:16:52,640 --> 00:16:58,240
And then showing how they, they 
can build on each other that 

276
00:16:58,280 --> 00:17:01,920
that I found just super helpful 
because I could look at this and

277
00:17:01,920 --> 00:17:04,040
go, Oh yeah, you're doing this 
one thing. 

278
00:17:04,440 --> 00:17:09,880
Oh, and that's one of the kind 
of amazing things about an 

279
00:17:09,880 --> 00:17:15,880
effects library is the ability 
to build pieces together, to 

280
00:17:15,920 --> 00:17:19,680
actually compose things together
seamlessly. 

281
00:17:20,040 --> 00:17:24,400
I mean, pretty much you can just
say I want this too. 

282
00:17:24,560 --> 00:17:27,560
You just tack it on. 
Yeah, I know. 

283
00:17:27,640 --> 00:17:30,880
You look at systems outside of 
effects and they really 

284
00:17:31,040 --> 00:17:35,120
generally don't compose very 
easily or well when you bring in

285
00:17:35,320 --> 00:17:40,320
resource management, air 
handling, dependencies, I don't 

286
00:17:40,320 --> 00:17:42,200
know what other. 
Thing all those things that the 

287
00:17:42,200 --> 00:17:45,640
programmer is just supposed to 
to deal with when they put their

288
00:17:45,640 --> 00:17:47,280
program together. 
Exactly. 

289
00:17:47,360 --> 00:17:50,400
And so, so that was something we
really wanted to highlight was 

290
00:17:50,400 --> 00:17:54,440
like, oh, you actually can fit 
these pieces together and 

291
00:17:54,440 --> 00:17:58,960
maintain all the the, the things
that are real world, the 

292
00:17:58,960 --> 00:18:02,720
effectful side effecting parts 
of an application flexibility. 

293
00:18:02,720 --> 00:18:04,520
They'll fit together even when 
they're side effect. 

294
00:18:04,520 --> 00:18:06,800
Yeah. 
So basically you can just tack 

295
00:18:06,800 --> 00:18:10,680
this functionality on and 
you've, I, I know Bill, you've 

296
00:18:10,720 --> 00:18:14,960
talked about some experiences 
that you've had where you could 

297
00:18:14,960 --> 00:18:20,320
and couldn't use the effect 
system and you and you said, OK,

298
00:18:20,400 --> 00:18:24,240
so we spent two weeks doing this
thing that would have taken me 

299
00:18:24,240 --> 00:18:29,680
half an hour. 
And that's a pretty damning 

300
00:18:29,680 --> 00:18:32,240
story. 
Yeah, if you just want to. 

301
00:18:32,600 --> 00:18:34,480
Help. 
Out some code and have it 

302
00:18:34,480 --> 00:18:41,240
cancelled in a reliable way with
effects you just you almost 

303
00:18:41,240 --> 00:18:43,800
don't even think about it. 
You just say, oh. 

304
00:18:44,120 --> 00:18:45,520
Yeah. 
At this time, this thing out, 

305
00:18:45,760 --> 00:18:47,680
yeah. 
And you just, you know that 

306
00:18:47,680 --> 00:18:52,320
everything underneath is going 
to be interrupted, cleaned up. 

307
00:18:53,320 --> 00:18:59,280
And it just lets you focus on 
such a tiny fraction. 

308
00:18:59,280 --> 00:19:03,840
The one thing you want to do 
rather than all of the impacts 

309
00:19:03,880 --> 00:19:08,680
of that in a normal piece of 
code and imagine like, well, the

310
00:19:08,680 --> 00:19:11,160
two weeks, you know, what does 
that cost a company? 

311
00:19:11,400 --> 00:19:16,040
Not just the programmer's time, 
but all of the lost opportunity,

312
00:19:16,040 --> 00:19:18,760
all of the slowdown and 
everything it's. 

313
00:19:20,200 --> 00:19:22,640
But you see this like all the 
time. 

314
00:19:23,240 --> 00:19:25,760
At least I, I don't see bugs 
everywhere in code. 

315
00:19:26,240 --> 00:19:28,240
Not my code. 
My code is perfect because I use

316
00:19:28,240 --> 00:19:30,800
effects. 
But but like the Spotify app, 

317
00:19:30,800 --> 00:19:35,360
like I go in, I launch the thing
and then it just sits there and 

318
00:19:35,360 --> 00:19:37,920
spins and spins and spins. 
And I'm like, really? 

319
00:19:37,920 --> 00:19:40,600
Was it so hard to add a time out
to this thing? 

320
00:19:41,000 --> 00:19:43,160
And it's like, actually it 
probably was. 

321
00:19:43,160 --> 00:19:46,520
That's probably why it was. 
So much work, they said. 

322
00:19:46,640 --> 00:19:50,480
Oh, I don't want to do this. 
My Sonos speakers have become 

323
00:19:50,480 --> 00:19:55,000
bricks since, you know, whatever
happened there, I don't know. 

324
00:19:55,000 --> 00:20:00,320
And it's like, yeah, well, the, 
the failure rate of software 

325
00:20:00,400 --> 00:20:04,200
projects is so embarrassingly 
bad. 

326
00:20:04,200 --> 00:20:07,840
So this book that I read 
recently called How Big Things 

327
00:20:07,840 --> 00:20:10,320
Get Done. 
They, they've got all this data 

328
00:20:10,320 --> 00:20:13,560
about projects this that they 
collected. 

329
00:20:13,640 --> 00:20:18,480
And so they have this database. 
And so the worst, the the least 

330
00:20:18,480 --> 00:20:22,560
successful projects that you 
know come in late and over 

331
00:20:22,560 --> 00:20:27,640
budget and maybe don't even work
right are storing nuclear waste.

332
00:20:28,120 --> 00:20:32,080
The second worst is building 
nuclear reactors. 

333
00:20:32,840 --> 00:20:38,560
The third worst is IT projects. 
So we're, you know, basically at

334
00:20:38,560 --> 00:20:40,040
the bottom, you're a good 
company. 

335
00:20:40,200 --> 00:20:42,440
Yeah, we're yeah. 
And we're not dealing with 

336
00:20:42,440 --> 00:20:44,200
nuclear waste or nuclear 
reactors. 

337
00:20:44,200 --> 00:20:46,720
We're dealing with software 
which is supposed to be 

338
00:20:47,480 --> 00:20:51,000
fungible, easy. 
You know, it's just bits and 

339
00:20:51,000 --> 00:20:52,920
code. 
It should be easier. 

340
00:20:53,520 --> 00:20:56,240
Yeah. 
So I think part of the 

341
00:20:56,240 --> 00:20:59,960
motivation for working on this 
book is that we believe that 

342
00:20:59,960 --> 00:21:02,880
there's a better way to build 
software that can be more 

343
00:21:02,880 --> 00:21:07,680
reliable, more adaptable, more 
testable, all those things that 

344
00:21:07,720 --> 00:21:12,920
are in our subtitle there. 
And we think that the world 

345
00:21:12,920 --> 00:21:16,160
needs this. 
And there are technology areas 

346
00:21:16,520 --> 00:21:20,520
where you can get it today in 
Scala and in Unison and Rock and

347
00:21:20,520 --> 00:21:23,760
No Camel. 
But I think this is such an 

348
00:21:23,760 --> 00:21:28,280
important concept that most 
languages will eventually have 

349
00:21:28,280 --> 00:21:31,000
either library support or 
language support for this, and 

350
00:21:31,000 --> 00:21:32,680
so why not Start learning the 
concepts? 

351
00:21:32,680 --> 00:21:37,160
It's a fundamental shift. 
It's like, I mean, it could even

352
00:21:37,160 --> 00:21:43,600
be considered on the level of 
when Dykstra ropes go to 

353
00:21:43,600 --> 00:21:48,120
considered harmful, which is 
ultimately what moved us into, 

354
00:21:48,480 --> 00:21:52,040
oh, pieces of code should all be
in functions. 

355
00:21:52,320 --> 00:21:56,000
That's that's what got us there.
And because before that we had 

356
00:21:56,000 --> 00:21:58,600
sub routines, we had jumping 
around and stuff like that. 

357
00:21:58,600 --> 00:22:02,560
And he showed that, Oh yeah, 
this you need to have a wrapper 

358
00:22:02,760 --> 00:22:04,920
around this thing that is 
reliable. 

359
00:22:05,080 --> 00:22:07,560
So that, and that was a piece of
composition. 

360
00:22:07,920 --> 00:22:12,200
And there's, you know, 
namespaces was another piece 

361
00:22:12,200 --> 00:22:15,320
that allowed us to do this. 
And I feel like, well, this 

362
00:22:15,960 --> 00:22:19,800
could well be it, paying 
attention to these kinds of 

363
00:22:19,800 --> 00:22:22,800
things, which we've basically 
swept under the rug and said 

364
00:22:23,120 --> 00:22:26,000
that's just the way that's just 
part of the deal, something you 

365
00:22:26,000 --> 00:22:29,080
have to deal with. 
And I think this is that kind of

366
00:22:29,080 --> 00:22:32,320
a shift. 
Somehow we have to start paying 

367
00:22:32,320 --> 00:22:35,400
attention to those things and 
treating them as first class 

368
00:22:35,680 --> 00:22:39,560
members of programming rather 
than just something every 

369
00:22:39,560 --> 00:22:45,120
programmer has to deal with. 
Because your example of, well, I

370
00:22:45,120 --> 00:22:49,880
could do this in in 5 minutes or
whatever versus 2 weeks and 

371
00:22:49,880 --> 00:22:52,400
still not even know if you've 
covered all the bases. 

372
00:22:53,640 --> 00:23:02,640
Yeah, and even when I'm working 
in a non 0 non effectful project

373
00:23:02,760 --> 00:23:04,880
framework. 
It changes the way you work. 

374
00:23:05,280 --> 00:23:14,560
I still will categorize things 
into the simple PR functions or 

375
00:23:14,640 --> 00:23:18,640
the ones that I have to worry 
about and take a lot of extra 

376
00:23:18,640 --> 00:23:23,280
care around. 
So even if I don't have the 

377
00:23:23,280 --> 00:23:28,840
really streamlined effect system
experience, that grouping is 

378
00:23:28,840 --> 00:23:34,160
still helpful because I can draw
the circle around this thing and

379
00:23:34,160 --> 00:23:39,880
say this is the dangerous code. 
This is where all the care and 

380
00:23:39,880 --> 00:23:43,920
attention needs to go into and 
the pure simple functions over 

381
00:23:43,920 --> 00:23:47,400
here like, yeah, just write a 
unit test or two, move on with 

382
00:23:47,400 --> 00:23:50,040
your day. 
Yeah, it's a conceptual tool. 

383
00:23:50,480 --> 00:23:54,160
And for me, this process 
finally, I mean, I've been 

384
00:23:54,160 --> 00:23:58,360
struggling with what the heck 
are errors and failures and 

385
00:23:58,360 --> 00:24:02,120
things like that and slowly 
adding pieces and understanding 

386
00:24:02,120 --> 00:24:05,440
and trying to, you know, why 
don't exceptions work, all this.

387
00:24:05,720 --> 00:24:09,240
And this has kind of brought a 
close to that when you look at 

388
00:24:10,280 --> 00:24:16,920
errors as values rather than 
exceptions, definitely moved us 

389
00:24:16,920 --> 00:24:19,000
forward from where we were 
before. 

390
00:24:19,200 --> 00:24:22,400
But then we ran into this other 
wall, which is, well, how do you

391
00:24:22,400 --> 00:24:26,480
make sure that you've covered 
all of the problems, and without

392
00:24:26,480 --> 00:24:29,680
having it incorporated into the 
type system, you can't. 

393
00:24:30,160 --> 00:24:35,360
Yeah, exceptions are like you 
said, they're a good step 

394
00:24:35,360 --> 00:24:39,840
forward, but they are still 
treated as this special separate

395
00:24:39,840 --> 00:24:43,800
thing that just blows out the 
site of your function rather 

396
00:24:43,800 --> 00:24:47,360
than your function. 
Just saying here is the error 

397
00:24:47,360 --> 00:24:52,480
value that we got when we and. 
Here are the possible error 

398
00:24:52,480 --> 00:24:56,840
values that you need to cover. 
And it really prevents good 

399
00:24:56,840 --> 00:24:59,360
reliability and good 
composability. 

400
00:24:59,600 --> 00:25:02,960
And so that's part of what we 
talk about in the book is, oh, 

401
00:25:02,960 --> 00:25:05,480
this is how you can do air 
handling in a way that helps you

402
00:25:05,480 --> 00:25:09,120
actually increase reliability 
and increase your composability 

403
00:25:09,120 --> 00:25:10,920
or. 
Adaptability, yeah, and I would 

404
00:25:10,920 --> 00:25:14,760
say that's not even, I mean 
that's incorporated into effect 

405
00:25:14,760 --> 00:25:16,880
system, but that predate, you 
know, that's a. 

406
00:25:16,880 --> 00:25:18,720
No for sure. 
I would say a functional. 

407
00:25:19,200 --> 00:25:21,880
Error handling approach. 
Is that what you call returning 

408
00:25:22,240 --> 00:25:25,520
values as era I mean? 
I don't know if there is a 

409
00:25:25,600 --> 00:25:30,200
general Yeah, era is a size. 
But, and I know one of the 

410
00:25:30,200 --> 00:25:37,920
things that is served by Scala 3
as our choice of language here 

411
00:25:38,600 --> 00:25:44,560
is that union types, which I, I,
I don't even like really saying 

412
00:25:44,560 --> 00:25:49,600
that out loud because it's a 
kind of gatekeeping term, but it

413
00:25:49,600 --> 00:25:53,600
allows you to express or in the 
type system. 

414
00:25:54,160 --> 00:25:59,480
So instead of everything being 
reduced to some common super 

415
00:25:59,480 --> 00:26:05,280
type of all of your errors, you 
just say this function can fail 

416
00:26:05,280 --> 00:26:11,400
with a user validation error or 
a network error or. 

417
00:26:11,560 --> 00:26:14,120
A divide by zero. 
Divide by zero error. 

418
00:26:14,360 --> 00:26:19,480
And so just as you build a more 
complex function and you add 

419
00:26:19,480 --> 00:26:24,080
more fallible operations, the 
compiler just tracks, OK, you 

420
00:26:24,080 --> 00:26:29,360
added a new fallible function 
that can air out in this way and

421
00:26:29,360 --> 00:26:33,560
it just tacks them all together.
And then at the end you can look

422
00:26:33,560 --> 00:26:37,360
and see, oh, these are the six 
possible errors. 

423
00:26:37,640 --> 00:26:41,800
And more importantly, the 
compiler looks at it and goes, 

424
00:26:42,120 --> 00:26:44,480
oh, there's a new error in your 
system. 

425
00:26:44,480 --> 00:26:47,240
So everybody who's called 
calling this code now needs to 

426
00:26:47,240 --> 00:26:49,560
deal with it. 
Doesn't rely on somebody. 

427
00:26:49,760 --> 00:26:53,120
Oh, you should go look at the 
docs and make sure if they're 

428
00:26:53,120 --> 00:26:56,720
even in there and make sure that
you cover this new thing that's 

429
00:26:56,720 --> 00:26:58,360
happened and this just slipped 
through. 

430
00:26:58,600 --> 00:27:02,440
And if you just upgrade your 
code with thinking, oh this is 

431
00:27:02,440 --> 00:27:05,480
going to be better, you may have
a new error that you don't know 

432
00:27:05,480 --> 00:27:06,880
about and your code's broken 
now. 

433
00:27:07,400 --> 00:27:13,240
Yeah, yeah. 
So huge way forward with effects

434
00:27:13,240 --> 00:27:15,560
and air handling. 
So that's that's one of our 

435
00:27:15,560 --> 00:27:18,200
chapters that we go into to 
detail on. 

436
00:27:18,560 --> 00:27:28,600
Yeah, well, I, I think, well, 
the functional community has had

437
00:27:29,040 --> 00:27:33,240
a really hard time getting these
ideas across. 

438
00:27:33,240 --> 00:27:37,680
And I think sometimes they get a
little frustrated because 

439
00:27:37,680 --> 00:27:41,520
everybody else isn't as smart as
they are, and so they can even 

440
00:27:41,520 --> 00:27:44,680
come across as a little 
unfriendly. 

441
00:27:45,720 --> 00:27:53,360
That was one of the really great
experiences about working at 

442
00:27:53,360 --> 00:28:01,240
Zyverge as they were getting the
Zeo 2 dot O release ready to 

443
00:28:01,920 --> 00:28:08,120
release. 
And so Zo one had a lot of 

444
00:28:08,120 --> 00:28:14,760
innovative features for Scala, 
but it was very clearly inspired

445
00:28:14,760 --> 00:28:22,160
by Haskell and a lot of the 
naming and concepts betrayed 

446
00:28:22,160 --> 00:28:26,800
that. 
And Zo 2, yes, there was. 

447
00:28:27,000 --> 00:28:30,520
There were many new features 
added and all sorts of 

448
00:28:30,520 --> 00:28:33,920
improvements, but I think the 
thing that stuck with me the 

449
00:28:33,920 --> 00:28:38,920
most was how much time they 
spent on the naming of all these

450
00:28:38,920 --> 00:28:48,920
things and just really having so
many long debates about, OK, 

451
00:28:49,000 --> 00:28:57,000
this thing has an established 
category theory term, and we're 

452
00:28:57,000 --> 00:29:01,800
going to get a lot of heat if we
don't just stick to that term. 

453
00:29:01,840 --> 00:29:06,800
Heat from who, though? 
Heat from the in Group. 

454
00:29:07,120 --> 00:29:11,360
Yes, he he from the people who 
already understand that stuff. 

455
00:29:12,160 --> 00:29:17,400
And so he just went top to 
bottom through the entire 

456
00:29:17,400 --> 00:29:24,240
project and said, what is the 
most easily understood and 

457
00:29:24,240 --> 00:29:29,840
discoverable name for all the 
capabilities in this library? 

458
00:29:29,840 --> 00:29:32,080
Guessability. 
Guessability. 

459
00:29:32,120 --> 00:29:35,320
Yeah, that's a huge part. 
They've optimized this for the 

460
00:29:35,320 --> 00:29:38,960
dot completion in the ID. 
So yeah, you've got an effect. 

461
00:29:39,320 --> 00:29:43,280
You hit dot and you get a whole 
bunch of options and a lot of 

462
00:29:43,280 --> 00:29:46,800
times you just guess the name of
what you're trying to do. 

463
00:29:47,120 --> 00:29:50,480
Retry. 
Oh, it's called retry and you 

464
00:29:50,480 --> 00:29:53,240
find it there in the list. 
And yeah, just has made it so 

465
00:29:53,240 --> 00:29:57,440
much easier to guess your way to
the operations that you want to 

466
00:29:57,440 --> 00:30:00,200
perform on the effects. 
Yeah, and the naming there, 

467
00:30:00,200 --> 00:30:02,760
there's retry and there's retry 
N. 

468
00:30:03,160 --> 00:30:08,040
And so they make sure that the 
variations of the end are at the

469
00:30:08,160 --> 00:30:13,720
end so that as long as you get 
that base, you tab complete up 

470
00:30:13,720 --> 00:30:17,240
to a point. 
And now you see, OK, there are 4

471
00:30:18,880 --> 00:30:21,920
variations of this one bit of 
functionality. 

472
00:30:21,920 --> 00:30:27,320
Which one is appropriate for me?
And so they really optimize for,

473
00:30:28,600 --> 00:30:32,560
even though it's a little bit 
clunkier to verbalize sometimes 

474
00:30:32,560 --> 00:30:37,240
because then we tend to put the 
adjectives in front when you're 

475
00:30:37,240 --> 00:30:40,440
writing code. 
It is a much smoother 

476
00:30:40,440 --> 00:30:43,400
experience. 
And yes, you still have to 

477
00:30:43,400 --> 00:30:48,200
consult the docs at various 
points, but it's far less than 

478
00:30:48,360 --> 00:30:52,680
some of the other functional 
programming approaches. 

479
00:30:52,680 --> 00:30:56,240
Well, because some of those came
from, or maybe a lot of them 

480
00:30:56,240 --> 00:31:00,200
came from the time before 
everyone used ID ES. 

481
00:31:00,520 --> 00:31:04,440
And to acknowledge that, Oh 
yeah, we all use these things 

482
00:31:04,440 --> 00:31:07,240
now. 
And so that should be a part of 

483
00:31:07,240 --> 00:31:10,520
the designing of your library is
really an important step 

484
00:31:10,520 --> 00:31:11,760
forward, I think. 
Yeah. 

485
00:31:14,000 --> 00:31:18,640
We should point out that the 
book is not intended for people 

486
00:31:18,640 --> 00:31:23,360
who already are Haskell 
functional programming experts. 

487
00:31:23,920 --> 00:31:26,640
There's a lot of people out 
there that already kind of know 

488
00:31:26,640 --> 00:31:31,840
what effects are and maybe want 
to know, like how Zeo works. 

489
00:31:32,560 --> 00:31:34,240
We're not trying to be that 
book. 

490
00:31:34,240 --> 00:31:37,800
We're not trying to be the the 
book for hardcore functional 

491
00:31:37,800 --> 00:31:40,080
programmers or the dive under 
the covers. 

492
00:31:40,080 --> 00:31:44,640
To it might make them mad yeah, 
cuz we, we have worked so hard 

493
00:31:44,640 --> 00:31:49,000
to to make it simple and and 
clear and to hide the underlying

494
00:31:49,000 --> 00:31:52,480
machinery. 
And if you're someone who says 

495
00:31:52,480 --> 00:31:56,520
no, no, you have to understand 
the underlying machinery, which 

496
00:31:56,520 --> 00:32:01,680
would, I feel like be the same 
as saying, well, you can't write

497
00:32:01,680 --> 00:32:04,800
a program until you understand 
how the compiler works. 

498
00:32:06,160 --> 00:32:15,240
I I think our audience is people
that want to use effect systems.

499
00:32:15,400 --> 00:32:19,160
It's not people that are going 
to build their own effect 

500
00:32:19,160 --> 00:32:23,280
system. 
We are not describing all the 

501
00:32:23,360 --> 00:32:30,640
theoretical underpinnings and 
how Zeo's runtime works under 

502
00:32:30,640 --> 00:32:34,320
the covers to be performant and 
give you all these guarantees. 

503
00:32:34,320 --> 00:32:37,280
Which I'm still curious. 
But that's a. 

504
00:32:37,640 --> 00:32:41,200
But realizing, I mean, and I for
a long time I thought I'm going 

505
00:32:41,320 --> 00:32:43,560
to have to understand all this 
because you guys were talking 

506
00:32:43,560 --> 00:32:46,000
about that and how it works. 
And I'm going, all right, I 

507
00:32:46,000 --> 00:32:48,600
guess I have to understand it. 
But then we got to this point 

508
00:32:48,600 --> 00:32:51,280
where I go, I can see what it's 
doing. 

509
00:32:52,000 --> 00:32:55,560
Like I'm programming with a 
language that I don't understand

510
00:32:55,560 --> 00:32:58,280
the underlying workings of. 
And it's OK. 

511
00:32:58,280 --> 00:33:03,440
And I think it's not just people
who want to use effect systems, 

512
00:33:03,440 --> 00:33:08,400
but more importantly people who 
want to know why would I want to

513
00:33:08,400 --> 00:33:14,000
use an effect system. 
Yeah, yeah. 

514
00:33:14,000 --> 00:33:19,400
So I think hopefully this is a 
book that's that is helpful for 

515
00:33:19,400 --> 00:33:22,200
that audience of people. 
It's not intended to be for 

516
00:33:22,200 --> 00:33:25,400
everyone. 
We one of the things I want to 

517
00:33:25,400 --> 00:33:30,040
talk about was how we we made 
some to kind of serve that goal.

518
00:33:30,320 --> 00:33:34,280
We put in some infrastructure 
when we read some book that 

519
00:33:34,320 --> 00:33:37,240
yeah, we spent a lot of time on 
book infrastructure. 

520
00:33:37,240 --> 00:33:40,840
Kind of surprising how complex 
art builds this. 

521
00:33:40,840 --> 00:33:42,480
Dumb you CI this. 
Dumb. 

522
00:33:42,480 --> 00:33:45,400
There's so much stuff. 
Yeah, which is is fascinating 

523
00:33:45,400 --> 00:33:48,800
that you know, you read the book
you you would have no idea just 

524
00:33:48,800 --> 00:33:52,840
how much work it is to get the 
examples to to build and be 

525
00:33:52,840 --> 00:33:56,440
correct and get the output 
correctly there and test. 

526
00:33:56,440 --> 00:33:59,920
So we we have a lot of tests for
our infrastructure for our book.

527
00:34:00,560 --> 00:34:02,480
Tell us about the forbidden 
words, Bill. 

528
00:34:03,000 --> 00:34:10,360
Yeah, so the forbidden words, 
that is our way of keeping 

529
00:34:10,360 --> 00:34:15,719
ourselves in check and not 
succumbing to the temptation of 

530
00:34:15,920 --> 00:34:21,840
getting into some of those 
underpinnings and just all the 

531
00:34:21,840 --> 00:34:28,239
things that are we propose you 
do not need. 

532
00:34:29,040 --> 00:34:35,679
And I I won't read the entire 
list here, but these are words 

533
00:34:35,679 --> 00:34:39,159
that we can guarantee you will 
not see in the pages. 

534
00:34:39,360 --> 00:34:41,520
So we actually have an 
integration test that we run 

535
00:34:41,520 --> 00:34:45,159
when we build the book and the 
build will fail if there is any 

536
00:34:45,159 --> 00:34:47,239
of these words in the book. 
Yes. 

537
00:34:47,239 --> 00:34:51,360
So I think the big obvious one 
up front, the elephant in the 

538
00:34:51,360 --> 00:34:56,639
room is monad. 
We we can describe effects 

539
00:34:56,639 --> 00:34:59,040
without monad. 
Yes. 

540
00:34:59,080 --> 00:35:02,160
Even though it is a monad, but 
we did not need it. 

541
00:35:02,280 --> 00:35:05,400
Yes. 
And I, I don't recall how much 

542
00:35:05,400 --> 00:35:09,840
time we spent implementing 
monads. 

543
00:35:10,400 --> 00:35:15,640
You know, probably two years ago
at this point, we just built up 

544
00:35:15,640 --> 00:35:20,400
monads over and over and over 
again trying to. 

545
00:35:20,440 --> 00:35:23,200
Reinvent it. 
Basically, yes it was. 

546
00:35:23,200 --> 00:35:25,000
Well, we already have Zeo, and 
that's the one we're going to 

547
00:35:25,000 --> 00:35:27,800
talk about. 
That's going to be the real 1, 

548
00:35:28,280 --> 00:35:30,760
but we want to implement a toy 
version, and we want to show 

549
00:35:30,760 --> 00:35:36,560
people how to make a monad. 
And we did that at least a half 

550
00:35:36,560 --> 00:35:42,760
dozen times over the course of 
probably a couple months, all 

551
00:35:42,760 --> 00:35:48,440
told, before ultimately just 
deciding no. 

552
00:35:48,760 --> 00:35:53,720
And that'll be a contentious one
with a lot of people, I'm sure. 

553
00:35:54,720 --> 00:35:56,840
Well, and I think it's worth 
going a little bit further than 

554
00:35:56,840 --> 00:36:00,440
this it monads are there. 
Yes. 

555
00:36:00,680 --> 00:36:06,480
But we were able to describe 
effects and have code that uses 

556
00:36:06,480 --> 00:36:09,760
effects. 
And we think that we 

557
00:36:09,760 --> 00:36:13,320
accomplished the goal of not 
needing to even say that these 

558
00:36:13,320 --> 00:36:17,360
are monads in the book. 
And you know, we'll love to hear

559
00:36:17,360 --> 00:36:20,360
feedback on that. 
But it, but we really, I think, 

560
00:36:20,360 --> 00:36:23,240
achieved this, this goal of 
like, like we don't have to get 

561
00:36:23,240 --> 00:36:26,200
into the functional programming 
terminology that can scare 

562
00:36:26,200 --> 00:36:29,080
people away. 
And maybe at some point people 

563
00:36:29,080 --> 00:36:31,120
discover, oh, these effects, 
they're monads. 

564
00:36:31,120 --> 00:36:33,520
And that's cool because they 
have these properties and you 

565
00:36:33,520 --> 00:36:36,280
know, but, but it was 
unnecessary for what we were 

566
00:36:36,280 --> 00:36:38,760
trying to. 
And certainly not at an 

567
00:36:38,760 --> 00:36:42,440
introductory level. 
And that kept blocking me 

568
00:36:42,440 --> 00:36:45,800
because there was all this math 
and stuff around the monads. 

569
00:36:45,800 --> 00:36:47,720
I'm going all right. 
I guess I have to understand 

570
00:36:47,720 --> 00:36:50,960
this, but now I realized no I 
didn't. 

571
00:36:51,000 --> 00:36:54,840
I guess the question somehow 
came up was do we have to do 

572
00:36:54,840 --> 00:36:58,040
this and somehow the answer was 
no. 

573
00:36:59,360 --> 00:37:02,360
So flat map is also on the 
forbidden word list because 

574
00:37:02,360 --> 00:37:06,880
that's the function used with 
monads and we do not need to 

575
00:37:06,880 --> 00:37:10,000
have a flat map in the book. 
And somebody had asked me on 

576
00:37:10,000 --> 00:37:13,280
Twitter when I shared the 
forbidden words list, how we got

577
00:37:13,280 --> 00:37:17,040
away with not using flat map. 
And thankfully in Zeo, there's 

578
00:37:17,040 --> 00:37:20,680
something called Zeo Direct 
which allows us to write the 

579
00:37:21,640 --> 00:37:25,080
essentially monadic code without
the flat maps and maps. 

580
00:37:25,120 --> 00:37:27,760
And so that which was. 
Brilliant. 

581
00:37:27,760 --> 00:37:29,640
Yeah, so. 
That was our, which I think 

582
00:37:29,640 --> 00:37:33,080
makes it much more approachable.
It's, you know, it's certainly 

583
00:37:33,080 --> 00:37:35,720
the flat maps are still there. 
They're just like, like 

584
00:37:35,720 --> 00:37:39,320
abstracted away. 
And so our readers don't need to

585
00:37:39,320 --> 00:37:42,000
think about flat maps. 
It's just like we're running 

586
00:37:42,000 --> 00:37:46,720
this code and yes, we are moving
things around in CPU registers, 

587
00:37:46,720 --> 00:37:48,440
but. 
It's on the jar of words. 

588
00:37:48,440 --> 00:37:51,480
I can show that, but we don't 
have to explain the jar of 

589
00:37:51,480 --> 00:37:55,120
virtual machine to you know. 
Yeah, yeah. 

590
00:37:55,120 --> 00:38:00,800
So thank you to Alexander Yoff 
for creating Zeo Direct. 

591
00:38:01,200 --> 00:38:10,080
It is just so fundamental to the
style of our book and let us 

592
00:38:10,080 --> 00:38:15,240
just sidestep so many of these 
off putting. 

593
00:38:15,720 --> 00:38:16,800
Concepts. 
Yeah. 

594
00:38:16,800 --> 00:38:19,160
There was like a week or two 
where we were going. 

595
00:38:19,480 --> 00:38:21,080
What? 
What we can. 

596
00:38:21,160 --> 00:38:23,960
What it just like, look, it all 
falls away. 

597
00:38:24,000 --> 00:38:26,840
Can we use this everywhere? 
Yes, we can. 

598
00:38:26,920 --> 00:38:29,440
OK, let's use this everywhere. 
And yeah, so we. 

599
00:38:30,480 --> 00:38:35,720
So historically flat map is how 
you deal with effects and monads

600
00:38:35,720 --> 00:38:39,600
and all that. 
And Scala took it a step forward

601
00:38:39,600 --> 00:38:44,560
by giving 4 comprehensions so 
that you in most situations 

602
00:38:44,560 --> 00:38:49,000
don't need to actually invoke 
flat map, you can just use the 

603
00:38:49,000 --> 00:38:52,880
for comprehension. 
And when we finally got to the 

604
00:38:52,880 --> 00:38:58,040
point of wait a minute, we don't
need a single for comprehension 

605
00:38:58,320 --> 00:39:04,560
in this book, and it's just one 
more step along that path to 

606
00:39:04,560 --> 00:39:07,560
making the code more 
approachable. 

607
00:39:07,560 --> 00:39:11,040
And I got to say, the only 
reason that I actually finally 

608
00:39:11,040 --> 00:39:15,160
understood 4 comprehensions is 
because we had it in this much 

609
00:39:15,160 --> 00:39:17,800
simpler form. 
And I go, oh, now I see what 

610
00:39:17,800 --> 00:39:19,200
it's. 
Oh, now I see what the four 

611
00:39:19,200 --> 00:39:21,400
comprehensions doing. 
All right, OK. 

612
00:39:21,520 --> 00:39:24,240
It is awkward. 
It's more, it's definitely so 

613
00:39:24,240 --> 00:39:26,880
much more awkward than this. 
And that's why it was confusing 

614
00:39:26,880 --> 00:39:27,640
to me. 
Yeah. 

615
00:39:28,720 --> 00:39:30,600
What else is on the forbidden 
word list? 

616
00:39:31,440 --> 00:39:35,760
Yes. 
So kind of paired with flat map,

617
00:39:36,240 --> 00:39:42,760
a big one was map, which I think
is one of the simpler functional

618
00:39:42,760 --> 00:39:50,960
programming concepts and was not
even on our radar as something 

619
00:39:50,960 --> 00:39:58,600
to avoid or eliminate. 
But as we whittled this down, 

620
00:39:58,760 --> 00:40:00,520
there came a point where we 
realized. 

621
00:40:00,880 --> 00:40:04,840
There's only like two or three 
places where we're even using 

622
00:40:04,840 --> 00:40:06,800
map here. 
And then we could take a closer 

623
00:40:06,800 --> 00:40:10,600
look at those and realize, no, 
we don't even need that. 

624
00:40:10,840 --> 00:40:15,520
Like we can just use Zeos for 
each operator. 

625
00:40:15,600 --> 00:40:20,280
And yeah, that does just, it 
reads a little simpler. 

626
00:40:20,280 --> 00:40:24,680
And I think people know if you 
say for each and then pass it a 

627
00:40:24,680 --> 00:40:31,040
collection, there's a pretty 
strong chance that the new 

628
00:40:31,040 --> 00:40:34,600
reader is not going to get 
what's going to happen. 

629
00:40:34,880 --> 00:40:36,920
Yeah, OK. 
Yeah. 

630
00:40:36,920 --> 00:40:40,320
So there was places where we 
would we would look at the 

631
00:40:40,320 --> 00:40:44,000
examples that we had and we'd be
like, there may be a way to make

632
00:40:44,000 --> 00:40:47,600
this more approachable. 
And I think we did a number of 

633
00:40:47,600 --> 00:40:51,560
those iterations where it's like
like we had the sense of of 

634
00:40:52,240 --> 00:40:55,160
removing this. 
Reframing it into a different 

635
00:40:55,160 --> 00:40:58,400
way will just help us achieve 
our goals of making this even 

636
00:40:58,400 --> 00:41:02,160
more approachable and accessible
to more developers. 

637
00:41:02,320 --> 00:41:04,440
I wish I could remember this. 
Specific one. 

638
00:41:04,440 --> 00:41:08,920
I know there is one that caught 
your attention and you tried to 

639
00:41:08,920 --> 00:41:14,160
rewrite it like so many, many 
times, you know you would. 

640
00:41:15,480 --> 00:41:18,480
We would end our group work 
time. 

641
00:41:18,480 --> 00:41:23,040
You'd go off and spend an entire
late night just trying to figure

642
00:41:23,040 --> 00:41:24,560
out how to get rid of this 
thing. 

643
00:41:25,560 --> 00:41:28,640
And I kept saying like, just 
forget it. 

644
00:41:28,640 --> 00:41:32,360
It's not worth it. 
Just tolerate that bit of 

645
00:41:32,360 --> 00:41:35,440
awkwardness. 
And you just kept returning to 

646
00:41:35,440 --> 00:41:41,280
it and kept returning to it. 
And months later, we finally 

647
00:41:41,280 --> 00:41:45,880
realized we we can't change just
that one line that's really 

648
00:41:45,880 --> 00:41:49,160
pissing you off. 
To reframe the whole concept, we

649
00:41:49,160 --> 00:41:51,040
could. 
Reframe the whole thing and then

650
00:41:51,040 --> 00:41:56,600
it just evaporated and that 
unease you felt and wouldn't 

651
00:41:56,600 --> 00:42:02,640
give up on finally paid off. 
And it was one of the crucial 

652
00:42:02,640 --> 00:42:06,360
steps to just eliminating 
another term and. 

653
00:42:06,520 --> 00:42:09,480
We probably have a forbidden 
word from that experience. 

654
00:42:09,760 --> 00:42:13,760
Yes, I can't. 
But forbidden word spawned out 

655
00:42:13,760 --> 00:42:16,080
of that. 
But now, as often what happened 

656
00:42:16,080 --> 00:42:21,920
is when we discover those 
frictiony, you know, the parts 

657
00:42:21,920 --> 00:42:26,480
that were rough that we thought 
were rough for readers, it would

658
00:42:26,480 --> 00:42:28,920
often result in adding a new 
forbidden word into the. 

659
00:42:28,920 --> 00:42:32,760
List So I had that experience. 
I was looking at some code while

660
00:42:32,760 --> 00:42:35,720
I was doing one of the many, 
many, many edit passes and I go,

661
00:42:36,440 --> 00:42:38,000
it seems like this could be 
better. 

662
00:42:38,000 --> 00:42:40,560
And so I asked the AI to rewrite
it, and it did. 

663
00:42:40,560 --> 00:42:43,640
And I go, that's why we didn't 
do it that way, because it 

664
00:42:43,640 --> 00:42:45,760
introduced one of those words, 
OK. 

665
00:42:48,200 --> 00:42:50,240
Yeah. 
So there was the occasional 

666
00:42:50,240 --> 00:42:55,480
compromise where maybe using 
this term would have made the 

667
00:42:55,480 --> 00:42:57,840
example a little simpler. 
But I think by and large it went

668
00:42:57,840 --> 00:43:03,960
the other way of we ended up 
boiling down our example and 

669
00:43:04,080 --> 00:43:09,680
just making it simpler because 
we didn't have the temptation of

670
00:43:09,680 --> 00:43:14,680
using any of these more advanced
things such as fold just another

671
00:43:14,680 --> 00:43:18,680
one and. 
I remember Love Fold but I do 

672
00:43:18,800 --> 00:43:21,640
too is not appropriate for this 
book. 

673
00:43:21,840 --> 00:43:28,040
I remember I don't know the name
of the blog post, but it was 

674
00:43:28,080 --> 00:43:32,440
just kind of a celebration of 
fold in the world of functional 

675
00:43:32,440 --> 00:43:35,360
programming. 
And I love the article, I still 

676
00:43:35,360 --> 00:43:39,280
do. 
And just showing like fold is 

677
00:43:39,280 --> 00:43:43,680
such a powerful fundamental 
operation and you can just turn 

678
00:43:43,680 --> 00:43:48,800
any data structure into any 
other data structure if you you 

679
00:43:48,800 --> 00:43:51,600
know describe a few basic 
operations. 

680
00:43:51,600 --> 00:43:55,240
It's like a basic atom of 
programming, but just at this. 

681
00:43:55,480 --> 00:43:58,200
Yeah, and you can derive so many
other things. 

682
00:43:58,240 --> 00:44:02,560
I mean really, Traverse is the 
but yeah. 

683
00:44:02,920 --> 00:44:07,480
So Fuld made the forbidden word.
List and there's. 

684
00:44:07,680 --> 00:44:09,000
We just didn't need it, you 
know? 

685
00:44:09,280 --> 00:44:10,960
Yeah, better ways to explain 
things. 

686
00:44:11,440 --> 00:44:17,360
And a couple other, the phrase 
category theory, we didn't want 

687
00:44:17,360 --> 00:44:20,680
to talk about that and then? 
There are other books for that. 

688
00:44:20,680 --> 00:44:22,640
There's actually some really 
fantastic yes. 

689
00:44:23,240 --> 00:44:27,560
When you understand why you 
would want to learn that stuff. 

690
00:44:27,760 --> 00:44:30,800
Yeah. 
So in the realm of category 

691
00:44:30,800 --> 00:44:35,880
theory, there's applicative 
monoid type class Funkdor. 

692
00:44:36,440 --> 00:44:44,480
These are all incredible 
innovations, discoveries in the 

693
00:44:44,480 --> 00:44:48,160
world of software. 
That enable this, but that you 

694
00:44:48,160 --> 00:44:50,440
don't need to understand in 
order to use it. 

695
00:44:50,960 --> 00:44:53,800
Yes. 
So I have nothing but good thing

696
00:44:54,240 --> 00:44:58,640
to say about those types of 
those concepts and I'm glad that

697
00:44:58,640 --> 00:45:02,520
all the people that toiled away 
and figured out how valuable 

698
00:45:02,520 --> 00:45:09,040
they were to facilitate software
that we can trust and really 

699
00:45:09,040 --> 00:45:14,720
count on to run properly. 
But we have shielded the 

700
00:45:15,320 --> 00:45:18,040
hypothetical reader from any of 
that stuff. 

701
00:45:18,400 --> 00:45:22,480
Like I would say I'm amazed. 
I mean, seriously, after all the

702
00:45:22,480 --> 00:45:26,400
stuff we waded through, I just, 
I never thought it could be 

703
00:45:26,720 --> 00:45:30,280
reduced to this level of 
simplicity and clarity. 

704
00:45:30,560 --> 00:45:35,640
Yeah, so and so concisely. 
I mean, it's like a. 140 pages 

705
00:45:35,640 --> 00:45:38,000
or whatever. 
It's, it's a pretty short read 

706
00:45:39,040 --> 00:45:43,200
and we think that's a good thing
because hopefully we have put so

707
00:45:43,200 --> 00:45:47,800
much work into making it this 
concise that that's, that 

708
00:45:47,800 --> 00:45:49,280
creates a lot of value for the 
readers. 

709
00:45:49,480 --> 00:45:53,200
I'm, I was wondering if you had 
to guess how much more code we 

710
00:45:53,200 --> 00:45:56,920
actually wrote versus how much 
code is in the book. 

711
00:45:57,240 --> 00:46:03,960
Like 10X like, likely more like 
30X like like, We've written so 

712
00:46:03,960 --> 00:46:08,080
much code to get to the place 
that we got to with the code 

713
00:46:08,080 --> 00:46:10,120
that's actually in the book. 
Yeah. 

714
00:46:10,400 --> 00:46:17,560
And to again, talk about things 
that I appreciate but don't want

715
00:46:17,560 --> 00:46:23,800
to replicate with our book. 
The Red Book is a famous or 

716
00:46:23,840 --> 00:46:30,880
infamous book depending on your 
perspective, which is it's It's 

717
00:46:30,880 --> 00:46:38,040
an incredible accomplishment and
the way it lets you build up all

718
00:46:38,040 --> 00:46:40,680
these concepts. 
The title is Functional 

719
00:46:40,680 --> 00:46:42,440
Programming in Scotland. 
Yes. 

720
00:46:42,440 --> 00:46:45,040
By Brunei and Paul. 
And it's Manning. 

721
00:46:45,760 --> 00:46:47,280
Yes, Manning Press. 
Yeah. 

722
00:46:47,280 --> 00:46:50,840
A fantastic book by fantastic 
authors. 

723
00:46:50,960 --> 00:46:56,720
Yeah, again, all great. 
But I know so many people in 

724
00:46:56,720 --> 00:47:00,840
addition to myself, and they 
just crashed on the rocks of 

725
00:47:00,840 --> 00:47:05,040
trying to get cover to cover in 
that book. 

726
00:47:05,120 --> 00:47:08,880
And I don't know how many 
attempts it took me to get 

727
00:47:08,880 --> 00:47:11,120
through all of it. 
And I actually don't even know 

728
00:47:11,120 --> 00:47:15,560
if I finished the last couple of
chapters because it is, it's so 

729
00:47:15,680 --> 00:47:24,920
dense and it it it's so precise.
It is, it is very impressive. 

730
00:47:25,520 --> 00:47:29,360
But I would love to know the 
stats on how many people started

731
00:47:29,360 --> 00:47:34,040
it versus completed it. 
I got all the way through, but I

732
00:47:34,040 --> 00:47:38,160
feel like I understood maybe 
half of the easier stuff. 

733
00:47:38,320 --> 00:47:41,560
Yeah. 
But yeah, we wanted to have a 

734
00:47:41,560 --> 00:47:43,920
book that people could get all 
the way through and hopefully 

735
00:47:44,040 --> 00:47:47,280
understand everything. 
And it took a lot of, a lot of 

736
00:47:47,280 --> 00:47:51,200
exploration over years to be 
able to get to the conciseness 

737
00:47:51,480 --> 00:47:55,040
that we arrived. 
At yeah, yeah, I'm pretty 

738
00:47:55,040 --> 00:47:59,280
pleased with it. 
Any last words and do we want to

739
00:47:59,280 --> 00:48:02,240
share the podcast? 
I think we should the the AI 

740
00:48:02,440 --> 00:48:04,040
podcast. 
I absolutely think we should. 

741
00:48:04,040 --> 00:48:07,800
So just as a mind blowing. 
Put that at the end of the just.

742
00:48:07,800 --> 00:48:12,200
As a mind blower, just like all 
synthesized because we were, 

743
00:48:12,320 --> 00:48:17,720
yeah, we were traveling 
someplace and you decided to 

744
00:48:17,840 --> 00:48:20,680
feed the whole book into. 
I put a book into Google's 

745
00:48:20,680 --> 00:48:24,240
notebook LM Yeah. 
And in like 3 minutes it created

746
00:48:24,240 --> 00:48:27,440
this podcast. 
Which is like in it's. 

747
00:48:27,600 --> 00:48:29,360
Yeah. 
And they came up with new 

748
00:48:29,360 --> 00:48:31,000
analogies that we never thought 
of. 

749
00:48:31,000 --> 00:48:34,920
I'm not sure if they're great 
analogies, but still different. 

750
00:48:34,960 --> 00:48:37,040
I, you know, I don't know. 
We were all just blunt. 

751
00:48:37,040 --> 00:48:40,120
That'd be helpful, yeah. 
And maybe the feedback we get is

752
00:48:40,120 --> 00:48:43,520
that we can just replace us with
AI in the future. 

753
00:48:43,520 --> 00:48:47,440
Well, we're we're lazy about the
podcast, so. 

754
00:48:48,200 --> 00:48:50,720
It does make a few mistakes on 
pronunciations. 

755
00:48:50,800 --> 00:48:54,920
It does layers, yeah. 
But I mean, you know, my theory 

756
00:48:54,920 --> 00:48:58,560
is that that's to keep us from 
panicking about it's, it's all 

757
00:48:58,560 --> 00:49:02,120
part of the grand scheme of the 
AI, the minds to keep us from 

758
00:49:02,560 --> 00:49:05,120
freaking out there go, Oh yeah, 
it's it's still. 

759
00:49:05,360 --> 00:49:07,920
Make a few intentional mistakes.
Exactly. 

760
00:49:08,160 --> 00:49:10,160
Keep the humans from getting 
over excited. 

761
00:49:10,920 --> 00:49:13,600
Yeah, anything. 
Else. 

762
00:49:16,520 --> 00:49:20,200
Effectorientedprogramming.com 
you go there, all the links are 

763
00:49:20,200 --> 00:49:22,240
there. 
You can buy the print book, you 

764
00:49:22,240 --> 00:49:26,240
can buy the e-book. 
We also have how to set up. 

765
00:49:26,600 --> 00:49:30,600
Hopefully the instructions are 
careful and clear how to set up 

766
00:49:30,680 --> 00:49:34,920
and run the examples on your 
computer, which you can try even

767
00:49:34,920 --> 00:49:37,400
without the book, so it's all 
there. 

768
00:49:37,600 --> 00:49:40,560
Yeah. 
So if you prefer the paper 

769
00:49:40,560 --> 00:49:44,680
version, you can get that. 
But I would say this is a book 

770
00:49:44,680 --> 00:49:48,040
where that was kind of the 
afterthought. 

771
00:49:48,080 --> 00:49:54,200
Oh yeah. 
We, we want this to be read on 

772
00:49:54,200 --> 00:50:00,800
your phone and to just for you 
to be surprised that you never 

773
00:50:00,800 --> 00:50:04,840
had to switch devices. 
You never had to jump over to a 

774
00:50:04,960 --> 00:50:08,840
wide screen monitor, right? 
But it'll also work on your you 

775
00:50:08,840 --> 00:50:12,760
know, you can load it onto your 
Kindle or your iPad and those 

776
00:50:12,760 --> 00:50:16,440
are really good experiences. 
And then there's APDF version. 

777
00:50:16,440 --> 00:50:18,760
So if you just want to read it 
on your screen, that's probably 

778
00:50:18,760 --> 00:50:22,960
nicest version or even, or even 
print out some of the pages from

779
00:50:22,960 --> 00:50:25,200
there. 
So it's available in all these 

780
00:50:25,200 --> 00:50:28,360
formats, but the but the book 
itself is nice. 

781
00:50:28,360 --> 00:50:30,320
The people seem to really like 
the cover. 

782
00:50:30,880 --> 00:50:35,520
We had our designer create it 
for us and it was part of it was

783
00:50:35,520 --> 00:50:39,280
inspired because 2001 is Bill's 
favorite movie. 

784
00:50:39,280 --> 00:50:42,800
And, and there's a there's a 
certain analogy to the, to the 

785
00:50:42,800 --> 00:50:46,200
monolith and, and we'll, we'll 
let you figure that out. 

786
00:50:48,880 --> 00:50:49,680
Fun. 
All right. 

787
00:50:50,000 --> 00:50:57,120
Well, yay, we did. 
Hopefully people get something 

788
00:50:57,120 --> 00:50:59,120
out of it. 
All right. 

789
00:50:59,120 --> 00:51:00,760
Thanks. 
Ever feel like your codes about 

790
00:51:00,760 --> 00:51:02,800
to go up in smoke with one wrong
keystroke? 

791
00:51:03,560 --> 00:51:06,080
Like you're constantly playing 
whack a mole with unpredictable 

792
00:51:06,080 --> 00:51:07,600
problems. 
Oh, tell me about it. 

793
00:51:07,720 --> 00:51:10,400
Database is acting up, API is 
timing out. 

794
00:51:11,080 --> 00:51:13,160
It's like trying to herd cats. 
Right. 

795
00:51:13,480 --> 00:51:16,240
But what if there was a way to 
make those unpredictable parts, 

796
00:51:16,800 --> 00:51:19,680
well, predictable? 
That's where effect oriented 

797
00:51:19,680 --> 00:51:21,920
programming comes in. 
That's the idea, anyway. 

798
00:51:22,040 --> 00:51:25,240
We're diving into Effect 
Oriented Programming, a new 

799
00:51:25,240 --> 00:51:29,800
paradigm for creating reliable, 
adaptable, testable systems, to 

800
00:51:29,800 --> 00:51:32,840
see if it lives up to the hype. 
This book is all about creating 

801
00:51:32,840 --> 00:51:34,920
systems that can handle whatever
you throw at them. 

802
00:51:34,920 --> 00:51:37,360
Yeah, and a big part of that is 
how they deal with these 

803
00:51:37,360 --> 00:51:40,880
so-called effects. 
Basically any part of your code 

804
00:51:40,880 --> 00:51:42,840
that interacts with the outside 
world. 

805
00:51:43,400 --> 00:51:45,200
Those are where things get 
unpredictable. 

806
00:51:45,200 --> 00:51:49,040
So anything that's not just like
pure calculation within my code?

807
00:51:49,240 --> 00:51:51,840
Exactly. 
Think about saving data to a 

808
00:51:51,840 --> 00:51:54,720
database that's in effect. 
You're sending data out into the

809
00:51:54,720 --> 00:51:58,640
wild hoping for the best, but 
anything could go wrong. 

810
00:51:59,440 --> 00:52:02,160
Don't remind me. 
Just last week I had some code 

811
00:52:02,160 --> 00:52:04,960
go haywire because I totally 
blanked on time zones. 

812
00:52:05,160 --> 00:52:07,360
Didn't even consider it. 
Happens to the best of us, 

813
00:52:07,360 --> 00:52:09,680
believe me. 
And that's often how technical 

814
00:52:09,680 --> 00:52:11,960
debt creeps in. 
You know those quick fixes and 

815
00:52:11,960 --> 00:52:14,080
workarounds that seem fine in 
the moment? 

816
00:52:14,080 --> 00:52:16,880
But come back to haunt you 
later, like patching a leaky 

817
00:52:17,040 --> 00:52:19,240
pipe with duct tape. 
Perfect analogy. 

818
00:52:19,240 --> 00:52:21,600
You might hold things together 
for a bit, but eventually. 

819
00:52:21,840 --> 00:52:24,080
You're calling in a very 
expensive plumber. 

820
00:52:24,400 --> 00:52:28,840
So is this effect oriented 
programming these effects they 

821
00:52:28,840 --> 00:52:30,720
talk about? 
Is this the solution? 

822
00:52:30,840 --> 00:52:32,800
The non duct tape approach to 
coding? 

823
00:52:32,960 --> 00:52:34,680
It can be a powerful tool for 
sure. 

824
00:52:34,920 --> 00:52:37,480
Instead of just crossing your 
fingers and hoping for the best,

825
00:52:37,480 --> 00:52:40,320
it makes you think about those 
what if scenarios upfront. 

826
00:52:40,480 --> 00:52:42,680
So you're designing for 
resilience from day one? 

827
00:52:42,760 --> 00:52:45,240
I like the sound of that. 
How does this all work in 

828
00:52:45,240 --> 00:52:47,960
practice though? 
Well, it's not tied to one 

829
00:52:47,960 --> 00:52:50,760
specific language or anything. 
It's more like a mindset shift. 

830
00:52:51,240 --> 00:52:55,040
This book focuses on a system 
called Zio, which is just one 

831
00:52:55,040 --> 00:52:58,080
way to do it, but the principles
apply more broadly. 

832
00:52:58,080 --> 00:53:00,520
OK, so Zio it is. 
For today at least. 

833
00:53:00,800 --> 00:53:03,640
Let's dig in and see how it 
actually helps us wrangle those 

834
00:53:03,640 --> 00:53:06,480
unruly effects and build 
something that lasts. 

835
00:53:07,320 --> 00:53:10,120
All right, so Zio helps us write
more resilient code. 

836
00:53:10,120 --> 00:53:12,680
I get that. 
But how does that actually work 

837
00:53:12,680 --> 00:53:15,600
when I'm knee deep in code? 
OK, let's go back to that time 

838
00:53:15,600 --> 00:53:17,800
zone issue you mentioned. 
Say you're building something 

839
00:53:17,800 --> 00:53:20,600
that needs to send notifications
to users in different time 

840
00:53:20,600 --> 00:53:22,040
zones. 
So been there, messed that up. 

841
00:53:22,200 --> 00:53:24,440
Right. 
So with Zio, instead of just 

842
00:53:24,440 --> 00:53:27,720
assuming the time zone 
conversions will work, you can 

843
00:53:27,720 --> 00:53:30,600
actually treat that time zone 
look up as effect. 

844
00:53:30,920 --> 00:53:32,520
Like, hey, this could go 
sideways. 

845
00:53:32,720 --> 00:53:36,640
OK, yeah, but how does that 
actually help me avoid making 

846
00:53:36,640 --> 00:53:39,680
the same mistake? 
So that's where those Zio 

847
00:53:39,680 --> 00:53:43,040
superpowers come into play. 
It gives you these tools for 

848
00:53:43,040 --> 00:53:46,480
handling potential problems. 
One of them is called retrying. 

849
00:53:46,560 --> 00:53:50,160
Retry in like, try again a 
certain number of times. 

850
00:53:50,160 --> 00:53:51,800
Exactly. 
It's like a safety net. 

851
00:53:51,800 --> 00:53:56,360
You can tell Zio if this thing 
fails, try again up to say three

852
00:53:56,360 --> 00:53:59,000
times before you give. 
Up and if it still fails after 

853
00:53:59,000 --> 00:54:01,280
all those retries. 
Then what? 

854
00:54:01,280 --> 00:54:04,480
Then you've got options. 
You could log the error, show 

855
00:54:04,480 --> 00:54:06,880
the user a friendly message, or 
try a different approach 

856
00:54:06,880 --> 00:54:08,440
altogether. 
You're not just left high and 

857
00:54:08,440 --> 00:54:10,320
dry. 
So instead of my code being this

858
00:54:10,320 --> 00:54:12,840
fragile House of Cards. 
They are like a. 

859
00:54:12,840 --> 00:54:15,360
Bouncy Castle. 
I was going to say a sturdy oak,

860
00:54:15,360 --> 00:54:16,960
but I like the bouncy castle. 
Right. 

861
00:54:16,960 --> 00:54:18,680
You can handle a few bumps and 
still be fine. 

862
00:54:18,680 --> 00:54:21,560
Yeah. 
So what else we got besides this

863
00:54:21,560 --> 00:54:24,640
retry in thing? 
There's or else fail for one. 

864
00:54:24,800 --> 00:54:27,360
Or else fail. 
OK, what's that one do? 

865
00:54:27,680 --> 00:54:31,520
So say your time zone look up 
just totally tanks with or else 

866
00:54:31,520 --> 00:54:33,000
fail. 
You can tell your code all 

867
00:54:33,000 --> 00:54:34,840
right. 
If that fails, do this other 

868
00:54:34,840 --> 00:54:38,440
thing instead, like use a 
default time zone or tell the 

869
00:54:38,440 --> 00:54:40,120
user there might be a slight 
delay. 

870
00:54:40,360 --> 00:54:42,840
That is incredibly useful. 
I can think of a million 

871
00:54:42,840 --> 00:54:46,200
situations where you need a Plan
B for when things go wrong. 

872
00:54:46,280 --> 00:54:48,240
Exactly. 
And these tools aren't just for 

873
00:54:48,240 --> 00:54:51,000
handling errors either. 
You can use them to model all 

874
00:54:51,000 --> 00:54:53,880
sorts of complex logic 
interactions with the external 

875
00:54:53,880 --> 00:54:56,520
systems, anything that might be 
unpredictable. 

876
00:54:56,520 --> 00:54:59,280
OK, I'm getting sold on these 
Zio superpowers, I have to say. 

877
00:54:59,280 --> 00:55:02,920
But I got to be honest, 
sometimes just managing all the 

878
00:55:02,920 --> 00:55:05,800
different parts of my code, all 
those dependencies, it feels 

879
00:55:05,800 --> 00:55:09,120
like a full time job in itself. 
Yeah, dependency management can 

880
00:55:09,120 --> 00:55:12,200
be a real headache, but just 
like with effects, Zio has a 

881
00:55:12,200 --> 00:55:14,200
pretty elegant way to handle 
that too. 

882
00:55:14,440 --> 00:55:18,040
So we've got these awesome tools
to deal with effects, those 

883
00:55:18,040 --> 00:55:20,280
unpredictable things our code 
has to do. 

884
00:55:20,920 --> 00:55:24,680
But what about managing all the 
moving parts inside our code? 

885
00:55:24,960 --> 00:55:28,160
All those dependencies. 
You mean like databases? 

886
00:55:28,160 --> 00:55:31,200
AP is all those things our code 
needs to actually work. 

887
00:55:31,360 --> 00:55:33,440
Exactly. 
It can feel like a juggling axe 

888
00:55:33,440 --> 00:55:35,520
sometimes, especially as your 
project grows. 

889
00:55:35,520 --> 00:55:37,080
Totally. 
But just like with those 

890
00:55:37,080 --> 00:55:40,160
effects, ZI OS got our back. 
It's got this thing called 

891
00:55:40,160 --> 00:55:41,400
zlayers. 
Z layers. 

892
00:55:41,400 --> 00:55:44,320
OK, I'm listening. 
How do they help wrangle 

893
00:55:44,320 --> 00:55:47,160
dependencies? 
Think of AZ layer like a recipe 

894
00:55:47,160 --> 00:55:49,720
for your dependencies. 
It's not just a shopping list of

895
00:55:49,720 --> 00:55:52,160
ingredients, but actual 
instructions for how to put them

896
00:55:52,160 --> 00:55:53,760
together. 
So instead of saying I need 

897
00:55:53,760 --> 00:55:56,840
flour, it's like, here's how to 
get the flour and oh, maybe sift

898
00:55:56,840 --> 00:55:58,720
it first while you're at it. 
Exactly. 

899
00:55:58,720 --> 00:56:01,600
It's about making those 
dependencies really clear and, 

900
00:56:01,600 --> 00:56:05,000
well, reproducible. 
So let's say you need to talk to

901
00:56:05,000 --> 00:56:08,240
a database with layers. 
You'd create a layer 

902
00:56:08,240 --> 00:56:11,040
specifically for that database 
connection. 

903
00:56:11,160 --> 00:56:14,080
And this layer would handle all 
the messy details like actually 

904
00:56:14,080 --> 00:56:17,360
connecting, handling any errors,
closing the connection properly,

905
00:56:17,360 --> 00:56:18,360
all that. 
All of it. 

906
00:56:18,560 --> 00:56:20,200
It's all neatly packaged in one 
place. 

907
00:56:20,200 --> 00:56:22,840
Makes your code way cleaner and 
easier to understand. 

908
00:56:23,200 --> 00:56:25,280
And here's the cool part. 
These layers work great 

909
00:56:25,280 --> 00:56:26,840
together. 
You can compose them. 

910
00:56:26,840 --> 00:56:30,160
Compose like music. 
Are we writing symphonies of 

911
00:56:30,160 --> 00:56:33,640
dependencies now? 
Not quite symphonies, but you 

912
00:56:33,640 --> 00:56:35,880
get the idea. 
If one layer needs something 

913
00:56:35,880 --> 00:56:38,800
from another layer, say your 
database layer needs some config

914
00:56:38,800 --> 00:56:40,360
settings, you just stack them 
together. 

915
00:56:40,400 --> 00:56:44,280
Each layer adds its own piece. 
OK, so it's less like a tangled 

916
00:56:44,280 --> 00:56:45,920
mess of dependencies and more 
like. 

917
00:56:46,040 --> 00:56:47,560
More like I. 
Was going to say a well 

918
00:56:47,560 --> 00:56:49,920
organized Bento box. 
Everything in its place. 

919
00:56:50,040 --> 00:56:51,600
Perfect. 
And you know what else? 

920
00:56:51,840 --> 00:56:54,880
This whole Zealer thing. 
It makes testing a lot smoother 

921
00:56:54,880 --> 00:56:55,960
too. 
Oh really? 

922
00:56:55,960 --> 00:56:58,920
Because testing with 
dependencies can be a real pain.

923
00:56:59,000 --> 00:57:01,560
Right, you're always having to 
create these fake regions of 

924
00:57:01,560 --> 00:57:03,920
your dependencies, mocking 
things out. 

925
00:57:04,240 --> 00:57:06,960
It's a lot of extra work and it 
can be error prone. 

926
00:57:07,520 --> 00:57:09,400
Tell me about it. 
And then there are those weird 

927
00:57:09,400 --> 00:57:11,960
edge cases that only seem to pop
up in production. 

928
00:57:12,080 --> 00:57:15,440
Well, with zlayers you can swap 
out those real dependencies for 

929
00:57:15,440 --> 00:57:17,920
test versions in a controlled 
way. 

930
00:57:18,400 --> 00:57:21,000
Want to see how your code 
handles a database error? 

931
00:57:21,280 --> 00:57:24,040
Just create a special test layer
that simulates that error. 

932
00:57:24,040 --> 00:57:25,880
Boom, done. 
OK, now you're just making me 

933
00:57:25,880 --> 00:57:27,960
excited. 
So no more late night debugging 

934
00:57:27,960 --> 00:57:30,920
marathons trying to figure out 
why my code hates me. 

935
00:57:31,200 --> 00:57:34,920
I can't promise that, but it 
definitely gives you more 

936
00:57:34,920 --> 00:57:38,360
control, more predictability, 
and that means more reliable, 

937
00:57:38,360 --> 00:57:41,120
testable code, which is always a
good thing, right? 

938
00:57:41,400 --> 00:57:44,960
Use it to my ears. 
So to wrap things up, it sounds 

939
00:57:44,960 --> 00:57:47,440
like effect oriented 
programming, especially with a 

940
00:57:47,440 --> 00:57:51,000
tool like Zao, can really help 
us wrangle those unpredictable 

941
00:57:51,000 --> 00:57:54,440
parts of coding, from handling 
those external gremlins with 

942
00:57:54,440 --> 00:57:57,320
effects to keeping our 
dependencies in line with Z 

943
00:57:57,320 --> 00:57:59,320
layers. 
It's a whole new way of thinking

944
00:57:59,320 --> 00:58:01,640
about software development. 
We're not just hoping for the 

945
00:58:01,640 --> 00:58:04,680
best anymore, we're designing 
for resilience from the ground 

946
00:58:04,680 --> 00:58:05,760
up. 
Love it. 

947
00:58:06,360 --> 00:58:08,800
All right folks, if you're ready
to ditch the duct tape and build

948
00:58:08,800 --> 00:58:10,920
some rock solid code, check out 
the show notes. 

949
00:58:11,200 --> 00:58:13,680
We've got links to more 
resources on effect oriented 

950
00:58:13,680 --> 00:58:16,040
programming and Zio. 
Happy coding.

