1
00:00:08,193 --> 00:00:09,580
Hey, I'm Michael Dyrynda.

2
00:00:10,151 --> 00:00:11,316
And I'm Jake Bennett.

3
00:00:11,785 --> 00:00:17,304
and welcome to episode 152 of the North
Meets South web podcast.

4
00:00:20,233 --> 00:00:22,135
You know, I like our long intro music.

5
00:00:22,135 --> 00:00:25,319
I just, it was such a good song, such a
good intro.

6
00:00:25,319 --> 00:00:26,539
I mean, you know?

7
00:00:26,539 --> 00:00:31,528
but you listen to all the podcasts now and
all of them are just straight into it and,

8
00:00:31,528 --> 00:00:36,036
and since that is where everybody else.

9
00:00:36,078 --> 00:00:41,047
We're just following the whole, you know,
no uniqueness necessary.

10
00:00:41,047 --> 00:00:44,364
Just you know, follow the limit lemmings
right off the cliff.

11
00:00:44,364 --> 00:00:48,806
No, no, I put all of my uniqueness into
other things.

12
00:00:48,806 --> 00:00:52,268
It's my hair, my hair.

13
00:00:52,748 --> 00:00:55,510
Someone said to me the other day, what
color is coming next?

14
00:00:55,510 --> 00:00:56,190
I said, I don't know.

15
00:00:56,190 --> 00:01:01,813
It's just, Eli's got his school sports day
coming up next week, I think.

16
00:01:01,934 --> 00:01:04,395
So I will, I will go, he's in team blue.

17
00:01:04,395 --> 00:01:07,816
So I will, I'll put some blue stuff in my
hair for that.

18
00:01:07,981 --> 00:01:10,021
There you go, there you go.

19
00:01:10,702 --> 00:01:11,642
Nice.

20
00:01:11,922 --> 00:01:14,483
Hey, it's like that surfer blonde.

21
00:01:14,483 --> 00:01:18,585
It's nearing the end of the summer, you're
mourning the loss of summertime.

22
00:01:18,585 --> 00:01:20,286
So hey, I get it.

23
00:01:20,286 --> 00:01:21,927
I understand, I understand.

24
00:01:21,927 --> 00:01:26,048
Hey, today I got, see if you can tell what
I'm showing you.

25
00:01:26,389 --> 00:01:28,491
got some new AirPods at last.

26
00:01:28,717 --> 00:01:32,359
Yes, because the old ones were absolute
garbage.

27
00:01:32,580 --> 00:01:37,565
And the only way I know they did it.

28
00:01:37,565 --> 00:01:41,207
Yeah, and they would the left.

29
00:01:41,308 --> 00:01:42,391
Yeah, yeah.

30
00:01:42,391 --> 00:01:47,614
then you reset them a few times and they
get better and then they crackle again.

31
00:01:47,614 --> 00:01:51,396
And then it's like really annoying, but
you're like, no, it's not that bad.

32
00:01:51,396 --> 00:01:54,899
Like I don't need to, and then re, and I
was complaining to re about it.

33
00:01:54,899 --> 00:01:55,959
And she's like, just get new ones.

34
00:01:55,959 --> 00:01:56,900
I said, no, that's fine.

35
00:01:56,900 --> 00:01:58,281
And then she had

36
00:01:58,281 --> 00:02:03,131
reason to use them one time and she was
like, get new ones now you can't you can't

37
00:02:03,131 --> 00:02:04,172
do this now

38
00:02:04,586 --> 00:02:08,029
And like honestly, like my right mic, they
wouldn't work if the microphone was on the

39
00:02:08,029 --> 00:02:08,409
right ear.

40
00:02:08,409 --> 00:02:11,411
So I had to switch it to the left ear
because the microphone stopped working.

41
00:02:11,411 --> 00:02:14,354
And so like if I ever just had the right
one in a phone call came and I couldn't

42
00:02:14,354 --> 00:02:16,055
pick it up, so that's kind of left was
annoying.

43
00:02:16,055 --> 00:02:18,917
And then when I would put my finger on my
left one to like adjust it, it would

44
00:02:18,917 --> 00:02:21,539
whistle like a whee in my ear.

45
00:02:21,579 --> 00:02:22,500
Really high pitched.

46
00:02:22,500 --> 00:02:23,801
Oh, so annoying.

47
00:02:23,801 --> 00:02:24,581
every now and then.

48
00:02:24,581 --> 00:02:25,802
And it would just happen at random as
well.

49
00:02:25,802 --> 00:02:27,302
And you'd be like, ah.

50
00:02:27,302 --> 00:02:31,964
So I think, you know, it's, it's just the
AirPods, but yeah, the new, the new ones

51
00:02:31,964 --> 00:02:32,745
are nice.

52
00:02:32,745 --> 00:02:35,206
I, they often fall out of my pocket.

53
00:02:35,646 --> 00:02:39,868
And so they just end up somewhere and it's
the worst when they fall out of my pocket

54
00:02:39,868 --> 00:02:44,070
when I do, you know, bedtime with, with
the kids and they're out, they're like

55
00:02:44,070 --> 00:02:45,270
left in the bed.

56
00:02:45,270 --> 00:02:50,692
And it's like, so now, you know, they've
got fine my they're much better with, but

57
00:02:50,692 --> 00:02:51,372
like

58
00:02:51,781 --> 00:02:54,671
The little microphone at the bottom.

59
00:02:54,671 --> 00:02:55,148
Yeah.

60
00:02:55,148 --> 00:02:58,612
when you, you know, suspect that you've
dropped them in someone's bed because you

61
00:02:58,612 --> 00:03:02,295
don't want to wake them up with that
chirping, but they are quite handy.

62
00:03:02,416 --> 00:03:03,386
Much easier to find now.

63
00:03:03,386 --> 00:03:05,388
ones, so let's see if you if you couldn't
find them, you can find them.

64
00:03:05,388 --> 00:03:08,072
There was no, you know, yeah.

65
00:03:08,072 --> 00:03:08,567
And so

66
00:03:08,567 --> 00:03:13,211
Orenstein, Adam Wathen school of AirPods,
as soon as you have to spend more than 30

67
00:03:13,211 --> 00:03:16,635
seconds looking for them, you just go on
apple.com and you buy Nuance.

68
00:03:16,635 --> 00:03:18,657
That's it.

69
00:03:18,657 --> 00:03:21,439
They'll turn up eventually, but you just
get another pair.

70
00:03:21,639 --> 00:03:23,942
I think Adam's got like five or six fixed
pairs.

71
00:03:23,942 --> 00:03:27,385
The last time I saw his, he's, he's like,
you know, you know, you go to the swingers

72
00:03:27,385 --> 00:03:30,187
party and they put the keys in the bowl
where he's just got a bowl full of

73
00:03:30,187 --> 00:03:31,088
AirPods.

74
00:03:31,221 --> 00:03:31,802
Mm-hmm.

75
00:03:31,802 --> 00:03:32,722
Yep, just doesn't matter.

76
00:03:32,722 --> 00:03:33,662
They're all interchangeable.

77
00:03:33,662 --> 00:03:35,843
Just pick up a pair, put them in your
ears.

78
00:03:35,983 --> 00:03:36,804
That's pretty funny.

79
00:03:36,804 --> 00:03:38,484
Yeah, that's pretty funny.

80
00:03:39,085 --> 00:03:42,466
I was looking at AirPod Max and I'm like,
I don't know.

81
00:03:43,007 --> 00:03:45,608
I would consider getting some just for
like when I'm sitting down for a long

82
00:03:45,608 --> 00:03:46,468
coding session.

83
00:03:46,468 --> 00:03:47,628
Yeah, do you use them?

84
00:03:48,749 --> 00:03:53,533
Uh, usually only when I go to the office,
cause of the, cause like these are good

85
00:03:53,533 --> 00:03:58,097
for noise canceling, but they don't like
block sound, whereas those are much

86
00:03:58,097 --> 00:04:01,199
better, the over eating to just block out.

87
00:04:01,240 --> 00:04:05,263
Um, but I don't, when I'm at home, I've
just got the app, the home pods here.

88
00:04:05,263 --> 00:04:07,866
So I've just got the home pods going on
all the time.

89
00:04:07,866 --> 00:04:12,750
I don't really, they're good at night when
I want, like there are some TV shows that

90
00:04:12,750 --> 00:04:15,992
I want to, you know, like we just watch.

91
00:04:16,737 --> 00:04:20,161
And it's fine if it's like it's dialogue
or there's not much going on, but there

92
00:04:20,161 --> 00:04:22,543
are some shows like Halo, for example.

93
00:04:22,604 --> 00:04:24,786
I want to watch that with full volume.

94
00:04:24,786 --> 00:04:27,168
So I'll put the, the max on.

95
00:04:28,777 --> 00:04:29,579
Is it on what?

96
00:04:29,579 --> 00:04:30,100
What channel is that?

97
00:04:30,100 --> 00:04:31,664
Is it on Netflix or is it on Apple TV?

98
00:04:31,664 --> 00:04:31,965
Plot?

99
00:04:31,965 --> 00:04:32,866
What is it?

100
00:04:33,168 --> 00:04:33,749
Oh, Paramount.

101
00:04:33,749 --> 00:04:34,671
Oh, OK.

102
00:04:34,671 --> 00:04:35,592
I could get there.

103
00:04:35,603 --> 00:04:41,786
one had a really strong pilot and then a
lot of like filler between episodes like

104
00:04:41,786 --> 00:04:46,908
two and episode seven, and then like two
good episodes or whatever it was, three

105
00:04:46,908 --> 00:04:49,989
good episodes to close out the season and
then kind of ended.

106
00:04:50,169 --> 00:04:57,992
And then this season I think is much more
in line with like the action aspects of

107
00:04:57,992 --> 00:04:58,852
Halo.

108
00:04:59,861 --> 00:05:05,802
But I think there's a lot of reticence
around the fact that for spoilers, skip

109
00:05:05,802 --> 00:05:11,444
forward 30 seconds, um, that he, like that
they're not wearing their suits.

110
00:05:11,864 --> 00:05:16,485
Like there's a lot of the, the like not
act, there's still action parts, but there

111
00:05:16,485 --> 00:05:22,607
are a lot of like action parts out of
their like master chief suit.

112
00:05:22,607 --> 00:05:26,228
So, um, I think there's some complaints
about that, but they've, they've spent a

113
00:05:26,228 --> 00:05:26,788
lot of time.

114
00:05:26,788 --> 00:05:29,108
I look, I, I enjoy it.

115
00:05:29,190 --> 00:05:32,217
You know, the episodes are 45, 50 minutes,
an hour long.

116
00:05:32,217 --> 00:05:34,141
Did you play Halo as well growing up?

117
00:05:34,141 --> 00:05:36,278
Like did you know Halo, it's storyline,
all that stuff?

118
00:05:36,278 --> 00:05:39,945
finished all of the like single player
Halo games.

119
00:05:40,207 --> 00:05:44,022
I never got into like ODST or the
multiplayer stuff, but yeah.

120
00:05:44,022 --> 00:05:48,391
to me that'd be like if they came out with
like a Half-Life show or something.

121
00:05:48,391 --> 00:05:51,617
Because I was like, you know, that was my
jam when I was a kid, loved that stuff.

122
00:05:52,259 --> 00:05:52,629
But...

123
00:05:52,629 --> 00:05:54,590
um, what's going on?

124
00:05:54,590 --> 00:05:56,451
Something comes out next month.

125
00:05:56,531 --> 00:06:00,953
There's borderlands, which is a movie that
trailer came out a couple of weeks ago.

126
00:06:01,093 --> 00:06:02,994
And there is fallout.

127
00:06:02,994 --> 00:06:09,137
I think HBO has picked up and the fallout,
um, is, is out next month, which, which

128
00:06:09,137 --> 00:06:10,158
would be interesting to watch.

129
00:06:10,158 --> 00:06:11,518
I've, I've never played fallout.

130
00:06:11,518 --> 00:06:16,140
I couldn't, it gave me the, gave me the,
the headaches and the.

131
00:06:16,329 --> 00:06:19,471
And the head spins of there, there are
some games that just do it to me where

132
00:06:19,471 --> 00:06:23,894
they just, I can't play them because the
motion or whatever, they just give me

133
00:06:23,894 --> 00:06:25,735
terrible headaches and, and stuff.

134
00:06:25,735 --> 00:06:29,057
So that was one of those games, but I'm,
I'm into.

135
00:06:29,218 --> 00:06:31,279
Watching, you know, TV shows and things
like that.

136
00:06:31,279 --> 00:06:33,720
So I would definitely give that a, give
that a go.

137
00:06:35,311 --> 00:06:38,313
I'm more about a movie than TV series.

138
00:06:38,354 --> 00:06:41,216
Now, some people will be like, oh yeah,
but a TV series can give like so much

139
00:06:41,216 --> 00:06:42,217
further in depth and everything.

140
00:06:42,217 --> 00:06:45,600
And it's like, yeah, it can, but I just
don't have the patience or the commitment.

141
00:06:45,600 --> 00:06:47,401
It's like, I want to go and watch two hour
movies.

142
00:06:47,401 --> 00:06:49,743
So I want to watch Dune Two, for example.

143
00:06:49,743 --> 00:06:50,824
Like it was like three hours.

144
00:06:50,824 --> 00:06:51,965
It was so good though.

145
00:06:51,965 --> 00:06:53,106
So good.

146
00:06:53,366 --> 00:06:54,948
Really long, but really good.

147
00:06:54,948 --> 00:06:56,869
And I'm glad they didn't make it a TV
series.

148
00:06:56,869 --> 00:06:57,630
It's just not the same.

149
00:06:57,630 --> 00:06:59,832
Like you can't watch a TV series in IMAX.

150
00:06:59,832 --> 00:07:00,432
You know what I mean?

151
00:07:00,432 --> 00:07:01,372
So it's like.

152
00:07:01,581 --> 00:07:03,324
Well, they're doing Harry Potter.

153
00:07:03,324 --> 00:07:04,586
They're revisiting Harry Potter.

154
00:07:04,586 --> 00:07:07,750
I think HBO or Max or whoever they've
picked it up and they're going to do like

155
00:07:07,750 --> 00:07:10,514
each book will be a season of the show.

156
00:07:10,514 --> 00:07:14,775
So it'd be interesting to see how they
kind of do that and pull it off.

157
00:07:14,775 --> 00:07:15,456
be fine.

158
00:07:15,456 --> 00:07:19,498
You know, Harry Potter is so popular even
I mean, just with even with like the young

159
00:07:19,498 --> 00:07:22,400
generation now, like my kids love the
Harry Potter books.

160
00:07:22,540 --> 00:07:23,701
And so that's funny.

161
00:07:23,701 --> 00:07:25,022
It just sticks around.

162
00:07:25,022 --> 00:07:26,782
It's got a lot of staying power.

163
00:07:27,543 --> 00:07:28,924
Hey, help me understand here.

164
00:07:28,924 --> 00:07:30,304
What does reticence mean?

165
00:07:31,965 --> 00:07:34,125
Like, how about it?

166
00:07:34,726 --> 00:07:37,167
Yeah.

167
00:07:37,167 --> 00:07:42,349
It's a Redison like his reservation.

168
00:07:42,449 --> 00:07:42,729
Yeah.

169
00:07:42,729 --> 00:07:44,330
It's like when you kind of.

170
00:07:44,850 --> 00:07:50,113
Resort like people were kind of against it
because it's like, people want essentially

171
00:07:50,113 --> 00:07:53,394
pick up the story and all of the action
and whatever, like basically pick up the

172
00:07:53,394 --> 00:07:59,189
campaign from the game and put it into a
TV series, which is like.

173
00:07:59,189 --> 00:08:00,413
Gamers are always like that.

174
00:08:00,413 --> 00:08:03,021
They're like, it's not exactly how I want
it, then it's no good.

175
00:08:03,021 --> 00:08:06,091
And it's like, just enjoy the thing for
what it is.

176
00:08:06,091 --> 00:08:06,982
Yeah, yeah, yeah.

177
00:08:06,982 --> 00:08:08,384
it's like, I read the books, it's not like
the books.

178
00:08:08,384 --> 00:08:10,027
It's like, I know it's different on
purpose.

179
00:08:10,027 --> 00:08:11,434
Like it's not supposed to be the book.

180
00:08:11,434 --> 00:08:15,977
I learned about this in like eighth grade
English, ninth grade English, it's like

181
00:08:15,977 --> 00:08:21,902
when they adapt books to different
mediums, whether TV or movie, they can't

182
00:08:22,122 --> 00:08:23,563
just do the same thing.

183
00:08:23,563 --> 00:08:28,007
Like the storytelling has to be different
in the visual medium.

184
00:08:28,007 --> 00:08:34,332
You don't get, you know, the, um, the ex
the exposition and like all of the

185
00:08:34,332 --> 00:08:36,994
explanatory stuff, you don't know what the
characters are thinking.

186
00:08:36,994 --> 00:08:39,857
Like you have to tell the story in a
different way.

187
00:08:39,857 --> 00:08:45,698
And so, yeah, look, it's like, maybe it's
not true to the story.

188
00:08:45,698 --> 00:08:48,759
You know, everyone goes on, there's lots
of law around it.

189
00:08:48,819 --> 00:08:50,399
Um, and, and things like that.

190
00:08:50,399 --> 00:08:56,481
When Mortal Kombat, the new Mortal Kombat
movie that came out a couple of years ago.

191
00:08:56,481 --> 00:09:02,543
Everyone was kind of like this, there's so
much law and the story to Mortal Kombat

192
00:09:02,543 --> 00:09:07,464
that you didn't have to, like you, you
inserted a character into the movie to

193
00:09:07,464 --> 00:09:09,109
tell the story of like.

194
00:09:09,109 --> 00:09:10,830
what Mortal Kombat is.

195
00:09:11,151 --> 00:09:16,976
And I think I see it from that point of
view where you're making a movie for a

196
00:09:16,976 --> 00:09:18,358
certain demographic.

197
00:09:18,358 --> 00:09:20,360
Like you're making a movie for Mortal
Kombat fans.

198
00:09:20,360 --> 00:09:25,645
But I think they went to the point where
they were like, we're trying to bring new

199
00:09:25,645 --> 00:09:26,666
people into it.

200
00:09:26,666 --> 00:09:33,472
And I think when you do that, you are
making a different piece of media.

201
00:09:33,746 --> 00:09:34,213
totally.

202
00:09:34,213 --> 00:09:35,693
to pick up a new audience.

203
00:09:35,693 --> 00:09:38,794
It's like there's, there's 20 or 30 years
of Mortal Kombat.

204
00:09:38,794 --> 00:09:40,475
People can go back.

205
00:09:40,575 --> 00:09:41,775
They don't need the backstory.

206
00:09:41,775 --> 00:09:45,276
They don't need to know, like there are
elements of it, but don't like create a

207
00:09:45,276 --> 00:09:50,878
character to tell the story because you,
you don't want to risk people, you know,

208
00:09:50,878 --> 00:09:54,199
not understanding something so they can go
and check that stuff out after.

209
00:09:54,339 --> 00:09:57,120
I think, you know, that's, that's the same
with halo.

210
00:09:57,120 --> 00:09:58,560
Like just tell a story.

211
00:10:00,141 --> 00:10:01,921
There we go.

212
00:10:01,921 --> 00:10:06,784
Well, uh, those, uh, those kind of, uh, 10
minutes of something you didn't come to

213
00:10:06,784 --> 00:10:07,885
maybe to hear, but maybe you did.

214
00:10:07,885 --> 00:10:08,405
I don't know.

215
00:10:08,405 --> 00:10:12,567
Sometimes people are like, Oh no, I like
the sort of pre show who literally who

216
00:10:12,567 --> 00:10:13,288
does.

217
00:10:13,288 --> 00:10:16,530
I mean, I remember back when we first
started, it was, we had people on all the

218
00:10:16,530 --> 00:10:22,313
time from like, you know, we had, um,
freak on and we had Marcel and we had

219
00:10:22,313 --> 00:10:26,955
Taylor and Adam and you know, all those
folks, and now we just get on a chat.

220
00:10:26,955 --> 00:10:28,756
I mean, maybe we should line up more
guests.

221
00:10:28,756 --> 00:10:29,576
I don't know.

222
00:10:29,947 --> 00:10:30,668
Maybe.

223
00:10:31,189 --> 00:10:34,471
Yeah, so guess what I broke out again
today?

224
00:10:34,831 --> 00:10:35,932
Actually yesterday.

225
00:10:36,412 --> 00:10:38,833
State machines, of course.

226
00:10:39,454 --> 00:10:41,135
X state for the win.

227
00:10:41,135 --> 00:10:44,236
So there was this, here's, let me tell you
the scenario, okay?

228
00:10:44,537 --> 00:10:48,939
There was a field and we needed to be able
to have a file number entered in the

229
00:10:48,939 --> 00:10:49,739
field.

230
00:10:49,760 --> 00:10:53,222
And then when they pressed enter or tabbed
out, it needed to go fetch three different

231
00:10:53,222 --> 00:10:54,102
things.

232
00:10:54,362 --> 00:10:57,864
And as long as all three of them returned
successfully, you needed to put a green

233
00:10:57,864 --> 00:10:58,984
checkbox in.

234
00:10:59,029 --> 00:11:03,291
but if it did not, you needed to put a red
error symbol.

235
00:11:03,291 --> 00:11:07,754
Well, if any of them fail, you can
immediately put the error symbol in, but

236
00:11:07,754 --> 00:11:11,417
you have to wait until all three of them
succeed to put the green checkbox in,

237
00:11:11,417 --> 00:11:12,137
right?

238
00:11:12,317 --> 00:11:16,340
And if you get one success and an error,
you just show up throw error.

239
00:11:16,380 --> 00:11:19,582
But if you get a success after an error,
you have to make sure it doesn't change

240
00:11:19,582 --> 00:11:23,084
back to success because it's not success,
it's error, right?

241
00:11:23,385 --> 00:11:27,187
And then you can't do anything to change
that error state or that success state

242
00:11:27,187 --> 00:11:28,948
unless you

243
00:11:28,949 --> 00:11:30,829
change the file number, right?

244
00:11:30,829 --> 00:11:35,390
So if you had, let's say like one, two,
three, and it errored, well, we're not

245
00:11:35,390 --> 00:11:40,812
gonna retry one, two, three unless you
change it, because it's invalid, right?

246
00:11:40,812 --> 00:11:45,373
So it's like, if you change it, if you do
on change, then you need to change it back

247
00:11:45,373 --> 00:11:49,314
to a ready state so it can go from ready
to loading again, right?

248
00:11:49,314 --> 00:11:50,574
So this was a complicated issue.

249
00:11:50,574 --> 00:11:55,976
And like it became apparent because the
developer who was working on it was

250
00:11:55,976 --> 00:11:58,576
inspecting like five different fields.

251
00:11:59,033 --> 00:12:01,594
all at the same time to determine what
state he was in.

252
00:12:01,594 --> 00:12:03,615
And it became obvious to me that it wasn't
going to work.

253
00:12:03,615 --> 00:12:08,458
It wasn't going to be sustainable when I
was having two icons overlaid on top of

254
00:12:08,458 --> 00:12:10,279
each other at the same time, right?

255
00:12:10,279 --> 00:12:14,601
There was like an error icon and a loading
icon and a success icon at the same time.

256
00:12:14,601 --> 00:12:16,182
It was like, how do you get into that
weird state?

257
00:12:16,182 --> 00:12:18,583
But it's possible because you have all
these weird...

258
00:12:18,883 --> 00:12:19,384
Yeah, right.

259
00:12:19,384 --> 00:12:20,064
Exactly.

260
00:12:20,064 --> 00:12:22,245
And so Schrodinger's icon.

261
00:12:23,126 --> 00:12:23,626
Yeah.

262
00:12:23,626 --> 00:12:26,407
And so anyway, really interesting.

263
00:12:26,407 --> 00:12:27,168
I should share it.

264
00:12:27,168 --> 00:12:27,828
But

265
00:12:28,109 --> 00:12:30,271
state machines to the rescue again.

266
00:12:30,417 --> 00:12:32,137
Exactly, that's literally what it was.

267
00:12:32,137 --> 00:12:36,858
And so we had a ready state, a loading
state, a success state and an error state.

268
00:12:36,858 --> 00:12:42,340
But the thing that was cool about this is
in the success state, you had two

269
00:12:42,340 --> 00:12:47,181
different, well, you had a event that I
was listening for in the, sorry, in the

270
00:12:47,181 --> 00:12:54,243
loading state, you had an event that you
could listen for, success, okay, or error.

271
00:12:54,743 --> 00:12:57,904
So if you had error, you'd immediately
transition to the error state, right?

272
00:12:57,904 --> 00:12:59,177
But if you had success,

273
00:12:59,177 --> 00:13:00,597
you wouldn't do anything immediately.

274
00:13:00,597 --> 00:13:03,138
You would just kind of wait, right?

275
00:13:03,138 --> 00:13:05,898
So if you had a success state, what you
would do is instead of transitioning to

276
00:13:05,898 --> 00:13:07,659
another event, you would run an action.

277
00:13:07,659 --> 00:13:10,740
And the action was increment success
count.

278
00:13:11,240 --> 00:13:14,821
So when you're on loading state, you could
accept one of two events, error or

279
00:13:14,821 --> 00:13:15,741
success.

280
00:13:15,821 --> 00:13:17,802
Error take you immediately to the error
state.

281
00:13:17,922 --> 00:13:20,643
Success increments the success count.

282
00:13:20,643 --> 00:13:25,024
But every time you would come to the
loading state, again, every time any event

283
00:13:25,024 --> 00:13:26,913
that it was listening for would come in,

284
00:13:26,913 --> 00:13:30,854
there was this thing called always, and it
would evaluate this statement every time.

285
00:13:30,854 --> 00:13:33,734
And so what it was, is it was an always,
and it was a conditional that said, if

286
00:13:33,734 --> 00:13:39,036
you've reached a success count of three,
then you should target the success state.

287
00:13:39,396 --> 00:13:43,397
And so it would just, you would hit it,
you know, I got success on one of them.

288
00:13:43,397 --> 00:13:45,158
Okay, great, we'll increment the count.

289
00:13:45,158 --> 00:13:45,878
Success on another one.

290
00:13:45,878 --> 00:13:47,038
Okay, great, we'll increment the count.

291
00:13:47,038 --> 00:13:47,839
Success on the third one.

292
00:13:47,839 --> 00:13:49,159
Okay, great, we'll increment the count.

293
00:13:49,159 --> 00:13:50,059
Oh, is it three?

294
00:13:50,059 --> 00:13:50,719
Yes, it is.

295
00:13:50,719 --> 00:13:52,220
Transition to that other state.

296
00:13:52,240 --> 00:13:54,653
So that was the magic sort of.

297
00:13:54,653 --> 00:13:55,173
stuff there.

298
00:13:55,173 --> 00:13:58,134
And then the nice thing is, you know, if
you transition from the loading state to

299
00:13:58,134 --> 00:14:01,816
the error state, error state doesn't
listen for success events anymore.

300
00:14:01,856 --> 00:14:02,536
So it doesn't matter.

301
00:14:02,536 --> 00:14:05,637
You don't if you got a success event after
an error, it's not going to change it back

302
00:14:05,637 --> 00:14:08,358
to success because it can't, it's not
listening for that anymore.

303
00:14:08,399 --> 00:14:09,339
So it was perfect.

304
00:14:09,339 --> 00:14:12,781
It was just the perfect use case for when
you would need the state machine.

305
00:14:12,781 --> 00:14:14,321
And it's so beautiful.

306
00:14:14,321 --> 00:14:17,443
Like no, I got rid of literally eight
variables.

307
00:14:17,443 --> 00:14:19,784
Like it was just so nice.

308
00:14:19,784 --> 00:14:21,277
And so yeah, if you're looking

309
00:14:21,277 --> 00:14:25,279
that real world example as well, like
mindful of the fact that you have this

310
00:14:25,279 --> 00:14:29,981
talk coming up to kind of like refresh it
a little bit if you wanted, you've got a

311
00:14:29,981 --> 00:14:34,623
real example to use rather than the
contrived, you know, I mean, the invoice

312
00:14:34,623 --> 00:14:39,145
is a good one as any, but having, you
know, we're telling the same story, but

313
00:14:39,145 --> 00:14:44,067
with a different example from a real world
application is, is always nice to have.

314
00:14:44,067 --> 00:14:47,488
And it's not always possible, obviously.

315
00:14:47,933 --> 00:14:52,255
when, when you're giving a talk to
translate like something from your work

316
00:14:52,255 --> 00:14:58,038
into the talk, but having the ability to
do that and having like this tangible

317
00:14:58,038 --> 00:15:01,940
thing that it's like, I've not just come
up with this contrived example, because

318
00:15:01,940 --> 00:15:05,742
then you have to think about all of the
situations in which you might apply that

319
00:15:05,742 --> 00:15:11,285
or use that for the purposes of telling or
giving the talk.

320
00:15:11,285 --> 00:15:16,188
You've got like, no, these are the things
that I have proven to be true with a real

321
00:15:16,188 --> 00:15:17,628
concrete example.

322
00:15:17,889 --> 00:15:19,129
Yep, yep, exactly.

323
00:15:19,129 --> 00:15:22,910
Like this is a real world thing that I
actually did that I used this for.

324
00:15:22,910 --> 00:15:25,791
So anyway, yeah, that was really cool.

325
00:15:25,791 --> 00:15:30,672
And it cleaned it up a lot and it felt
really nice to be like, ah, validate it

326
00:15:30,672 --> 00:15:31,092
again.

327
00:15:31,092 --> 00:15:33,573
Like, yes, this is the correct solution
for this location.

328
00:15:33,573 --> 00:15:35,813
Not always is it, but a lot of times it
is.

329
00:15:35,813 --> 00:15:37,294
And so that felt good.

330
00:15:38,114 --> 00:15:40,795
I was trying to see if there's any of the
libraries I could use to do it in a

331
00:15:40,795 --> 00:15:44,276
smaller form, like in a much smaller way,
but it was just like, nah, I'll just go

332
00:15:44,276 --> 00:15:46,516
back to Xstate, Xstate for JavaScript
stuff.

333
00:15:46,516 --> 00:15:47,116
So.

334
00:15:47,437 --> 00:15:47,797
So that's good.

335
00:15:47,797 --> 00:15:49,458
So that was sort of a recent thing I've
been working on.

336
00:15:49,458 --> 00:15:52,881
I mean, other than that, it's basically
been just all out sprints, man.

337
00:15:52,881 --> 00:15:54,062
We've just been killing it.

338
00:15:54,062 --> 00:15:56,424
Like, we've got so many things in flight
right now.

339
00:15:56,764 --> 00:15:57,445
It's kind of crazy.

340
00:15:57,445 --> 00:16:01,709
I was messaging a guy that's like a senior
and they come to me, Hey, dude, what would

341
00:16:01,709 --> 00:16:05,692
you think about spending a couple of hours
a week, like a day a week, just reviewing

342
00:16:05,692 --> 00:16:06,773
pull requests for me?

343
00:16:06,773 --> 00:16:11,577
Just like I just need another set of eyes
from a senior to just be take a look and

344
00:16:11,577 --> 00:16:13,138
say, like, oh, no, it doesn't look right.

345
00:16:13,138 --> 00:16:15,980
Like, or you didn't think about this or
you know what I mean?

346
00:16:16,149 --> 00:16:17,169
I don't need them to write code.

347
00:16:17,169 --> 00:16:20,131
I just need them to look at code and just
point out areas where it's like that

348
00:16:20,131 --> 00:16:21,471
doesn't seem like correct.

349
00:16:21,471 --> 00:16:24,533
You know, because it's like there's like
six, seven, eight, nine, ten, twelve pull

350
00:16:24,533 --> 00:16:25,574
requests out there at a time.

351
00:16:25,574 --> 00:16:28,495
And it's like I can get to some of them,
but I can't get to all of them.

352
00:16:28,495 --> 00:16:30,396
And it's like I don't want everybody
waiting on me.

353
00:16:30,396 --> 00:16:31,036
So.

354
00:16:31,379 --> 00:16:35,582
Well, now that, now that we've kind of
combined our backend and front end into a

355
00:16:35,582 --> 00:16:41,667
single repository, there are like 20 or 30
pull requests on the go at any one time

356
00:16:41,667 --> 00:16:44,670
and it's like, okay, I only want to look
at the backend one.

357
00:16:44,670 --> 00:16:49,093
So I forced everyone to, to tag or label
their, their PRs.

358
00:16:49,594 --> 00:16:54,418
And so I will only look at the backend
ones and, and usually only either if I'm

359
00:16:54,418 --> 00:16:58,280
like between tasks or someone specifically
asked me to look at something.

360
00:16:58,357 --> 00:17:04,058
because my code review, like we all review
each other's code, which is good.

361
00:17:04,058 --> 00:17:07,539
And now that the team has grown, there's,
there's people in at different levels that

362
00:17:07,539 --> 00:17:10,780
like, you can write the code, you can
review the code, even like the junior

363
00:17:10,780 --> 00:17:14,281
reviewing up to a senior's code is good as
well, because they can ask, they're going

364
00:17:14,281 --> 00:17:17,282
to ask questions, they're not just going
to assume that something is correct.

365
00:17:17,282 --> 00:17:21,043
Or they're going to see things in a
different way.

366
00:17:21,043 --> 00:17:23,163
They won't understand things necessarily.

367
00:17:23,163 --> 00:17:26,324
Like if you use a collection of pipeline,
they might ask, what are you doing here?

368
00:17:26,324 --> 00:17:27,224
Or why did you do it this way?

369
00:17:27,224 --> 00:17:27,584
Whatever.

370
00:17:27,584 --> 00:17:28,297
So it's.

371
00:17:28,297 --> 00:17:32,460
It's good from that perspective to kind of
get the team writing more approachable

372
00:17:32,460 --> 00:17:37,464
code, I think, rather than just like
benevolent me reviewing everyone's and it

373
00:17:37,464 --> 00:17:41,788
like takes a lot of time as well, but I
find that when, when I'm in a position to

374
00:17:41,788 --> 00:17:46,172
review code, the outcomes are very
different to when, you know, other people

375
00:17:46,172 --> 00:17:50,556
are reviewing code and I'll find things
that others won't see, or I have a

376
00:17:50,556 --> 00:17:51,036
different level.

377
00:17:51,036 --> 00:17:56,600
And there's like a lot of it is also the
feel like, you know,

378
00:17:56,821 --> 00:17:59,629
When, when you're reviewing code, there's
the feel of the code.

379
00:17:59,629 --> 00:18:00,290
preference.

380
00:18:00,290 --> 00:18:02,054
Yeah, it's just like, hey, this doesn't
feel right.

381
00:18:02,054 --> 00:18:03,116
It's like, well, why?

382
00:18:03,116 --> 00:18:05,560
Where's the where's the rule that tells me
that's not the case?

383
00:18:05,560 --> 00:18:06,843
It's like, well, there's no rule.

384
00:18:06,843 --> 00:18:07,815
It's just doesn't feel right.

385
00:18:07,815 --> 00:18:13,077
rule, but like when you, when you look at
like a constructor and using constructor

386
00:18:13,077 --> 00:18:16,458
property promotion, like where do you draw
the line between all of those things being

387
00:18:16,458 --> 00:18:17,719
on one line?

388
00:18:17,899 --> 00:18:21,961
Well, sorry, not constructed property
promotion is probably not a good example,

389
00:18:21,961 --> 00:18:25,942
but like a method, where do you draw the
line between having all of the parameters

390
00:18:25,942 --> 00:18:28,223
on one line and when do you start to split
it up?

391
00:18:28,223 --> 00:18:30,584
So it's one per line, you know?

392
00:18:30,644 --> 00:18:31,744
And it's like,

393
00:18:32,305 --> 00:18:37,048
And I think like our sort of soft rule is
when it gets to like 120 characters, you

394
00:18:37,048 --> 00:18:38,589
kind of start splitting it up.

395
00:18:38,589 --> 00:18:43,413
Just, just to kind of make it easier to
read, especially now that we're kind of

396
00:18:43,413 --> 00:18:48,296
embracing types a bit more and we're using
more complicated method signatures.

397
00:18:48,296 --> 00:18:53,980
When you've got like, this is an array or
null, you know, that kind of stuff or a

398
00:18:53,980 --> 00:18:57,883
nullable array, and then you've got like,
this is an object of type, whatever.

399
00:18:57,883 --> 00:19:00,564
And so these things then start taking up
more room.

400
00:19:00,669 --> 00:19:05,751
And it's not just a matter of looking at
like dollar variable equals, you know, now

401
00:19:05,751 --> 00:19:06,911
comma or whatever.

402
00:19:06,911 --> 00:19:11,493
Now you're looking at like two or three
pieces of information potentially for

403
00:19:11,493 --> 00:19:13,494
every method argument.

404
00:19:13,494 --> 00:19:17,776
So splitting them up onto one line, you
know, each of them being on one line, it

405
00:19:17,776 --> 00:19:20,456
makes it a bit easier to digest as well.

406
00:19:20,537 --> 00:19:23,998
And sometimes you might look at it and you
go, I'm, you know, passing too many

407
00:19:23,998 --> 00:19:24,878
variables in here.

408
00:19:24,878 --> 00:19:26,679
Maybe I've missed something in that.

409
00:19:27,019 --> 00:19:30,300
You know, it's, you know, that kind of
thing where

410
00:19:32,009 --> 00:19:37,912
rewriting the code in a, in a different
visual presentation, you know, from one

411
00:19:37,912 --> 00:19:42,554
line to five lines makes you sort of stop
and think a little bit more about what you

412
00:19:42,554 --> 00:19:48,058
have actually written and whether or not
it is the most appropriate way of writing

413
00:19:48,058 --> 00:19:49,018
that piece of code.

414
00:19:49,018 --> 00:19:53,441
You might find, Oh, we need to actually
set something as a, as an instance

415
00:19:53,441 --> 00:19:56,943
property on the, on the class and then
reference that rather than passing it

416
00:19:56,943 --> 00:19:58,824
between methods and so on and so forth.

417
00:19:58,824 --> 00:20:00,541
So it does help.

418
00:20:00,541 --> 00:20:05,348
I think to, to reveal some patterns about
your own code and certainly makes it

419
00:20:05,348 --> 00:20:10,536
easier to approach refactoring in terms of
like, you know, what it ends up looking

420
00:20:10,536 --> 00:20:11,196
like.

421
00:20:11,657 --> 00:20:12,337
Yeah.

422
00:20:13,018 --> 00:20:17,441
Yeah, or things like, how often should you
use a form request?

423
00:20:17,441 --> 00:20:20,564
If you only have one thing to validate,
should you use a form request to do that?

424
00:20:20,564 --> 00:20:21,385
Or shouldn't you?

425
00:20:21,385 --> 00:20:22,465
Do you know what I mean?

426
00:20:22,465 --> 00:20:23,526
Which one should you use?

427
00:20:23,526 --> 00:20:25,688
So anyway, some of those things are coding
standard things.

428
00:20:25,688 --> 00:20:31,773
You literally could probably, you could
enforce those things with Pest's

429
00:20:31,773 --> 00:20:33,835
architecture plugin and things like that
probably.

430
00:20:33,835 --> 00:20:35,982
But yeah.

431
00:20:35,982 --> 00:20:36,744
on form requests?

432
00:20:36,744 --> 00:20:39,108
Cause I know that you're a fan of them.

433
00:20:39,851 --> 00:20:44,220
Do you use sparsees Laravel data package
at all?

434
00:20:45,425 --> 00:20:46,305
I don't.

435
00:20:46,345 --> 00:20:47,966
We've talked about it before.

436
00:20:47,967 --> 00:20:52,371
You and I have actually, and we've been
talking about it a little bit inside of

437
00:20:52,371 --> 00:20:57,915
our other chat as far as like where should
like the line be drawn for when a form

438
00:20:57,915 --> 00:21:03,680
request is used or if you should say like,
yeah, we only use form requests up until

439
00:21:03,680 --> 00:21:04,561
this point.

440
00:21:04,561 --> 00:21:08,004
So we say, you know, once you're out of
the controller, it should no longer be a

441
00:21:08,004 --> 00:21:08,565
form request.

442
00:21:08,565 --> 00:21:11,467
It should now be something your domain
owns, it should be a DTO, it should be

443
00:21:11,467 --> 00:21:12,608
something like that.

444
00:21:12,704 --> 00:21:13,351
Yeah.

445
00:21:14,121 --> 00:21:18,144
We do have places in our code where the
request is literally drilled three layers

446
00:21:18,144 --> 00:21:19,045
deep, right?

447
00:21:19,045 --> 00:21:22,528
That's not great.

448
00:21:22,528 --> 00:21:24,770
So I could see using Spasi's package.

449
00:21:24,770 --> 00:21:27,351
It certainly makes it a lot easier, right?

450
00:21:27,612 --> 00:21:32,296
But I'm sure there's some, using any tool
for long enough, you'll find the spots in

451
00:21:32,296 --> 00:21:33,377
which it fails, right?

452
00:21:33,377 --> 00:21:36,419
Where it's insufficient and you have to do
something else.

453
00:21:36,800 --> 00:21:39,362
So I can't speak to that, though, because
we don't use it.

454
00:21:39,362 --> 00:21:41,524
So I know you guys do, though.

455
00:21:41,524 --> 00:21:42,237
How's it going with it?

456
00:21:42,237 --> 00:21:42,997
Yeah.

457
00:21:42,997 --> 00:21:43,217
All right.

458
00:21:43,217 --> 00:21:47,839
So I will pose you then a, it's not a
hypothetical, it's hypothetical for you,

459
00:21:48,039 --> 00:21:49,920
but it's the reality for me.

460
00:21:49,920 --> 00:21:51,900
We have a form request, right?

461
00:21:51,900 --> 00:21:53,981
It does, it has all of its rules.

462
00:21:53,981 --> 00:21:55,082
It does the validation.

463
00:21:55,082 --> 00:22:00,164
We then take that and we pass it into the
Laravel data object.

464
00:22:00,604 --> 00:22:05,446
Now the Laravel data objects have these
magic creation methods.

465
00:22:05,446 --> 00:22:11,888
So you go like person name, colon, colon
from.

466
00:22:11,913 --> 00:22:14,254
And then you pass it the request.

467
00:22:15,175 --> 00:22:26,182
And what it will do is it will look for
either a from request method on the, um,

468
00:22:26,182 --> 00:22:30,605
on, on that DT, that data object and
resolve it using that.

469
00:22:30,745 --> 00:22:35,608
And then you can do all kinds of creative
things like from model or from user model.

470
00:22:35,608 --> 00:22:36,209
So you could

471
00:22:36,209 --> 00:22:40,852
You could specifically do this and then
Lara the package itself uses reflection

472
00:22:40,852 --> 00:22:44,915
and some magic to kind of figure out like
of these magic creation methods.

473
00:22:44,915 --> 00:22:49,378
So they all start with from they're all
public, they're all static, which one best

474
00:22:49,378 --> 00:22:55,301
maps to this thing that I have been passed
and it kind of instantiates the object now

475
00:22:55,382 --> 00:22:58,624
from model, from array, from string, these
are all fine.

476
00:22:58,624 --> 00:23:05,068
What I find, and I want to hear your take
on this is that if it's building the

477
00:23:05,933 --> 00:23:14,776
from, if it's building the data object
from a request, it does its own validation

478
00:23:14,776 --> 00:23:18,098
to make sure that all of the input in the
request.

479
00:23:18,098 --> 00:23:22,579
So the stuff you take from like request,
input request, Jason, or whatever maps to

480
00:23:22,579 --> 00:23:29,602
a property on the data object before it
calls the from request method.

481
00:23:30,123 --> 00:23:30,383
Right.

482
00:23:30,383 --> 00:23:34,833
So in the example of like person data, you
might have

483
00:23:34,833 --> 00:23:41,377
your data object as name, email, phone
number, for simplicity sake.

484
00:23:41,458 --> 00:23:48,963
But in the request, we're capturing first
name, last name, email, phone number.

485
00:23:49,504 --> 00:23:55,589
So because, and because in the specific
instance of a request, what it does is it

486
00:23:55,589 --> 00:24:00,972
passes it through this like pipeline of,
um, stuff.

487
00:24:01,257 --> 00:24:03,858
where it normalizes the request, it does
all this other kind of stuff.

488
00:24:03,858 --> 00:24:10,680
But the thing that has tripped me up is
that we'll also do a level of validation,

489
00:24:10,741 --> 00:24:16,343
that there is a property on your data
object that matches your request.

490
00:24:16,403 --> 00:24:20,145
So keeping in mind that I have a request
that has first name, last name, phone, and

491
00:24:20,145 --> 00:24:26,767
email, and a data object that has name,
phone, and email, in my from request

492
00:24:26,767 --> 00:24:29,677
method, I would then take first name, last
name,

493
00:24:29,677 --> 00:24:33,859
concatenate it into name and then
instantiate the object.

494
00:24:34,039 --> 00:24:40,962
But because the request does not match the
DTO exactly, it hits the validation error

495
00:24:41,643 --> 00:24:47,206
in the Laravel data package that says this
field is required, name, name is required,

496
00:24:47,206 --> 00:24:48,767
but it's not set.

497
00:24:48,787 --> 00:24:52,609
So then you've got to like do these
gymnastics around using this other prepare

498
00:24:52,609 --> 00:24:57,172
for pipeline method, which then allows you
to kind of massage the request into a

499
00:24:57,172 --> 00:24:59,052
format that matches.

500
00:24:59,829 --> 00:25:05,255
the DTO, but it just, it kind of muddies
things up a little bit, I think.

501
00:25:05,255 --> 00:25:11,321
Um, and so, and so now we've got like two
places doing validation where I would

502
00:25:11,321 --> 00:25:17,488
expect that all of that request validation
happens in the request object and that you

503
00:25:17,488 --> 00:25:21,852
don't try and magic it up for me in the
data object itself.

504
00:25:22,109 --> 00:25:24,870
Yeah, well, because it's also not even
like the rules that you have specified in

505
00:25:24,870 --> 00:25:26,551
your form requests, right?

506
00:25:26,612 --> 00:25:27,432
It's different.

507
00:25:27,432 --> 00:25:30,875
It's like the it's magic rules that aren't
even really defined anywhere except for

508
00:25:30,875 --> 00:25:32,996
you know that the package is going to do
it.

509
00:25:33,269 --> 00:25:40,113
was it's based on the definition of the,
so you've, so it's based on what's in the

510
00:25:40,113 --> 00:25:40,854
constructor, right?

511
00:25:40,854 --> 00:25:43,075
Public name, public string name.

512
00:25:43,075 --> 00:25:43,416
Yeah.

513
00:25:43,416 --> 00:25:46,618
Public string name, public string phone
number, public string email.

514
00:25:46,618 --> 00:25:47,879
Like those are the three things.

515
00:25:47,879 --> 00:25:50,520
So it would look to see if there is a
request.

516
00:25:51,042 --> 00:25:55,145
I guess the thing that would be nice is if
it did something like if it had like a use

517
00:25:55,145 --> 00:25:59,147
validates before request or something like
that, if there was like a trait or

518
00:25:59,147 --> 00:26:02,369
something that you could turn on or off,
because then that would make a lot of

519
00:26:02,369 --> 00:26:03,209
sense.

520
00:26:03,790 --> 00:26:09,033
But to say like that from request method
is just automatically sort of getting this

521
00:26:09,033 --> 00:26:12,375
decorator around it that's going to do all
the validation stuff like that feels a

522
00:26:12,375 --> 00:26:12,875
little bit weird.

523
00:26:12,875 --> 00:26:15,776
It feels like because now what you have to
do is you almost have to like

524
00:26:15,937 --> 00:26:19,700
create your own static method on that
thing called from our requests, you know

525
00:26:19,700 --> 00:26:20,040
what I mean?

526
00:26:20,040 --> 00:26:23,564
And then pass the form request that way
and then handle it by instantiating it

527
00:26:23,564 --> 00:26:24,205
yourself.

528
00:26:24,205 --> 00:26:24,305
yeah.

529
00:26:24,305 --> 00:26:27,906
I mean, the problem is, is that it
specifically checks if the input to the

530
00:26:27,906 --> 00:26:32,068
from method is an instance of request.

531
00:26:32,068 --> 00:26:35,308
And if it is, it will shove it through
this pipeline, right?

532
00:26:35,308 --> 00:26:39,830
So you don't even get access to your own
magic method until it's run through that

533
00:26:39,830 --> 00:26:40,990
process.

534
00:26:41,690 --> 00:26:44,111
And so, you know, there are two options,
right?

535
00:26:44,111 --> 00:26:49,372
It's either conform your, your request
exactly to the data object.

536
00:26:50,332 --> 00:26:50,912
Or.

537
00:26:51,229 --> 00:26:52,049
actually there's three options.

538
00:26:52,049 --> 00:26:54,449
So the option one is to conform your
request.

539
00:26:55,890 --> 00:27:01,391
The second option is to call from request
directly, which then skips the magic

540
00:27:01,391 --> 00:27:02,412
creation.

541
00:27:02,672 --> 00:27:07,893
And the third one is to use, which is what
we've done, is to use like the without

542
00:27:07,893 --> 00:27:13,735
validation attribute on those properties
to specifically say, don't try and be

543
00:27:13,735 --> 00:27:14,675
smart about this.

544
00:27:14,675 --> 00:27:18,476
I know how I'm gonna massage this in the
from request method.

545
00:27:18,476 --> 00:27:19,616
Like I don't...

546
00:27:19,861 --> 00:27:23,103
And I haven't gone into like the history,
the commit history of the, of the package

547
00:27:23,103 --> 00:27:26,606
or, or to try and figure out like why this
was implemented, like what the thought

548
00:27:26,606 --> 00:27:34,212
process was behind it, but, but for me,
um, it, it feels a bit counter, like it's,

549
00:27:34,212 --> 00:27:36,614
it's not a PHP agnostic package either.

550
00:27:36,614 --> 00:27:38,895
It's specifically for Laravel.

551
00:27:39,276 --> 00:27:42,158
So it's like, I'm giving you a form
request.

552
00:27:42,158 --> 00:27:45,920
You know that it's a form request, which I
have already validated.

553
00:27:46,097 --> 00:27:50,960
I want to use the from request method,
which I will do the mapping from what's in

554
00:27:50,960 --> 00:27:56,143
the request to what's in the DTO, but you
are preventing that from happening.

555
00:27:56,563 --> 00:28:00,465
By, you know, doing this level of
validation.

556
00:28:00,746 --> 00:28:05,449
So I just wanted like a second, third,
fifth set of eyes at this point is to be

557
00:28:05,449 --> 00:28:11,852
like, is this weird, like, should I get
onto Frank and be like, excuse me.

558
00:28:12,250 --> 00:28:18,252
because I think what they've done is
they've decided to take the road of saying

559
00:28:18,252 --> 00:28:22,014
that we are going to define the
conventions and now you can you can adhere

560
00:28:22,014 --> 00:28:26,115
to the conventions or you can do the long
way and opt out by yourself.

561
00:28:26,215 --> 00:28:26,576
Right.

562
00:28:26,576 --> 00:28:29,637
And so I think that's probably the route
that they've decided to go and that's very

563
00:28:29,637 --> 00:28:33,418
spousy of them right like now they so they
give you an escape hatch.

564
00:28:33,418 --> 00:28:36,320
But they're basically saying if you want
to use this package, this is the way that

565
00:28:36,320 --> 00:28:37,220
we use it.

566
00:28:37,220 --> 00:28:38,720
And we've decided to just

567
00:28:38,753 --> 00:28:42,616
follow strictly our requests, which maps
straight into our DTOs, which maps

568
00:28:42,616 --> 00:28:44,658
straight into our models, which maps
straight into our, you know what I mean?

569
00:28:44,658 --> 00:28:46,179
Or maybe something like that.

570
00:28:46,960 --> 00:28:51,665
So if it was me doing it, yeah.

571
00:28:53,006 --> 00:28:55,668
I mean, I think, let me think about how I
would do it.

572
00:28:57,385 --> 00:29:02,746
If I was doing it myself, what I might do
is I might call the from request method

573
00:29:02,746 --> 00:29:04,486
directly in my controller.

574
00:29:04,486 --> 00:29:05,127
Yeah.

575
00:29:05,127 --> 00:29:06,967
And then just let my from request method
handle that.

576
00:29:06,967 --> 00:29:11,308
And then using from request would just do,
you know, it's skip the validation stuff.

577
00:29:11,308 --> 00:29:15,289
And I could still use from anywhere else
knowing it's, you know, if I'm using that

578
00:29:15,289 --> 00:29:18,010
request method, it's not if I'm using that
request object, it's not going to work.

579
00:29:18,010 --> 00:29:18,850
But that's okay.

580
00:29:18,850 --> 00:29:20,871
I would just use from request in those
instances.

581
00:29:20,871 --> 00:29:26,569
And I guess document well that that's why
it is that way.

582
00:29:26,569 --> 00:29:28,129
Yeah.

583
00:29:28,129 --> 00:29:34,493
I suppose if you look at it from the
perspective of the Laravel data object

584
00:29:34,493 --> 00:29:41,477
that is created from a form request is
being done with the specific intent to

585
00:29:41,477 --> 00:29:47,880
give a type, to give typed, you know, in,
uh, inferred access to the properties.

586
00:29:48,220 --> 00:29:53,663
Then yes, it makes sense that, you know,
this is, this is to replace basically

587
00:29:53,663 --> 00:29:56,724
that, that request object wholesale.

588
00:29:57,361 --> 00:30:03,422
And so whatever you map in the DTO needs
to match exactly what is in their request.

589
00:30:03,422 --> 00:30:06,563
And it's to stop you from passing the
request around and using like request

590
00:30:06,563 --> 00:30:08,804
import all the way through.

591
00:30:08,984 --> 00:30:12,865
Cause you know, we know that that's error
prone that you could have a typo in the

592
00:30:12,865 --> 00:30:18,266
string, you request input, request import,
you know, name, and you forget the E and

593
00:30:18,266 --> 00:30:23,408
it's just nam and then you end up with
null can be trickier to diagnose than to

594
00:30:23,408 --> 00:30:25,909
do request nam on.

595
00:30:25,909 --> 00:30:29,811
you know, the typed object, which will
tell you, no, NAM doesn't exist here.

596
00:30:29,811 --> 00:30:34,914
So I guess if that's the intent, it's just
that, you know, you're not always in

597
00:30:34,914 --> 00:30:38,776
control of the data coming into that
request, I suppose, but you're always in

598
00:30:38,776 --> 00:30:40,477
control of the, of the data object.

599
00:30:40,477 --> 00:30:47,781
So maybe, maybe it's a PR that I send to
the documentation to say that like, this

600
00:30:47,781 --> 00:30:49,882
is the specific intent, just to clarify
that.

601
00:30:49,882 --> 00:30:52,003
And like, I'm happy, I'm happy to have the
conversation.

602
00:30:52,003 --> 00:30:54,693
I think with, I think Ruben.

603
00:30:54,693 --> 00:30:58,135
is responsible for the package to say
like, why is it like this?

604
00:30:58,135 --> 00:31:03,019
And if the, if my understanding based on
what we've just said is, is correct, then

605
00:31:03,019 --> 00:31:09,745
can I send a PR to the docs to say like,
this is the intent of using the form

606
00:31:09,745 --> 00:31:13,888
request, using the from request
functionality, and then, and then it's

607
00:31:13,888 --> 00:31:15,909
like clear and then everyone understands.

608
00:31:15,950 --> 00:31:18,992
Cause like it tripped me up for ages and I
was trying to find a way around it.

609
00:31:18,992 --> 00:31:23,436
And I was, you know, source diving through
the package and it's, it's created in such

610
00:31:23,436 --> 00:31:24,309
a way that it's.

611
00:31:24,309 --> 00:31:27,573
Like it makes sense, but it's, you know,
you've got to jump through a few classes

612
00:31:27,573 --> 00:31:30,678
to find out where this behavior is
actually happening and then, and going,

613
00:31:30,678 --> 00:31:36,126
oh, okay, I understand why this is
happening now, but I don't understand why

614
00:31:36,126 --> 00:31:37,188
it's happening kind of thing.

615
00:31:37,188 --> 00:31:37,808
So.

616
00:31:38,438 --> 00:31:39,259
Yeah, that makes sense.

617
00:31:39,259 --> 00:31:42,043
I thought when you originally saying it,
you were saying that it would basically

618
00:31:42,043 --> 00:31:44,326
run the validation step again on your form
request.

619
00:31:44,326 --> 00:31:45,727
I was like, that seems odd.

620
00:31:46,008 --> 00:31:48,652
Like, it seems like, I got it.

621
00:31:48,652 --> 00:31:49,312
Yeah.

622
00:31:49,374 --> 00:31:52,035
like, you know, it's using reflection to
find out, you know, what are all the

623
00:31:52,035 --> 00:31:52,435
properties?

624
00:31:52,435 --> 00:31:53,215
What are their types?

625
00:31:53,215 --> 00:31:54,615
Does this thing exist?

626
00:31:54,615 --> 00:31:55,576
Is it of the correct type?

627
00:31:55,576 --> 00:31:59,297
And I, and like, because I haven't
actually got it working in the way that I

628
00:31:59,297 --> 00:32:01,477
guess the package intends it to work.

629
00:32:01,477 --> 00:32:05,018
You know, I assume that if you type it as
a string, it's going to use request input.

630
00:32:05,018 --> 00:32:09,159
But if you, if you type it as an integer,
it'll use request integer or request

631
00:32:09,159 --> 00:32:12,060
Boolean to kind of make sure that all of
those types match up for you.

632
00:32:12,905 --> 00:32:14,366
Here's one other option for you.

633
00:32:14,366 --> 00:32:15,246
Are you ready?

634
00:32:15,567 --> 00:32:21,312
The other option you could do is you
could, in your form request object, you

635
00:32:21,312 --> 00:32:27,437
could append a full name attribute to the
request in the form request object.

636
00:32:27,478 --> 00:32:32,342
So you could say like after validation,
and then that's going to make sure that

637
00:32:32,342 --> 00:32:33,163
everything's valid.

638
00:32:33,163 --> 00:32:36,626
And then you could say, I think it's, I
don't remember if it's like this request

639
00:32:36,626 --> 00:32:38,773
or this attribute push or something like
that anyway.

640
00:32:38,773 --> 00:32:40,359
you can merge or whatever in there.

641
00:32:40,359 --> 00:32:40,769
Yeah.

642
00:32:40,769 --> 00:32:42,169
you can set the value, basically.

643
00:32:42,169 --> 00:32:44,290
And so then you could just do it in there.

644
00:32:44,290 --> 00:32:47,211
And then any time you get the form
request, as long as it's valid, it's going

645
00:32:47,211 --> 00:32:48,471
to push that value in there.

646
00:32:48,471 --> 00:32:50,432
And then when you pass it through, it's
just going to set it.

647
00:32:50,432 --> 00:32:51,172
No big deal.

648
00:32:51,172 --> 00:32:53,232
That way you don't have to do any of that
other stuff.

649
00:32:53,232 --> 00:32:54,313
It would just work.

650
00:32:55,013 --> 00:32:56,113
And that would work every time.

651
00:32:56,113 --> 00:33:00,915
I mean, as long as you validated it, I
suppose, but what you're going to do, I

652
00:33:00,915 --> 00:33:03,095
mean, it's going to happen automatically
when you use form requests in the

653
00:33:03,095 --> 00:33:03,515
controller.

654
00:33:03,515 --> 00:33:07,196
So it's just where do you want to put the
logic, you know?

655
00:33:07,196 --> 00:33:07,916
Yeah.

656
00:33:08,278 --> 00:33:11,319
I think now having this conversation,
having said it out loud, I've like talked

657
00:33:11,319 --> 00:33:15,021
myself into believing that it is the
correct approach with the assumption that

658
00:33:15,021 --> 00:33:20,583
like, that is exactly what the intent is
that, you know, that, that the re that the

659
00:33:20,583 --> 00:33:24,865
data object should in fact map the request
one to one.

660
00:33:25,926 --> 00:33:30,227
And so yes, you are defining the things in
two places, but it does mean that you get

661
00:33:30,467 --> 00:33:33,068
a typed object as you go.

662
00:33:33,109 --> 00:33:35,640
you know, through the application depths.

663
00:33:36,553 --> 00:33:37,254
Yep.

664
00:33:37,881 --> 00:33:38,313
Exactly.

665
00:33:38,313 --> 00:33:41,494
hacked around it for now and we're just
leaving it as at that, but, um, it'll be

666
00:33:41,494 --> 00:33:44,916
something to keep in mind for future
because like none of the other people on

667
00:33:44,916 --> 00:33:47,738
my team that had been working with it had
encountered this problem.

668
00:33:47,738 --> 00:33:52,360
And I'm like, have you not encountered,
like, are you calling the from request

669
00:33:52,360 --> 00:33:53,581
method directly?

670
00:33:53,581 --> 00:33:58,403
Are you or, but I, but if I, I think I
figured in the end that they were in fact,

671
00:33:58,604 --> 00:34:04,887
yeah, doing the mapping of the request,
the form requests one to one with the, the

672
00:34:04,887 --> 00:34:07,528
data object, and that makes sense that
they never hit the issue then.

673
00:34:07,977 --> 00:34:09,698
Yeah, exactly, exactly.

674
00:34:09,698 --> 00:34:13,159
Yeah, and it is really nice just to have
that typed object you can pass around and

675
00:34:13,160 --> 00:34:16,081
new up in tests and all that stuff without
having to have a form request and then

676
00:34:16,081 --> 00:34:16,561
pass it.

677
00:34:16,561 --> 00:34:19,362
Yeah, yeah, really nice.

678
00:34:19,642 --> 00:34:21,323
Well, hey dude, we're at our time.

679
00:34:22,263 --> 00:34:24,204
Yes, yes, indeed, we are at our time.

680
00:34:24,204 --> 00:34:26,085
Hey, thanks folks for hanging out with us,
152.

681
00:34:27,806 --> 00:34:29,326
I was gonna say, not Laravel News.

682
00:34:29,326 --> 00:34:32,868
I don't know if you saw that audio slash
152 for show notes.

683
00:34:32,868 --> 00:34:34,156
Hit us up on.

684
00:34:34,156 --> 00:34:37,680
twitter at Michael Dornett, Jacob Bennett
or at North South Audio.

685
00:34:37,761 --> 00:34:40,344
Rate us up on your podcast, catch our
choice, 5 stars would be amazing.

686
00:34:40,344 --> 00:34:43,007
Until next time folks, we'll see ya.

687
00:34:43,288 --> 00:34:43,809
Peace.

688
00:34:43,809 --> 00:34:44,540
Bye.