WEBVTT

1
00:00:05.280 --> 00:00:09.199
<v Speaker 1>Hello everybody, and welcome to another episode of the JavaScript

2
00:00:09.279 --> 00:00:12.759
<v Speaker 1>Jabber podcast. Today we have a special episode with a

3
00:00:12.800 --> 00:00:17.679
<v Speaker 1>special guest, Matt Pocock. Hi Matt, Hello Jane.

4
00:00:17.839 --> 00:00:18.359
<v Speaker 2>How are you doing.

5
00:00:19.239 --> 00:00:22.480
<v Speaker 1>I'm doing well. It's great to have you here. Before

6
00:00:22.519 --> 00:00:25.719
<v Speaker 1>we start, I have one thing I would like to mention.

7
00:00:26.519 --> 00:00:32.920
<v Speaker 1>So there's the new the latest JAS survey that has

8
00:00:33.039 --> 00:00:35.560
<v Speaker 1>just come out I think today as of the time

9
00:00:35.600 --> 00:00:40.000
<v Speaker 1>of the recording, and I would love for you to

10
00:00:40.039 --> 00:00:44.079
<v Speaker 1>pick JavaScript Jabber as one of your favorite podcasts in

11
00:00:44.119 --> 00:00:46.799
<v Speaker 1>this survey, you know, just to help us get the

12
00:00:46.840 --> 00:00:49.799
<v Speaker 1>word out there. You know, every little bit helps. So

13
00:00:49.920 --> 00:00:54.479
<v Speaker 1>with that out of the way, let's get to Matt. So, Matt,

14
00:00:54.759 --> 00:00:58.039
<v Speaker 1>how have you been doing good? Very good.

15
00:00:58.240 --> 00:01:04.439
<v Speaker 2>I've moved house recently. My son fell about five feet

16
00:01:04.640 --> 00:01:09.480
<v Speaker 2>onto a hard floor. He's absolutely fine, but he had

17
00:01:09.480 --> 00:01:11.920
<v Speaker 2>a black earfe for about ten days. But other than that,

18
00:01:12.319 --> 00:01:14.000
<v Speaker 2>I'm doing okay. Yeah.

19
00:01:14.120 --> 00:01:16.519
<v Speaker 1>Yeah, it's funny. Well, first of all, you need to

20
00:01:16.560 --> 00:01:19.560
<v Speaker 1>mention that your son is eleven ten or eleven months old.

21
00:01:20.840 --> 00:01:24.400
<v Speaker 2>He's not sixteen or something. No, he's ten months old.

22
00:01:24.560 --> 00:01:27.359
<v Speaker 2>And yeah, he's very small and he felt quite a distance,

23
00:01:27.439 --> 00:01:28.120
<v Speaker 2>but he's okay.

24
00:01:28.959 --> 00:01:32.079
<v Speaker 1>Yeah, it's it's surprising how resilient babies are. I mean,

25
00:01:32.079 --> 00:01:34.560
<v Speaker 1>if they if they are, if they wouldn't have been,

26
00:01:34.640 --> 00:01:37.879
<v Speaker 1>then the human race would have likely died out by now.

27
00:01:37.959 --> 00:01:41.120
<v Speaker 1>But no, obviously it's super scary and we shouldn't drop them.

28
00:01:41.640 --> 00:01:44.439
<v Speaker 1>But but they are, but they are, But they are resilient,

29
00:01:44.599 --> 00:01:49.280
<v Speaker 1>more resilient that we might expect. Quite yeah, And where

30
00:01:49.280 --> 00:01:49.920
<v Speaker 1>have you moved to?

31
00:01:50.840 --> 00:01:54.239
<v Speaker 2>So just moved locally? So I live in Oxfordshire and

32
00:01:54.400 --> 00:01:56.359
<v Speaker 2>just moved to another place in Oxfordshire so I can

33
00:01:56.400 --> 00:02:00.319
<v Speaker 2>see horses out my window. Oxford is like and where

34
00:02:00.439 --> 00:02:04.040
<v Speaker 2>that distance and it's nice and I really like it.

35
00:02:04.920 --> 00:02:08.599
<v Speaker 1>So really an English country gentleman.

36
00:02:09.080 --> 00:02:12.080
<v Speaker 2>Quite exactly. That's how I like to present myself. That's

37
00:02:12.120 --> 00:02:14.039
<v Speaker 2>how I feel too. I just need my top hat,

38
00:02:14.120 --> 00:02:18.000
<v Speaker 2>my monica and my pipe.

39
00:02:18.240 --> 00:02:20.759
<v Speaker 1>You know, I know you as I imagine most of

40
00:02:20.800 --> 00:02:24.800
<v Speaker 1>our listeners do from everything related to typescript. You have

41
00:02:24.879 --> 00:02:29.599
<v Speaker 1>a typescript site, you have a typescript newsletter. You put

42
00:02:29.639 --> 00:02:33.240
<v Speaker 1>out I think typescript related videos and other forms of

43
00:02:33.280 --> 00:02:37.520
<v Speaker 1>content to a lot of us. Me for example, you're

44
00:02:37.599 --> 00:02:43.719
<v Speaker 1>kind of like mister typeescript. I'm subscribed to your newsletter. Well,

45
00:02:43.719 --> 00:02:47.159
<v Speaker 1>I'm subscribed to a couple of development newsletters, but yours

46
00:02:47.520 --> 00:02:49.800
<v Speaker 1>is one that I open as soon as it arrives

47
00:02:50.400 --> 00:02:54.520
<v Speaker 1>because it contains so much really useful and pertinent information.

48
00:02:54.639 --> 00:02:57.879
<v Speaker 1>I've really learned a lot. And I'm not just saying it,

49
00:02:58.400 --> 00:03:00.840
<v Speaker 1>you know, to be nice. I'm saying it because it's true.

50
00:03:02.240 --> 00:03:05.199
<v Speaker 1>So I would love thank you. So I would love

51
00:03:05.439 --> 00:03:08.280
<v Speaker 1>for you to tell us a little bit about your

52
00:03:08.400 --> 00:03:13.039
<v Speaker 1>journey into typescript and maybe even your journey into software

53
00:03:13.080 --> 00:03:16.000
<v Speaker 1>in general, because I know that you didn't actually start

54
00:03:16.479 --> 00:03:20.479
<v Speaker 1>with software. It's something that you like, grew into or

55
00:03:21.120 --> 00:03:24.120
<v Speaker 1>decided to join or whatever we like to call it.

56
00:03:24.199 --> 00:03:26.479
<v Speaker 1>So take it away.

57
00:03:26.680 --> 00:03:30.759
<v Speaker 2>Yeah, my journey into developments in general is odd. I

58
00:03:30.879 --> 00:03:37.199
<v Speaker 2>studied drama at university. I after that, I became a

59
00:03:37.240 --> 00:03:40.840
<v Speaker 2>singing teacher, so I sort of sung a lot in

60
00:03:40.879 --> 00:03:45.280
<v Speaker 2>a university and basically picked up singing teaching. I did

61
00:03:45.319 --> 00:03:48.840
<v Speaker 2>a master's in voice and singing teaching, so in a

62
00:03:48.919 --> 00:03:52.439
<v Speaker 2>drama school and moved to London and was working as

63
00:03:52.479 --> 00:03:56.400
<v Speaker 2>a drama teacher. And I lived in London, and I

64
00:03:56.439 --> 00:03:59.080
<v Speaker 2>wanted to be an Oxford country gentleman. You know. I

65
00:03:59.120 --> 00:04:01.080
<v Speaker 2>didn't like living in the big city. At all, and

66
00:04:01.120 --> 00:04:05.439
<v Speaker 2>so this was around twenty seventeen, twenty twenty sixteen, I think,

67
00:04:06.000 --> 00:04:09.560
<v Speaker 2>and I thought, what's a skill that can take me

68
00:04:09.800 --> 00:04:12.159
<v Speaker 2>out of the city, that I can do from anywhere.

69
00:04:12.599 --> 00:04:16.639
<v Speaker 2>And I've always loved computers always. I made my own

70
00:04:16.680 --> 00:04:20.240
<v Speaker 2>little websites when I was twelve years old, just with HTML,

71
00:04:21.040 --> 00:04:24.720
<v Speaker 2>and I thought, well, okay, maybe I could do that

72
00:04:25.079 --> 00:04:27.959
<v Speaker 2>for a job. And so I started making applications for

73
00:04:28.040 --> 00:04:31.680
<v Speaker 2>my students, making my lessons more interactive. And I loved teaching.

74
00:04:31.920 --> 00:04:34.160
<v Speaker 2>I still love teaching, but I just I wanted to

75
00:04:34.240 --> 00:04:36.879
<v Speaker 2>try something new, and it occurred to me that I

76
00:04:36.920 --> 00:04:38.800
<v Speaker 2>could go and get a job doing this, and so

77
00:04:38.839 --> 00:04:42.639
<v Speaker 2>I did and became a junior developer, and I went

78
00:04:42.639 --> 00:04:46.560
<v Speaker 2>from junior to mid to senior pretty quickly. And around

79
00:04:46.600 --> 00:04:48.519
<v Speaker 2>when I was a mid I started picking up timescript.

80
00:04:48.720 --> 00:04:51.319
<v Speaker 2>And I was always a just basically a JavaScript and

81
00:04:51.319 --> 00:04:54.920
<v Speaker 2>timescript person. I did a love of PHP, but really

82
00:04:54.959 --> 00:04:56.839
<v Speaker 2>just that. And I started to.

83
00:04:57.439 --> 00:05:00.920
<v Speaker 1>What year was it when you started doubl in the typeescript?

84
00:05:01.639 --> 00:05:05.439
<v Speaker 2>About twenty eighteen, I think would have been yeah, okay,

85
00:05:06.079 --> 00:05:08.920
<v Speaker 2>so it would have been out I think for about

86
00:05:08.959 --> 00:05:12.639
<v Speaker 2>six seven years at that point, and maybe even five

87
00:05:12.680 --> 00:05:15.600
<v Speaker 2>years or so. But and from that point I was

88
00:05:16.040 --> 00:05:20.439
<v Speaker 2>working professionally and there was one particular project as well

89
00:05:20.480 --> 00:05:22.879
<v Speaker 2>that had just really brought home the power of typescript

90
00:05:22.959 --> 00:05:26.560
<v Speaker 2>to me, which was this project. We were the front

91
00:05:26.639 --> 00:05:28.560
<v Speaker 2>end team working with the back end team, back in

92
00:05:28.639 --> 00:05:31.600
<v Speaker 2>team in a totally different language, and we would make

93
00:05:31.639 --> 00:05:34.720
<v Speaker 2>these contracts for linking up the front end and the

94
00:05:34.759 --> 00:05:37.160
<v Speaker 2>back end, and they weren't very sophisticated. They were just

95
00:05:37.240 --> 00:05:41.160
<v Speaker 2>kind of a Jason Blobs in Google Docs. And these

96
00:05:41.199 --> 00:05:44.120
<v Speaker 2>contracts the back end team never quite implemented them the

97
00:05:44.160 --> 00:05:46.240
<v Speaker 2>way we wanted them to in the front end team.

98
00:05:46.560 --> 00:05:49.519
<v Speaker 2>So you know, you would have camel case or instead

99
00:05:49.560 --> 00:05:51.600
<v Speaker 2>of snake case or the other way around, or something

100
00:05:51.600 --> 00:05:53.680
<v Speaker 2>would be misspelled, something would be nullable when we didn't

101
00:05:53.720 --> 00:05:56.240
<v Speaker 2>expect and this would cause bucks. You know, this would

102
00:05:56.240 --> 00:06:00.839
<v Speaker 2>just break our front ends. And when we started opting Typescript,

103
00:06:00.879 --> 00:06:05.360
<v Speaker 2>which I really really pushed for, suddenly whenever a small

104
00:06:05.480 --> 00:06:07.959
<v Speaker 2>change was made in the back end architecture, it just

105
00:06:08.000 --> 00:06:10.199
<v Speaker 2>meant we could change it in two seconds instead of

106
00:06:10.720 --> 00:06:11.319
<v Speaker 2>two hours.

107
00:06:11.360 --> 00:06:11.560
<v Speaker 1>You know.

108
00:06:11.600 --> 00:06:14.199
<v Speaker 2>It was fantastic. And so from there I was just

109
00:06:14.240 --> 00:06:19.279
<v Speaker 2>a touchgo advocate at every job I had, and that

110
00:06:19.399 --> 00:06:22.439
<v Speaker 2>led me into a bit of open source stuff as well.

111
00:06:22.480 --> 00:06:24.759
<v Speaker 2>So I started doing have you heard of a library

112
00:06:24.800 --> 00:06:25.399
<v Speaker 2>called x state?

113
00:06:27.319 --> 00:06:31.680
<v Speaker 1>Yes, yes, I have. It's a state management library. It

114
00:06:32.079 --> 00:06:35.240
<v Speaker 1>basically does state machines. That's right.

115
00:06:35.399 --> 00:06:38.519
<v Speaker 2>Have you had David on the podcast as well, David Cushy.

116
00:06:38.959 --> 00:06:41.879
<v Speaker 1>I think we have. I would need to check if

117
00:06:41.920 --> 00:06:45.319
<v Speaker 1>we had, though I think I might have missed that episode,

118
00:06:45.319 --> 00:06:48.240
<v Speaker 1>And to be brutally ought and honest, I myself have

119
00:06:48.399 --> 00:06:49.800
<v Speaker 1>not yet used the x State.

120
00:06:50.839 --> 00:06:55.879
<v Speaker 2>It's a wonderful library basically building state machines and state charts.

121
00:06:56.240 --> 00:06:59.279
<v Speaker 2>And if you've ever done front end work, you know

122
00:06:59.360 --> 00:07:03.360
<v Speaker 2>that building front end interfaces is really hard, actually, and

123
00:07:03.399 --> 00:07:06.759
<v Speaker 2>you will often encounter bugs. And those bugs are often

124
00:07:06.759 --> 00:07:10.160
<v Speaker 2>because you just haven't thought of a specific state that

125
00:07:10.199 --> 00:07:14.120
<v Speaker 2>your UI can be in, you know, like and you know,

126
00:07:14.800 --> 00:07:17.800
<v Speaker 2>things go out. I've sync and it all feels horrible.

127
00:07:18.439 --> 00:07:21.920
<v Speaker 2>But state machines really bring that complexity to the surface

128
00:07:21.959 --> 00:07:23.519
<v Speaker 2>and make it a lot easier to work on. And

129
00:07:23.560 --> 00:07:27.600
<v Speaker 2>I was working on some complex, complex applications like spreadsheets,

130
00:07:27.639 --> 00:07:30.759
<v Speaker 2>like I was building a video calling service where you

131
00:07:30.800 --> 00:07:34.519
<v Speaker 2>could like walk through a virtual room in an agency

132
00:07:34.560 --> 00:07:37.720
<v Speaker 2>I was at, and X State was really incredible for that,

133
00:07:38.360 --> 00:07:40.000
<v Speaker 2>and so I started working doing a little bit of

134
00:07:40.000 --> 00:07:42.399
<v Speaker 2>open source stuff for x State. Open source then led

135
00:07:42.480 --> 00:07:44.600
<v Speaker 2>to me joining a company that got formed out of

136
00:07:44.600 --> 00:07:47.160
<v Speaker 2>the x State core team, and I started doing DevRel

137
00:07:47.199 --> 00:07:51.040
<v Speaker 2>for x State, and then I started teaching tapscripts. And

138
00:07:51.279 --> 00:07:54.720
<v Speaker 2>when I started teaching tapscripts, it just went something really

139
00:07:54.759 --> 00:07:59.079
<v Speaker 2>crazy happened, and within about six months or so, I

140
00:07:59.199 --> 00:08:02.240
<v Speaker 2>became someone with that four thousand followers to being the

141
00:08:02.240 --> 00:08:05.920
<v Speaker 2>typescript guy to being this person. I'm not really sure

142
00:08:05.920 --> 00:08:08.959
<v Speaker 2>how that happened. Happened quite quickly, and happened seemingly without

143
00:08:08.959 --> 00:08:11.879
<v Speaker 2>my knowledge or intervention, so thank you.

144
00:08:14.040 --> 00:08:16.639
<v Speaker 1>Well. I think it's a combination really of a couple

145
00:08:16.639 --> 00:08:18.560
<v Speaker 1>of things. First of all, I think there was a

146
00:08:18.639 --> 00:08:21.800
<v Speaker 1>real need in the market. I mean, on the one hand,

147
00:08:21.920 --> 00:08:28.480
<v Speaker 1>Microsoft were communicating stuff about typescript, but it was kind

148
00:08:28.480 --> 00:08:32.000
<v Speaker 1>of like information from on high, and it was and

149
00:08:32.360 --> 00:08:35.799
<v Speaker 1>they were doing it as a vendor, not as you know,

150
00:08:35.879 --> 00:08:38.120
<v Speaker 1>as a teacher. So I think there was a real

151
00:08:38.240 --> 00:08:43.879
<v Speaker 1>need for teaching typescript and everything else was like Typescript

152
00:08:43.879 --> 00:08:47.240
<v Speaker 1>in the context of something else, rather than a focus

153
00:08:47.360 --> 00:08:50.679
<v Speaker 1>on typescript itself. And I also think it helped that

154
00:08:50.759 --> 00:08:55.159
<v Speaker 1>you're just a great teacher that you could bring your

155
00:08:55.279 --> 00:08:59.120
<v Speaker 1>knowledge and expertise and your approach that you had from

156
00:08:59.240 --> 00:09:04.240
<v Speaker 1>teaching other things and apply them to typeescript as well.

157
00:09:05.240 --> 00:09:10.200
<v Speaker 1>I am curious, though, maybe it's the fact that it's

158
00:09:10.399 --> 00:09:13.039
<v Speaker 1>you know, I'm a bit old school. I came into

159
00:09:13.120 --> 00:09:18.600
<v Speaker 1>software the more traditional route through actually studying computer science

160
00:09:18.639 --> 00:09:22.879
<v Speaker 1>in the university around and there's a lot of formalism

161
00:09:22.919 --> 00:09:26.360
<v Speaker 1>around type systems and stuff like that, So you kind

162
00:09:26.399 --> 00:09:32.440
<v Speaker 1>of expect people that are really into type systems to

163
00:09:32.639 --> 00:09:38.559
<v Speaker 1>have a bit more formal background, and yet you're able

164
00:09:38.720 --> 00:09:41.720
<v Speaker 1>to do this and pull it off and do it

165
00:09:42.279 --> 00:09:48.440
<v Speaker 1>really well. So how did you fill in the missing blanks?

166
00:09:48.480 --> 00:09:52.600
<v Speaker 1>How did you get the knowledge the background in type

167
00:09:52.600 --> 00:09:54.759
<v Speaker 1>systems and stuff like that.

168
00:09:54.759 --> 00:09:57.279
<v Speaker 2>That's a great question, and I think probably there are

169
00:09:57.360 --> 00:10:00.879
<v Speaker 2>still blanks in my knowledge that I don't know, because

170
00:10:01.200 --> 00:10:04.639
<v Speaker 2>I often feel and I think a lot of people

171
00:10:04.639 --> 00:10:08.000
<v Speaker 2>who come into dev as a second career feel this.

172
00:10:08.120 --> 00:10:11.919
<v Speaker 2>They feel like, oh, I missed out on something crucial.

173
00:10:12.080 --> 00:10:14.639
<v Speaker 2>You know, there was something in a CS course that

174
00:10:14.679 --> 00:10:18.200
<v Speaker 2>I never took that I never quite got And I

175
00:10:18.240 --> 00:10:21.519
<v Speaker 2>think a lot of people feel that. But as it

176
00:10:21.559 --> 00:10:25.679
<v Speaker 2>turns out, Typescript operates on a relatively high level. You know,

177
00:10:25.840 --> 00:10:28.559
<v Speaker 2>you don't need to know a lot of the deep stuff.

178
00:10:28.759 --> 00:10:32.759
<v Speaker 2>I'm still like, I still find it hard to explain,

179
00:10:32.840 --> 00:10:36.159
<v Speaker 2>like covariance contravariance in a sentence. I never quite know

180
00:10:36.200 --> 00:10:39.360
<v Speaker 2>if I'm using the terms correctly, and it has felt

181
00:10:39.360 --> 00:10:44.519
<v Speaker 2>to me I feel like if learning that stuff would

182
00:10:44.559 --> 00:10:49.639
<v Speaker 2>benefit the people learning typescript, I would teach it. If,

183
00:10:49.679 --> 00:10:53.759
<v Speaker 2>for instance, contraveriance and covariance was mentioned in typescript errors,

184
00:10:53.919 --> 00:10:55.919
<v Speaker 2>I feel like I would need to teach it. But

185
00:10:57.080 --> 00:10:59.960
<v Speaker 2>as it turns out, me not knowing about that stuff,

186
00:11:00.039 --> 00:11:03.279
<v Speaker 2>I think actually helps in terms of explaining it to people,

187
00:11:03.519 --> 00:11:06.159
<v Speaker 2>because I'm not trying to layer on all of this

188
00:11:06.360 --> 00:11:13.840
<v Speaker 2>extra kind of nomenclature and language onto what are relatively

189
00:11:14.240 --> 00:11:16.879
<v Speaker 2>simple concepts. You know, if you understand what a subset

190
00:11:16.960 --> 00:11:19.919
<v Speaker 2>and a superset is, you know, you can kind of

191
00:11:20.000 --> 00:11:22.799
<v Speaker 2>understand what tapskipt's doing in a lot of cases. And

192
00:11:23.919 --> 00:11:26.320
<v Speaker 2>so I do feel a bit like, oh, maybe it

193
00:11:26.320 --> 00:11:27.679
<v Speaker 2>would have been good for me to do a CS

194
00:11:27.679 --> 00:11:30.440
<v Speaker 2>course learn that stuff, But actually I think not knowing

195
00:11:30.480 --> 00:11:33.399
<v Speaker 2>its not having the curse of knowledge, has benefited me

196
00:11:33.440 --> 00:11:36.639
<v Speaker 2>in weird ways to making me closer to my learners.

197
00:11:38.039 --> 00:11:40.679
<v Speaker 1>First of all, I totally get that. I also have

198
00:11:40.759 --> 00:11:44.000
<v Speaker 1>to say, you know again, I even though I came

199
00:11:44.120 --> 00:11:49.120
<v Speaker 1>into software the more traditional route, I actually started before

200
00:11:49.200 --> 00:11:52.679
<v Speaker 1>I learned. So I did start as a hobbyist, you know,

201
00:11:52.759 --> 00:11:57.000
<v Speaker 1>as a teenager, and then I, after several years of

202
00:11:57.120 --> 00:12:02.639
<v Speaker 1>just basically you know, doing work whatever seemed to make sense,

203
00:12:02.799 --> 00:12:07.480
<v Speaker 1>I went to university. But it's been so long that effectively,

204
00:12:07.559 --> 00:12:10.720
<v Speaker 1>I think every technology that I've learned I'm no longer using,

205
00:12:11.080 --> 00:12:13.919
<v Speaker 1>and every technology that I am using is stuff that

206
00:12:13.960 --> 00:12:19.480
<v Speaker 1>I learned after I actually finished my universities, you know,

207
00:12:19.639 --> 00:12:24.159
<v Speaker 1>that part of my career. So I totally get that

208
00:12:24.279 --> 00:12:27.240
<v Speaker 1>a lot of what we learn is some is the

209
00:12:27.279 --> 00:12:29.679
<v Speaker 1>stuff that we pick up along the way, and in fact,

210
00:12:30.600 --> 00:12:33.480
<v Speaker 1>the thing that I love most it's the biggest challenge

211
00:12:33.480 --> 00:12:36.240
<v Speaker 1>around working, I think in software development, but it's also

212
00:12:36.279 --> 00:12:38.480
<v Speaker 1>the thing I love most is the fact that you

213
00:12:38.639 --> 00:12:43.000
<v Speaker 1>constantly need to be learning stuff and updating your skill

214
00:12:43.039 --> 00:12:46.639
<v Speaker 1>set and knowledge and whatever. And we'll probably get to

215
00:12:46.799 --> 00:12:50.720
<v Speaker 1>how you yourself manage that, especially with typescript, but with

216
00:12:50.799 --> 00:12:54.200
<v Speaker 1>other things as well. But before that, I would actually

217
00:12:54.240 --> 00:12:58.360
<v Speaker 1>like to share something about the way that I got

218
00:12:58.360 --> 00:13:02.000
<v Speaker 1>into typescript, which was a bit different than you, I think,

219
00:13:02.600 --> 00:13:06.440
<v Speaker 1>or maybe maybe maybe not. We will see. I got

220
00:13:06.480 --> 00:13:10.519
<v Speaker 1>into typescript a little bit earlier, around I think twenty fourteen,

221
00:13:10.600 --> 00:13:14.240
<v Speaker 1>fifteen is the first time I actually encountered it, and

222
00:13:14.320 --> 00:13:17.320
<v Speaker 1>I have to tell you that in my initial reaction

223
00:13:17.559 --> 00:13:23.720
<v Speaker 1>was very negative. The reason was that back at that time, Microsoft,

224
00:13:24.759 --> 00:13:27.720
<v Speaker 1>all the examples that they were that were coming out

225
00:13:27.759 --> 00:13:36.000
<v Speaker 1>of Microsoft were around classes and interfaces, and they were showing,

226
00:13:36.279 --> 00:13:39.720
<v Speaker 1>you know, this is how you implement class hierarchies and

227
00:13:39.840 --> 00:13:43.679
<v Speaker 1>interfaces and doing it safely and stuff like that, and

228
00:13:44.279 --> 00:13:48.159
<v Speaker 1>to me, it very much felt like Java or SEA sharp,

229
00:13:49.200 --> 00:13:53.679
<v Speaker 1>And you know, I left Java and C sharp and

230
00:13:53.840 --> 00:13:57.919
<v Speaker 1>went into and you know, got into JavaScript and enjoyed

231
00:13:58.000 --> 00:14:03.200
<v Speaker 1>JavaScript much more than I ever did Java or C sharps.

232
00:14:03.240 --> 00:14:06.600
<v Speaker 1>So the last thing that I wanted was to go back.

233
00:14:06.720 --> 00:14:09.519
<v Speaker 1>I think that the terminology that I was using back

234
00:14:09.519 --> 00:14:14.200
<v Speaker 1>then was this is a poor man's Java. And I

235
00:14:14.320 --> 00:14:17.480
<v Speaker 1>basically said, you know, kind of a little bit reflected

236
00:14:17.559 --> 00:14:23.159
<v Speaker 1>some of the attitudes that Dagge proclaims still to this

237
00:14:23.279 --> 00:14:27.320
<v Speaker 1>day that you know, I like the freedom, I like

238
00:14:27.639 --> 00:14:33.600
<v Speaker 1>the duct typing, the monkey patching. You know, I don't

239
00:14:33.679 --> 00:14:38.600
<v Speaker 1>like to feel constrained. I've got tests as if I

240
00:14:38.639 --> 00:14:43.960
<v Speaker 1>need guardrails and stuff like that. And it took me

241
00:14:44.039 --> 00:14:47.360
<v Speaker 1>a while. It took me a couple of years to

242
00:14:47.519 --> 00:14:54.759
<v Speaker 1>realize the value the typescript actually actually has. When I

243
00:14:54.799 --> 00:15:02.159
<v Speaker 1>started using typescript without without classes in interfaces, did you

244
00:15:02.200 --> 00:15:04.519
<v Speaker 1>go through a similar phase or was it great for

245
00:15:04.639 --> 00:15:05.480
<v Speaker 1>you from the get go?

246
00:15:06.879 --> 00:15:08.840
<v Speaker 2>So it was great for me from the get go,

247
00:15:08.960 --> 00:15:11.159
<v Speaker 2>I have to say. And I feel like, I'm not

248
00:15:11.200 --> 00:15:16.159
<v Speaker 2>sure when type scripts implemented geox, but that's what they did.

249
00:15:16.159 --> 00:15:19.240
<v Speaker 2>They implemented gosex and a few sort of nice niceties

250
00:15:19.279 --> 00:15:24.480
<v Speaker 2>to like basically work better with React. And I was

251
00:15:24.519 --> 00:15:26.080
<v Speaker 2>working on a React app at the time that was

252
00:15:26.080 --> 00:15:29.240
<v Speaker 2>in JavaScript, and we translated that over sort of slowly

253
00:15:29.279 --> 00:15:32.480
<v Speaker 2>to typescripts kind of as we were working, and it

254
00:15:32.559 --> 00:15:34.600
<v Speaker 2>was just great from the get go for me. So

255
00:15:34.799 --> 00:15:40.279
<v Speaker 2>I never actually received that marketing of like, oh, this

256
00:15:40.360 --> 00:15:42.159
<v Speaker 2>is the new c sharp or something, or this is

257
00:15:42.240 --> 00:15:45.039
<v Speaker 2>like you know, I don't think I really sort of

258
00:15:45.080 --> 00:15:47.720
<v Speaker 2>thought about classes and interfaces, and actually, to be honest,

259
00:15:47.799 --> 00:15:51.519
<v Speaker 2>React was quite class based at the time, so no,

260
00:15:51.799 --> 00:15:55.399
<v Speaker 2>I didn't have that. I immediately saw the value and

261
00:15:55.480 --> 00:15:57.639
<v Speaker 2>I immediately started putting it in a React app, which

262
00:15:57.679 --> 00:15:58.519
<v Speaker 2>was mostly functional.

263
00:16:01.399 --> 00:16:04.960
<v Speaker 1>The other aspect of it that was initially problematic for me,

264
00:16:06.639 --> 00:16:10.320
<v Speaker 1>and to an extent it still exists, I guess, is

265
00:16:10.360 --> 00:16:15.080
<v Speaker 1>the fact that the way that at least initially I

266
00:16:15.120 --> 00:16:18.000
<v Speaker 1>thought about it is that I would write a JavaScript

267
00:16:18.080 --> 00:16:22.720
<v Speaker 1>code and then I would add the types in. And

268
00:16:23.919 --> 00:16:29.039
<v Speaker 1>what happened was that the JavaScript code, at least initially

269
00:16:29.080 --> 00:16:33.720
<v Speaker 1>would come very fluently, very flu very quickly, but then

270
00:16:34.240 --> 00:16:39.360
<v Speaker 1>I would literally like sweat bullets adding all the typescript in. Now,

271
00:16:39.559 --> 00:16:43.919
<v Speaker 1>part of it was that obviously I didn't know typescript

272
00:16:43.919 --> 00:16:48.480
<v Speaker 1>well enough. Maybe I still don't, but also that I

273
00:16:48.600 --> 00:16:53.120
<v Speaker 1>was doing, you know, doing some more extreme dynamic style

274
00:16:53.200 --> 00:16:57.480
<v Speaker 1>coding with JavaScript, and that didn't really sit well with

275
00:16:57.600 --> 00:17:00.440
<v Speaker 1>the way that you, you know, you might write script.

276
00:17:01.120 --> 00:17:05.000
<v Speaker 1>So there I was like sweating bullets about getting the

277
00:17:05.079 --> 00:17:09.440
<v Speaker 1>proper type interfaces and and I'm kind of anal about

278
00:17:09.440 --> 00:17:12.200
<v Speaker 1>these things. You know, it has to be perfect, you know,

279
00:17:12.720 --> 00:17:15.559
<v Speaker 1>it can't just be any or stuff like that. And

280
00:17:16.319 --> 00:17:20.880
<v Speaker 1>I was thinking, hey, I'm spending more time on implementing

281
00:17:20.920 --> 00:17:24.000
<v Speaker 1>the types than I am than I had been on

282
00:17:24.039 --> 00:17:31.640
<v Speaker 1>the original logic in JavaScript, and it's it's weird because

283
00:17:31.680 --> 00:17:34.680
<v Speaker 1>at the end of the day, all this type information

284
00:17:34.799 --> 00:17:38.799
<v Speaker 1>is basically stripped out, so when it's actually executed, it's

285
00:17:38.960 --> 00:17:42.759
<v Speaker 1>just the JavaScript back again. So here I am putting

286
00:17:42.799 --> 00:17:49.200
<v Speaker 1>all this effort into something that has literally zero impacted runtime,

287
00:17:49.960 --> 00:17:53.440
<v Speaker 1>and it felt kind of, you know, redundant.

288
00:17:54.960 --> 00:17:57.599
<v Speaker 2>You can feel like, oh, the features done. You know,

289
00:17:57.680 --> 00:17:59.359
<v Speaker 2>I can see it working. Why do I have to

290
00:17:59.359 --> 00:18:03.640
<v Speaker 2>do all this extra effort to exactly to just paint

291
00:18:03.680 --> 00:18:05.880
<v Speaker 2>it really, to just you know, the cars working. I

292
00:18:05.920 --> 00:18:10.160
<v Speaker 2>don't care what it looks like. And I think if

293
00:18:10.240 --> 00:18:14.039
<v Speaker 2>I were to rebut that I think because I do.

294
00:18:15.200 --> 00:18:18.519
<v Speaker 2>I think I didn't have a long leading as like

295
00:18:18.559 --> 00:18:22.400
<v Speaker 2>a JavaScript developer really before becoming a time script maybe

296
00:18:22.400 --> 00:18:24.759
<v Speaker 2>two or three years or so. But folks who've been

297
00:18:24.759 --> 00:18:27.200
<v Speaker 2>writing JavaScript for a long time before that, their habits

298
00:18:27.200 --> 00:18:30.839
<v Speaker 2>are absolutely set, you know, like and all of that

299
00:18:30.920 --> 00:18:33.240
<v Speaker 2>sort of dynamic stuff, you know, like the monkey patching

300
00:18:33.359 --> 00:18:38.799
<v Speaker 2>and all sorts of patterns are kind of typescript. Makes

301
00:18:38.839 --> 00:18:41.599
<v Speaker 2>you be a lot more boring, you know, it makes

302
00:18:41.640 --> 00:18:46.359
<v Speaker 2>you right in quite a sort of dull way. You know,

303
00:18:46.480 --> 00:18:50.319
<v Speaker 2>you don't get a lot of a lot of the

304
00:18:50.359 --> 00:18:53.559
<v Speaker 2>same freedoms that you do when you're working in JavaScript.

305
00:18:53.920 --> 00:18:56.640
<v Speaker 2>Of course, I would argue that is quite a good thing.

306
00:18:56.680 --> 00:18:56.880
<v Speaker 1>You know.

307
00:18:56.960 --> 00:19:00.440
<v Speaker 2>It means that code generally starts like each other. Boring

308
00:19:00.519 --> 00:19:03.880
<v Speaker 2>is good, you know. Yeah, Boring is good. Boring is efficient.

309
00:19:03.920 --> 00:19:06.599
<v Speaker 2>Boring means that you can switch projects easily. Boring means

310
00:19:06.599 --> 00:19:10.960
<v Speaker 2>that you know, boring is good. And I would say

311
00:19:11.000 --> 00:19:15.559
<v Speaker 2>that what I start doing now, having worked in tapic

312
00:19:15.640 --> 00:19:18.960
<v Speaker 2>it for a long time, is I do more type

313
00:19:19.000 --> 00:19:22.680
<v Speaker 2>driven development now, is I'm thinking about the types and

314
00:19:22.720 --> 00:19:26.920
<v Speaker 2>the flow of the types really before I'm thinking about

315
00:19:26.920 --> 00:19:29.759
<v Speaker 2>the runtime architecture perhaps sort of as part of that.

316
00:19:30.400 --> 00:19:33.400
<v Speaker 2>And so I tend to type my function parameters before

317
00:19:33.440 --> 00:19:36.279
<v Speaker 2>I implement them, so I'll just get all my functions

318
00:19:36.279 --> 00:19:38.680
<v Speaker 2>in a row and understand what's happening, and then I

319
00:19:38.680 --> 00:19:41.960
<v Speaker 2>I'll start to implement. So I think that is definitely

320
00:19:42.079 --> 00:19:45.759
<v Speaker 2>for someone coming from a long time JavaScript background, that's

321
00:19:45.839 --> 00:19:49.039
<v Speaker 2>quite alien, you know, because that's really I need to

322
00:19:49.039 --> 00:19:51.440
<v Speaker 2>think about the types before I implement the rest of it.

323
00:19:51.480 --> 00:19:54.720
<v Speaker 2>But that's how I'm certainly thinking about my type of death.

324
00:19:55.799 --> 00:19:58.519
<v Speaker 1>So first of all, by the way, one of the

325
00:19:58.519 --> 00:20:02.119
<v Speaker 1>things that also clicked for me was when I started

326
00:20:02.160 --> 00:20:06.519
<v Speaker 1>thinking about it, like tests. Again, you can write all

327
00:20:06.559 --> 00:20:09.640
<v Speaker 1>your code without tests, and tests themselves again have zero

328
00:20:09.720 --> 00:20:12.759
<v Speaker 1>impact on runtime. They're not part of the runtime bundle.

329
00:20:13.440 --> 00:20:15.920
<v Speaker 1>So again, you know, you could say, well, all the

330
00:20:16.000 --> 00:20:21.319
<v Speaker 1>tests are stripped out effectively, but you know, I really

331
00:20:21.359 --> 00:20:24.200
<v Speaker 1>hate cool bases without tests. You know, it makes me

332
00:20:24.240 --> 00:20:29.359
<v Speaker 1>feel insecure. And even though I sometimes, like, you know,

333
00:20:29.599 --> 00:20:33.000
<v Speaker 1>I'm lazy, I sometimes writing all the tests that I

334
00:20:33.079 --> 00:20:35.039
<v Speaker 1>need to, but you know, at the end of the day,

335
00:20:35.079 --> 00:20:38.039
<v Speaker 1>it's worth it. And I look at the same way

336
00:20:38.079 --> 00:20:42.279
<v Speaker 1>with types, and I've gotten really to the point that

337
00:20:42.440 --> 00:20:47.960
<v Speaker 1>I really can't write JavaScript anymore. Even I love JavaScript.

338
00:20:48.039 --> 00:20:51.240
<v Speaker 1>JavaScript for a long time, it's been my favorite programming language.

339
00:20:51.240 --> 00:20:55.119
<v Speaker 1>I've been doing it since nineteen ninety eight. I'm really

340
00:20:55.440 --> 00:21:01.680
<v Speaker 1>dating myself, so yeah, for a long time, more than

341
00:21:01.680 --> 00:21:08.000
<v Speaker 1>many of our listeners have been alive, maybe, But these

342
00:21:08.079 --> 00:21:13.759
<v Speaker 1>days I'm literally like, I literally like, if I'm writing

343
00:21:13.920 --> 00:21:17.119
<v Speaker 1>just pure JavaScript without the type definition, it feels like

344
00:21:17.160 --> 00:21:20.119
<v Speaker 1>something is missing m And.

345
00:21:20.079 --> 00:21:21.559
<v Speaker 2>I think a lot of people feel that way as well.

346
00:21:21.599 --> 00:21:24.240
<v Speaker 2>That seems to be why typescript is so sticky. It's

347
00:21:24.279 --> 00:21:27.440
<v Speaker 2>not like people adopt typescript and then in my next job,

348
00:21:27.480 --> 00:21:30.160
<v Speaker 2>I'll just write JavaScript because that was too hardcore. No,

349
00:21:30.279 --> 00:21:34.119
<v Speaker 2>people who tend to go into typescript, they don't tend

350
00:21:34.160 --> 00:21:37.240
<v Speaker 2>to leave because you're right, it just doesn't feel the same.

351
00:21:37.400 --> 00:21:41.000
<v Speaker 2>You just I think there was a quote from the

352
00:21:41.039 --> 00:21:43.519
<v Speaker 2>Typescript documentary that really stuck in my head, which is,

353
00:21:44.279 --> 00:21:46.480
<v Speaker 2>when you're writing in JavaScript, you feel like you're carving

354
00:21:46.519 --> 00:21:50.240
<v Speaker 2>in stone. Basically, it's really hard to then change that.

355
00:21:50.319 --> 00:21:53.839
<v Speaker 2>Resulting code code feels a lot less malleable, a lot

356
00:21:53.960 --> 00:21:59.440
<v Speaker 2>less movable, a lot less portable. You just can't change

357
00:21:59.480 --> 00:22:02.880
<v Speaker 2>it with the same rapidity and the same surreness, Whereas

358
00:22:02.880 --> 00:22:05.039
<v Speaker 2>in typescript, if you move something to the wrong place,

359
00:22:05.039 --> 00:22:06.759
<v Speaker 2>it will give you all these warnings. You can check

360
00:22:06.799 --> 00:22:10.559
<v Speaker 2>your entire project, and you can have a lot more

361
00:22:10.599 --> 00:22:15.200
<v Speaker 2>security that your code works the way you think it works.

362
00:22:16.279 --> 00:22:20.279
<v Speaker 1>I totally agree, and this was actually, you know, I

363
00:22:20.680 --> 00:22:24.920
<v Speaker 1>literally experienced this very recently, as in a few days ago,

364
00:22:25.039 --> 00:22:28.799
<v Speaker 1>because that where I work with just some sense, we've

365
00:22:28.839 --> 00:22:32.160
<v Speaker 1>got a lot of legacy code. And one of the

366
00:22:32.160 --> 00:22:34.920
<v Speaker 1>topics that I'll probably bring up with you is you

367
00:22:34.960 --> 00:22:36.960
<v Speaker 1>know how to deal with legacy stuff and how to

368
00:22:37.039 --> 00:22:43.440
<v Speaker 1>port existing jobscript projects to typescript. And I see bugs

369
00:22:43.480 --> 00:22:48.000
<v Speaker 1>in the code that could not happen if the code

370
00:22:48.039 --> 00:22:54.559
<v Speaker 1>had been written in typescript. And you know, there are

371
00:22:54.599 --> 00:22:57.920
<v Speaker 1>a lot of challenges in adding typescript into an existing

372
00:22:58.000 --> 00:23:02.519
<v Speaker 1>jobscript project, especially a lot one. But for me, the

373
00:23:02.559 --> 00:23:07.599
<v Speaker 1>biggest challenge from what I see, is fixing all the

374
00:23:07.680 --> 00:23:13.240
<v Speaker 1>bugs that you discover when you add typescript, because ideally,

375
00:23:13.880 --> 00:23:17.400
<v Speaker 1>adding typescript into an existing job skiped project is basically

376
00:23:17.480 --> 00:23:20.720
<v Speaker 1>just adding types, don't You don't want to be touching

377
00:23:20.720 --> 00:23:24.880
<v Speaker 1>the business logic. But what I find is that I run,

378
00:23:24.960 --> 00:23:27.799
<v Speaker 1>I find bugs in the business logic which I then

379
00:23:27.880 --> 00:23:30.839
<v Speaker 1>need to fix. And and this to me is like

380
00:23:30.920 --> 00:23:35.440
<v Speaker 1>the biggest hassle of adding job typescript into an existing

381
00:23:35.519 --> 00:23:36.440
<v Speaker 1>job script project.

382
00:23:37.160 --> 00:23:40.119
<v Speaker 2>M I mean, that's quite a good hassle to have, right,

383
00:23:40.160 --> 00:23:43.880
<v Speaker 2>you know, like the hassle of making your code better.

384
00:23:44.000 --> 00:23:48.480
<v Speaker 2>I suppose. I mean, in some ways, you know, it

385
00:23:48.559 --> 00:23:52.119
<v Speaker 2>makes you code a bit more defensively. You need to

386
00:23:52.160 --> 00:23:55.000
<v Speaker 2>make sure that you know that your inputs are all correct.

387
00:23:55.319 --> 00:23:58.640
<v Speaker 2>But yeah, you're absolutely right. And that was definitely the

388
00:23:58.680 --> 00:24:01.960
<v Speaker 2>experience we had is that when I first introduced type

389
00:24:01.960 --> 00:24:05.160
<v Speaker 2>script in that very first project, is oh wow, that's

390
00:24:05.200 --> 00:24:07.960
<v Speaker 2>a code path I just didn't see what's possible, or yeah,

391
00:24:08.000 --> 00:24:10.319
<v Speaker 2>that's okay. That could either be a string union or

392
00:24:10.839 --> 00:24:12.920
<v Speaker 2>string or number in that place instead of just a number.

393
00:24:14.319 --> 00:24:16.279
<v Speaker 2>You want to dive into like how to migraines, because

394
00:24:16.279 --> 00:24:17.640
<v Speaker 2>I've definitely got some advice there.

395
00:24:18.079 --> 00:24:21.119
<v Speaker 1>Yeah, you know what. I was saving it for later,

396
00:24:21.200 --> 00:24:24.400
<v Speaker 1>but it seems to naturally fit in here. So let's

397
00:24:24.440 --> 00:24:27.400
<v Speaker 1>say I'll give the background. Let's say I have a

398
00:24:27.480 --> 00:24:32.680
<v Speaker 1>large scale existing JavaScript project. Maybe it's React, maybe it isn't.

399
00:24:33.559 --> 00:24:37.640
<v Speaker 1>I don't know if it matters really and and no

400
00:24:37.799 --> 00:24:42.759
<v Speaker 1>typescript insight, and I want to add typescript into this project,

401
00:24:43.000 --> 00:24:46.559
<v Speaker 1>you know I can. What's the best approach? Should I do,

402
00:24:46.759 --> 00:24:50.200
<v Speaker 1>like like sit down and just try to do it

403
00:24:50.240 --> 00:24:53.920
<v Speaker 1>all in one go? Should I do it incrementally? And

404
00:24:53.960 --> 00:24:58.039
<v Speaker 1>if so, you know, what would be the unit size?

405
00:24:58.119 --> 00:25:02.279
<v Speaker 1>How do I estimate the effort? How do I justify

406
00:25:02.359 --> 00:25:04.799
<v Speaker 1>it to product and management? And I'm going to be

407
00:25:05.119 --> 00:25:08.759
<v Speaker 1>spending all this time yet not adding a single feature

408
00:25:08.799 --> 00:25:13.200
<v Speaker 1>into the product. You know, what can you say about it? Yeah?

409
00:25:13.240 --> 00:25:17.240
<v Speaker 2>So it's a huge topic. Let's add another assumption as well.

410
00:25:17.240 --> 00:25:17.440
<v Speaker 1>Well.

411
00:25:17.599 --> 00:25:20.400
<v Speaker 2>Let's assume that the code base is actively being worked on,

412
00:25:20.480 --> 00:25:22.599
<v Speaker 2>and that there's features being added as well, because that

413
00:25:22.640 --> 00:25:23.960
<v Speaker 2>seems to be the most common case.

414
00:25:24.000 --> 00:25:25.960
<v Speaker 1>Oh yeah, for sure. If it's not worked on, then

415
00:25:25.960 --> 00:25:28.279
<v Speaker 1>what's the point Almost exactly right.

416
00:25:28.559 --> 00:25:32.720
<v Speaker 2>So, like you're working on an active codebase, you need

417
00:25:32.759 --> 00:25:35.519
<v Speaker 2>the CI to remain green all times as well. You

418
00:25:35.559 --> 00:25:37.319
<v Speaker 2>don't want to be doing things which make the CI

419
00:25:37.440 --> 00:25:39.319
<v Speaker 2>read for a certain period of time, and you don't

420
00:25:39.319 --> 00:25:42.720
<v Speaker 2>want to be messing people's stuff up. So there are

421
00:25:42.759 --> 00:25:45.519
<v Speaker 2>a few ways that you could do it. You could

422
00:25:45.759 --> 00:25:49.559
<v Speaker 2>take every single JavaScript file, turn it into a typescript file,

423
00:25:49.720 --> 00:25:52.920
<v Speaker 2>just like with a command or something, and then you

424
00:25:52.960 --> 00:25:55.920
<v Speaker 2>know you're in type script with zero types. And then

425
00:25:55.960 --> 00:25:59.039
<v Speaker 2>perhaps you could ramp down the strictness to the point

426
00:25:59.079 --> 00:26:02.319
<v Speaker 2>where you get zero errors. Right, there's one way to

427
00:26:02.319 --> 00:26:05.039
<v Speaker 2>do it. That's a bad way to do it. The

428
00:26:05.079 --> 00:26:08.279
<v Speaker 2>reason for that is that, first of all, you break

429
00:26:08.319 --> 00:26:11.400
<v Speaker 2>everyone's prs. You know, if anyone has any existing prs,

430
00:26:11.599 --> 00:26:15.400
<v Speaker 2>then they literally can't you know that you would have

431
00:26:15.480 --> 00:26:18.759
<v Speaker 2>to do all sorts of shenanigans to make them.

432
00:26:18.920 --> 00:26:22.160
<v Speaker 1>Basically, they probably want to tell everybody we're doing it

433
00:26:22.319 --> 00:26:26.200
<v Speaker 1>on this week, merge all your prs, don't create any

434
00:26:26.279 --> 00:26:28.599
<v Speaker 1>new prs, and this is what we're doing.

435
00:26:29.279 --> 00:26:32.799
<v Speaker 2>Yeah, big disruption you know, no good, especially to a

436
00:26:32.799 --> 00:26:34.720
<v Speaker 2>big team working on a big mono REAPA, let's say.

437
00:26:36.200 --> 00:26:38.599
<v Speaker 2>And then the thing that's hard after that is that

438
00:26:38.640 --> 00:26:41.759
<v Speaker 2>it's really hard to ramp up the strictness in a

439
00:26:41.799 --> 00:26:45.079
<v Speaker 2>way that's incremental, because you want the CI to stay green.

440
00:26:45.519 --> 00:26:47.960
<v Speaker 2>And if you say, okay, today we're going to turn

441
00:26:48.000 --> 00:26:51.119
<v Speaker 2>on the know any rule, then you turn it on

442
00:26:51.160 --> 00:26:54.759
<v Speaker 2>and it affects your entire codeies, so the CI is

443
00:26:54.799 --> 00:26:58.079
<v Speaker 2>basically red. So I think that that approach which a

444
00:26:58.079 --> 00:27:00.759
<v Speaker 2>lot of people do take of turning every file into

445
00:27:00.759 --> 00:27:03.839
<v Speaker 2>a touch grip file is a bad approach because what

446
00:27:03.920 --> 00:27:07.000
<v Speaker 2>you should do, I think instead is you should add

447
00:27:07.039 --> 00:27:09.240
<v Speaker 2>in a ts comfig into your projects, and you should

448
00:27:09.240 --> 00:27:12.359
<v Speaker 2>install typescripts, and you should choose the highest level of

449
00:27:12.359 --> 00:27:15.359
<v Speaker 2>strictness that you're going to get your desired level of strictness.

450
00:27:16.200 --> 00:27:19.519
<v Speaker 2>And when you do that, you then take it file

451
00:27:19.559 --> 00:27:24.480
<v Speaker 2>by file and you're just turning basically in one PR

452
00:27:24.519 --> 00:27:27.119
<v Speaker 2>you would just turn one file into a touch gript file,

453
00:27:27.559 --> 00:27:30.440
<v Speaker 2>and by doing that you might find external libraries that

454
00:27:30.519 --> 00:27:33.279
<v Speaker 2>need to be important types and stuff, and you fix

455
00:27:33.319 --> 00:27:35.440
<v Speaker 2>the types in there you can use like any at

456
00:27:35.440 --> 00:27:37.079
<v Speaker 2>this point as well, you know, if you need to,

457
00:27:37.079 --> 00:27:39.880
<v Speaker 2>if you need to get around it. But that's what

458
00:27:39.880 --> 00:27:43.240
<v Speaker 2>I would start with. And the key there is that

459
00:27:43.559 --> 00:27:47.240
<v Speaker 2>the order of the files that you choose is really important, right,

460
00:27:47.880 --> 00:27:50.720
<v Speaker 2>because let's imagine that your code base is like a tree.

461
00:27:50.880 --> 00:27:54.680
<v Speaker 2>You know, you've got the files that are imported very often,

462
00:27:54.720 --> 00:27:56.160
<v Speaker 2>sort of at the top of the tree and sort

463
00:27:56.200 --> 00:27:58.799
<v Speaker 2>of like spreading down like that, and the files that

464
00:27:58.880 --> 00:28:01.759
<v Speaker 2>are used in lots of places. You want to do

465
00:28:01.839 --> 00:28:05.240
<v Speaker 2>those first, and you want to translate in touch script first.

466
00:28:05.279 --> 00:28:07.119
<v Speaker 2>The ones with the fewest dependencies You can use a

467
00:28:07.160 --> 00:28:09.880
<v Speaker 2>tool like match I think to basically walk up the tree.

468
00:28:10.319 --> 00:28:12.720
<v Speaker 1>You want the ones you want to start with the

469
00:28:12.759 --> 00:28:17.480
<v Speaker 1>ones that have the fewest, that depend on the fewest things,

470
00:28:18.119 --> 00:28:20.920
<v Speaker 1>and but on the other hand that a lot of

471
00:28:20.960 --> 00:28:25.960
<v Speaker 1>stuff depends on them. That way you you create small

472
00:28:26.039 --> 00:28:29.599
<v Speaker 1>disruption but quickly bring on the most amount of value.

473
00:28:30.279 --> 00:28:34.160
<v Speaker 2>Yes, And the reason for that is so like your

474
00:28:34.240 --> 00:28:38.279
<v Speaker 2>utilities folders for instance, or the files that contain you know,

475
00:28:38.799 --> 00:28:40.559
<v Speaker 2>math or something or things.

476
00:28:40.359 --> 00:28:44.799
<v Speaker 1>That we use which project does not have a utilis folder.

477
00:28:45.079 --> 00:28:47.920
<v Speaker 2>Exactly right, that's where you want to start. The reason

478
00:28:48.039 --> 00:28:50.359
<v Speaker 2>is is that if you start further down the tree,

479
00:28:51.000 --> 00:28:53.480
<v Speaker 2>then your touch grip code is going to be depending

480
00:28:53.640 --> 00:28:57.160
<v Speaker 2>on JavaScript code, and that's a really nasty place to

481
00:28:57.160 --> 00:28:59.359
<v Speaker 2>be because all of the JavaScript code is just going

482
00:28:59.440 --> 00:29:02.200
<v Speaker 2>to produce any's and so that anys are then going

483
00:29:02.240 --> 00:29:06.440
<v Speaker 2>to filter through, whereas if you start with a typescript

484
00:29:06.440 --> 00:29:09.039
<v Speaker 2>file that has no JavaScript dependencies, you're going to be

485
00:29:09.079 --> 00:29:10.400
<v Speaker 2>in a really really good spot. And then you just

486
00:29:10.440 --> 00:29:13.839
<v Speaker 2>slowly go down the tree. And so Century has an

487
00:29:13.920 --> 00:29:21.039
<v Speaker 2>amazing article about this. They basically did this for Yeah,

488
00:29:21.039 --> 00:29:23.079
<v Speaker 2>I'll drop a link certainly later, but if you google

489
00:29:23.119 --> 00:29:27.559
<v Speaker 2>Century Typescript, it will come up and that's Century the Eralogua,

490
00:29:27.640 --> 00:29:31.680
<v Speaker 2>not like you know, a century of time. And what

491
00:29:31.839 --> 00:29:34.200
<v Speaker 2>they did was they basically said, Okay, we're just going

492
00:29:34.200 --> 00:29:36.039
<v Speaker 2>to share this out among the devs. Whenever you have

493
00:29:36.079 --> 00:29:38.240
<v Speaker 2>a free minute, whenever you finish your tasks for the sprint,

494
00:29:39.000 --> 00:29:41.680
<v Speaker 2>just translate a typescript file and go down this list

495
00:29:41.759 --> 00:29:44.960
<v Speaker 2>of all of our dependencies. And so they slowly did

496
00:29:44.960 --> 00:29:47.440
<v Speaker 2>that over the period of about two years, and it

497
00:29:47.480 --> 00:29:49.519
<v Speaker 2>took them a while to get it done. And I

498
00:29:49.519 --> 00:29:51.920
<v Speaker 2>think there are still files in that codebase. It's an

499
00:29:51.920 --> 00:29:54.839
<v Speaker 2>open source code base as well. There are still javascripts

500
00:29:54.839 --> 00:29:57.160
<v Speaker 2>and mostly like tests and things that they just haven't

501
00:29:57.200 --> 00:30:00.920
<v Speaker 2>needed to change. But every new file, of course, is

502
00:30:00.960 --> 00:30:03.839
<v Speaker 2>still in typescripts. And so that was the process they followed,

503
00:30:03.960 --> 00:30:07.920
<v Speaker 2>and I think it worked really really well. I interviewed Priscilla,

504
00:30:08.000 --> 00:30:11.480
<v Speaker 2>one of their devs for my course, and she sort

505
00:30:11.480 --> 00:30:15.240
<v Speaker 2>of explained the whole thing, and that is the process

506
00:30:15.319 --> 00:30:18.440
<v Speaker 2>I would follow. Basically, make a dependency tree, workout which

507
00:30:18.440 --> 00:30:20.799
<v Speaker 2>ones to do first, add in a TS conflict with

508
00:30:20.839 --> 00:30:23.599
<v Speaker 2>the maximum strictness, and go file by file, keeping that

509
00:30:23.720 --> 00:30:26.960
<v Speaker 2>CI always green, making sure you're not stepping on anyone's prs,

510
00:30:27.079 --> 00:30:30.200
<v Speaker 2>and maybe during people's trs they can tend to script.

511
00:30:30.279 --> 00:30:32.720
<v Speaker 1>Do you know what occurred to me, Maybe is an

512
00:30:32.759 --> 00:30:37.440
<v Speaker 1>idea for a feature. If anybody from the typescript dev

513
00:30:37.519 --> 00:30:39.480
<v Speaker 1>team is listening, or maybe you'll tell me it's a

514
00:30:39.480 --> 00:30:42.400
<v Speaker 1>stupid idea, and in which case, don't do it. It

515
00:30:42.519 --> 00:30:46.640
<v Speaker 1>might it might be beneficial to have like two levels

516
00:30:46.759 --> 00:30:52.039
<v Speaker 1>of Typescript support. So if your typescript or TS or

517
00:30:52.119 --> 00:30:55.279
<v Speaker 1>TSX file, then you go with the strictest definition, but

518
00:30:55.400 --> 00:30:58.119
<v Speaker 1>there's a transitional period that your work. You're taking a

519
00:30:58.200 --> 00:31:03.279
<v Speaker 1>JavaScript file and then you're transition translating into into TS.

520
00:31:03.759 --> 00:31:07.000
<v Speaker 1>It might have been beneficial to have like a TS

521
00:31:07.000 --> 00:31:13.039
<v Speaker 1>star or TS you know, TS two whatever file that

522
00:31:13.039 --> 00:31:21.519
<v Speaker 1>that has like less strict settings, so which would allow

523
00:31:21.599 --> 00:31:24.799
<v Speaker 1>you to gradually get that file to where you want

524
00:31:24.799 --> 00:31:29.400
<v Speaker 1>to go without having too lower And that's because one

525
00:31:29.440 --> 00:31:32.319
<v Speaker 1>of the things that I'm seeing is that, unfortunately, at

526
00:31:32.400 --> 00:31:35.279
<v Speaker 1>least with some of these legacy projects, some of the

527
00:31:35.319 --> 00:31:40.000
<v Speaker 1>files are pretty large. You unfortunately encounter like a one

528
00:31:40.039 --> 00:31:45.759
<v Speaker 1>thousand and nine file. And now obviously you can say, okay,

529
00:31:45.839 --> 00:31:48.400
<v Speaker 1>then part of the project is also splitting up such

530
00:31:48.480 --> 00:31:53.680
<v Speaker 1>large files into smaller files. But that significantly increases the

531
00:31:53.720 --> 00:31:56.920
<v Speaker 1>scope of the project. So ideally you would like to

532
00:31:57.079 --> 00:31:59.680
<v Speaker 1>handle that, you would like to keep the file structure.

533
00:31:59.839 --> 00:32:05.200
<v Speaker 1>It's also good good forget and stuff like that. And

534
00:32:06.839 --> 00:32:11.640
<v Speaker 1>in that context, taking a one thousand line file and

535
00:32:12.359 --> 00:32:16.000
<v Speaker 1>turning it all into strict from JavaScript into script type

536
00:32:16.160 --> 00:32:19.680
<v Speaker 1>script in one go can be fairly challenging. Now, obviously

537
00:32:19.720 --> 00:32:22.519
<v Speaker 1>you can turn off various rules in the scope of

538
00:32:22.519 --> 00:32:25.440
<v Speaker 1>that particular file, I guess, but that's a pretty big asp.

539
00:32:26.440 --> 00:32:29.519
<v Speaker 2>Not quite, I mean, you could, I suppose, I mean,

540
00:32:29.640 --> 00:32:32.039
<v Speaker 2>there is a very complicated way of doing that. But

541
00:32:32.160 --> 00:32:35.519
<v Speaker 2>in general, if you have a typescript project, the rules

542
00:32:35.559 --> 00:32:39.039
<v Speaker 2>apply equally to every file. Essentially, one thing you could

543
00:32:39.079 --> 00:32:41.799
<v Speaker 2>do with a file like that is just use any

544
00:32:41.960 --> 00:32:44.319
<v Speaker 2>in lots of places or ts ignore all the errors

545
00:32:44.400 --> 00:32:45.359
<v Speaker 2>or yeah.

546
00:32:45.400 --> 00:32:47.240
<v Speaker 1>But then but then that means that you need to

547
00:32:47.279 --> 00:32:50.319
<v Speaker 1>support any everywhere, which you may not want to do.

548
00:32:51.200 --> 00:32:53.200
<v Speaker 2>Yeah, and if it's a file that's dependent on a lot,

549
00:32:53.359 --> 00:32:56.359
<v Speaker 2>then if you have any in that top file, it's

550
00:32:56.400 --> 00:32:58.759
<v Speaker 2>going to spread down like a virus into all the others,

551
00:32:58.799 --> 00:33:02.319
<v Speaker 2>you know, exactly, Yeah, it's it's just hard. I think

552
00:33:02.759 --> 00:33:06.279
<v Speaker 2>there will be situations like that. And honestly, starting with

553
00:33:06.440 --> 00:33:10.920
<v Speaker 2>the utils folder, that's probably going to be the hardest

554
00:33:10.960 --> 00:33:11.480
<v Speaker 2>to type.

555
00:33:11.839 --> 00:33:12.039
<v Speaker 1>Right.

556
00:33:12.319 --> 00:33:14.319
<v Speaker 2>You might end up needing some generics in there, some

557
00:33:14.400 --> 00:33:19.599
<v Speaker 2>generic types and generic functions because those that so, but

558
00:33:19.720 --> 00:33:22.039
<v Speaker 2>you might need that, and that's a hard place to

559
00:33:22.079 --> 00:33:25.160
<v Speaker 2>start if you're just beginning a typescript migration and upskilling

560
00:33:25.200 --> 00:33:28.079
<v Speaker 2>your team. So usually you do need someone who's going

561
00:33:28.160 --> 00:33:29.759
<v Speaker 2>to be you know, the type script wizard on that

562
00:33:29.839 --> 00:33:33.519
<v Speaker 2>team to tackle the utils file so that everyone else

563
00:33:33.559 --> 00:33:34.079
<v Speaker 2>can benefit.

564
00:33:34.119 --> 00:33:39.200
<v Speaker 1>Basically, whichly to another point, I've talked to people who

565
00:33:39.279 --> 00:33:44.839
<v Speaker 1>are basically like thinking about doing this transition, and they said, well,

566
00:33:44.920 --> 00:33:47.880
<v Speaker 1>the code base is one challenge. But the other challenge

567
00:33:47.920 --> 00:33:51.720
<v Speaker 1>is my developers. Now these days, it's you're getting more

568
00:33:51.759 --> 00:33:54.920
<v Speaker 1>and more front end or JavaScript developers that are effectively

569
00:33:54.960 --> 00:33:58.079
<v Speaker 1>typescript developers, but there are still a lot of JavaScript

570
00:33:58.119 --> 00:34:03.559
<v Speaker 1>developers who are not typescripts out there. And the reality

571
00:34:03.680 --> 00:34:07.119
<v Speaker 1>is is that I had a team to tell me,

572
00:34:07.640 --> 00:34:10.760
<v Speaker 1>you know, you want us to go full typeescript, but

573
00:34:10.920 --> 00:34:16.679
<v Speaker 1>my debs don't really know Typescript. And it's a problem

574
00:34:16.719 --> 00:34:20.639
<v Speaker 1>if I effectively have my developers working in a programming

575
00:34:20.719 --> 00:34:23.559
<v Speaker 1>language that they don't know, what we will end up

576
00:34:23.639 --> 00:34:26.079
<v Speaker 1>is them using a lot of Any's and if I

577
00:34:26.199 --> 00:34:30.480
<v Speaker 1>don't allow them to use Any's, then they'll potentially get stuck.

578
00:34:32.000 --> 00:34:36.559
<v Speaker 1>And now, obviously, you know, you're obviously working to address

579
00:34:36.599 --> 00:34:39.599
<v Speaker 1>that by teaching developers Typescript, But if I have an

580
00:34:39.639 --> 00:34:43.199
<v Speaker 1>existing team, like, what would be the best way to

581
00:34:43.280 --> 00:34:46.920
<v Speaker 1>get the team into typescript, Well.

582
00:34:46.800 --> 00:34:49.800
<v Speaker 2>I mean, the cool thing about Typescript is that it's

583
00:34:49.880 --> 00:34:54.920
<v Speaker 2>not a really heavy lift in terms of learning. If

584
00:34:56.000 --> 00:34:58.559
<v Speaker 2>this is what I don't like about other languages that

585
00:34:58.760 --> 00:35:02.079
<v Speaker 2>are sort of trying to solve the same problem as Typescript,

586
00:35:02.119 --> 00:35:05.079
<v Speaker 2>which is basically adding a type system to JavaScript. So

587
00:35:05.159 --> 00:35:09.000
<v Speaker 2>things like OKAML or I'm not sure. I don't know

588
00:35:09.039 --> 00:35:11.159
<v Speaker 2>okammeill that well, but I know that's one of its uses.

589
00:35:12.559 --> 00:35:16.599
<v Speaker 2>Risen mL ELM, things like that. I don't like those

590
00:35:16.639 --> 00:35:18.840
<v Speaker 2>because there are much heavier lift in terms.

591
00:35:18.599 --> 00:35:21.639
<v Speaker 1>Of learning different programming language, different.

592
00:35:21.360 --> 00:35:25.199
<v Speaker 2>Programming language, whereas and typescript people will say, surely that's

593
00:35:25.199 --> 00:35:28.639
<v Speaker 2>a different programming language, isn't it. Well no, I don't

594
00:35:28.679 --> 00:35:30.800
<v Speaker 2>think so. It's really just a sort of set of

595
00:35:30.840 --> 00:35:35.079
<v Speaker 2>decorations on top of JavaScript, and you're using a lot

596
00:35:35.079 --> 00:35:37.880
<v Speaker 2>of the same intuitions as you have in javascripts just

597
00:35:37.960 --> 00:35:40.599
<v Speaker 2>to be able to add types to it. So I

598
00:35:40.639 --> 00:35:46.000
<v Speaker 2>think when you do that, you do need someone who

599
00:35:46.320 --> 00:35:49.280
<v Speaker 2>I think can lead or be the go to person

600
00:35:49.440 --> 00:35:53.480
<v Speaker 2>at that company who can answer people's typescript questions. So

601
00:35:53.599 --> 00:35:57.280
<v Speaker 2>I think a team that's just sort of like with

602
00:35:57.679 --> 00:36:01.760
<v Speaker 2>zero typescript knowledge whatsoever going into a tapkript migration is

603
00:36:02.079 --> 00:36:03.880
<v Speaker 2>I think going to have a pretty tricky time unless

604
00:36:03.920 --> 00:36:08.519
<v Speaker 2>they invest in some resources to help them out. But yeah,

605
00:36:08.559 --> 00:36:10.599
<v Speaker 2>you do need that person at the company who can

606
00:36:10.639 --> 00:36:13.880
<v Speaker 2>just be the go to typescript wizard to say, help

607
00:36:13.920 --> 00:36:16.079
<v Speaker 2>me out please. I'm just I'm just stuck on a

608
00:36:16.119 --> 00:36:19.960
<v Speaker 2>problem because if you don't develop that intuition, it can

609
00:36:19.960 --> 00:36:22.360
<v Speaker 2>take a while to muscle through on your own. But

610
00:36:22.440 --> 00:36:24.840
<v Speaker 2>I think the basics of typescripts, I think you can

611
00:36:24.880 --> 00:36:27.840
<v Speaker 2>get productive in tap script pretty quickly. Was that your

612
00:36:27.840 --> 00:36:28.719
<v Speaker 2>experience of learning it?

613
00:36:29.920 --> 00:36:33.519
<v Speaker 1>Well, to be fair, I came into typescript as a

614
00:36:33.519 --> 00:36:36.960
<v Speaker 1>as a very experienced developer who's been around the block,

615
00:36:37.079 --> 00:36:42.159
<v Speaker 1>and I actually started with statically type language. Well that's

616
00:36:42.159 --> 00:36:46.599
<v Speaker 1>not actually true. I started with basic, but I pretty

617
00:36:46.679 --> 00:36:49.400
<v Speaker 1>soon got into statically type languages. So most of the

618
00:36:49.760 --> 00:36:54.000
<v Speaker 1>most of my programming career was actually spent in statically

619
00:36:54.039 --> 00:36:57.719
<v Speaker 1>type languages to an extent. Going to JavaScript, I felt

620
00:36:57.760 --> 00:37:01.800
<v Speaker 1>deliberation into an extent, and of putting all the static

621
00:37:01.840 --> 00:37:07.039
<v Speaker 1>types behind and and you know, just saying, you know,

622
00:37:07.559 --> 00:37:10.760
<v Speaker 1>the wild wild West, as it were, of you know,

623
00:37:10.920 --> 00:37:15.440
<v Speaker 1>it can be whatever, uh, and dynamic object structure and whatnot.

624
00:37:15.599 --> 00:37:17.719
<v Speaker 1>I by the way, one of the things that I

625
00:37:17.920 --> 00:37:21.079
<v Speaker 1>like to say about typescript is that the tasks that

626
00:37:21.119 --> 00:37:24.599
<v Speaker 1>they pick for themselves is literally herding cats. Because you

627
00:37:24.719 --> 00:37:30.360
<v Speaker 1>have the poster chart for dynamically dynamic programming, you know,

628
00:37:30.480 --> 00:37:34.920
<v Speaker 1>programming language which is not only dynamically typed, but dynamically

629
00:37:34.960 --> 00:37:39.800
<v Speaker 1>structured and and everything is about duct typing and stuff

630
00:37:39.840 --> 00:37:43.400
<v Speaker 1>like that, and then you're trying to, uh, you know,

631
00:37:43.760 --> 00:37:47.840
<v Speaker 1>implement a static type system on top of that. It's

632
00:37:47.880 --> 00:37:50.599
<v Speaker 1>it's it's pretty amazing what the types of the team

633
00:37:50.599 --> 00:37:52.599
<v Speaker 1>has been able to achieve in that context. And I

634
00:37:52.719 --> 00:37:54.960
<v Speaker 1>guess we'll get into some of the finer points if

635
00:37:54.960 --> 00:37:59.360
<v Speaker 1>we have some time later on in this podcast. So,

636
00:37:59.440 --> 00:38:02.840
<v Speaker 1>for example, I learned generics or templates as they were

637
00:38:02.880 --> 00:38:05.519
<v Speaker 1>called in C plus plus. So by the time that

638
00:38:05.559 --> 00:38:08.480
<v Speaker 1>I got to typescript the concept and then I used

639
00:38:08.480 --> 00:38:10.239
<v Speaker 1>them in Java and in C sharps. So by the

640
00:38:10.280 --> 00:38:13.800
<v Speaker 1>time that I got to typescript, that was already familiar

641
00:38:14.599 --> 00:38:17.480
<v Speaker 1>with these concepts. So it was less of a hurdle

642
00:38:17.519 --> 00:38:20.239
<v Speaker 1>for me. Then it might then it might have been,

643
00:38:20.400 --> 00:38:22.519
<v Speaker 1>you know, had I not had that background.

644
00:38:23.079 --> 00:38:26.679
<v Speaker 2>M hmm, I think you can. One thing that occurs

645
00:38:26.719 --> 00:38:29.199
<v Speaker 2>to me is that you don't necessarily need to learn

646
00:38:29.239 --> 00:38:31.679
<v Speaker 2>the really advanced parts of typescript in order to get

647
00:38:31.719 --> 00:38:35.880
<v Speaker 2>productive with it. Often there are kind of like I

648
00:38:35.880 --> 00:38:39.960
<v Speaker 2>think there are kind of two areas or possibly three areas. Actually,

649
00:38:40.039 --> 00:38:43.159
<v Speaker 2>I think in terms of the level of typescript that

650
00:38:43.159 --> 00:38:45.480
<v Speaker 2>you need to interact with it, which is you probably

651
00:38:45.480 --> 00:38:47.440
<v Speaker 2>need someone on your team who's able to write kind

652
00:38:47.480 --> 00:38:51.159
<v Speaker 2>of library level Typescript code, you know, like someone.

653
00:38:50.840 --> 00:38:56.800
<v Speaker 1>Who killed folder exactly. Let's let's hold on off on

654
00:38:56.880 --> 00:38:59.719
<v Speaker 1>that because I actually want to get into that specific

655
00:38:59.760 --> 00:39:03.840
<v Speaker 1>point and and a bit later in our conversation, and

656
00:39:04.239 --> 00:39:07.119
<v Speaker 1>before that, I have I have a different question for you.

657
00:39:07.679 --> 00:39:11.920
<v Speaker 1>So what I really wanted you to ask. So you're

658
00:39:11.960 --> 00:39:15.519
<v Speaker 1>obviously a Typescript aficionado. You really love the concept, you

659
00:39:15.599 --> 00:39:17.599
<v Speaker 1>love you love the language. But by the way, one

660
00:39:17.679 --> 00:39:19.880
<v Speaker 1>of the other things that I think we forgot to mention,

661
00:39:20.599 --> 00:39:23.440
<v Speaker 1>but the big reasons for Typescript success, it's just the

662
00:39:23.519 --> 00:39:28.239
<v Speaker 1>integration with development environments. This whole thing about you know.

663
00:39:28.320 --> 00:39:30.400
<v Speaker 1>One of the things that kind of came out in

664
00:39:30.440 --> 00:39:35.000
<v Speaker 1>that video that you mentioned about Typescript was the fact

665
00:39:35.079 --> 00:39:37.639
<v Speaker 1>that you can look at it as a programming language,

666
00:39:37.960 --> 00:39:40.199
<v Speaker 1>but you can also look at it as a tool

667
00:39:41.039 --> 00:39:46.280
<v Speaker 1>uh and and tool for the JavaScript programming language. Uh.

668
00:39:46.320 --> 00:39:49.840
<v Speaker 1>And the great integration that you had from almost day

669
00:39:49.840 --> 00:39:53.599
<v Speaker 1>one with vs code is I think it made a

670
00:39:53.679 --> 00:39:56.119
<v Speaker 1>huge difference. Obviously, now you also get the same level

671
00:39:56.159 --> 00:39:58.320
<v Speaker 1>of integration with you know, with other tools like web

672
00:39:58.360 --> 00:40:02.239
<v Speaker 1>Storm or whatever, but without that level of integration, I

673
00:40:02.280 --> 00:40:08.480
<v Speaker 1>don't think. So the whole thing of this typescript service

674
00:40:08.920 --> 00:40:12.679
<v Speaker 1>that's running on your computer and that the editor can

675
00:40:12.719 --> 00:40:16.639
<v Speaker 1>communicate with it and it does all the type checking

676
00:40:16.679 --> 00:40:19.280
<v Speaker 1>for you in real time. So that was a huge win.

677
00:40:20.639 --> 00:40:23.360
<v Speaker 1>And coupled with that is all the type information that

678
00:40:23.400 --> 00:40:27.559
<v Speaker 1>they created for existing frameworks and libraries. So all of

679
00:40:27.559 --> 00:40:30.960
<v Speaker 1>a sudden, even if I'm just working in JavaScript and

680
00:40:31.000 --> 00:40:33.679
<v Speaker 1>not Typescript, I'm getting a lot of the benefits of

681
00:40:33.719 --> 00:40:35.519
<v Speaker 1>Typescript totally.

682
00:40:35.599 --> 00:40:38.159
<v Speaker 2>So this was about eleven years ago when Timescript first

683
00:40:38.239 --> 00:40:43.199
<v Speaker 2>kind of came out. And the thing that I think

684
00:40:43.239 --> 00:40:45.679
<v Speaker 2>a lot of people probably or brought a lot of

685
00:40:45.719 --> 00:40:50.159
<v Speaker 2>people in was one of my friends called Johnny Riley,

686
00:40:50.199 --> 00:40:55.480
<v Speaker 2>who ran the definitely typed repo. He spent a weekend

687
00:40:55.519 --> 00:40:58.760
<v Speaker 2>I think when his son was very very small, making

688
00:40:59.400 --> 00:41:05.440
<v Speaker 2>typesquery and basically like typing jQuery, so you suddenly had

689
00:41:05.800 --> 00:41:08.880
<v Speaker 2>autocompletes for everything jQuery could do, and he wrote these

690
00:41:08.880 --> 00:41:11.639
<v Speaker 2>beautiful jas dot comments which are still there to this day.

691
00:41:12.480 --> 00:41:16.400
<v Speaker 2>And I don't know, I mean that level of integration,

692
00:41:16.480 --> 00:41:20.000
<v Speaker 2>the fact that not only was Typescript and vs code

693
00:41:20.079 --> 00:41:23.920
<v Speaker 2>kind of being built at the same time, but typescripts.

694
00:41:23.960 --> 00:41:26.280
<v Speaker 2>The VSC team went to the typescript team and said,

695
00:41:26.639 --> 00:41:28.920
<v Speaker 2>we hear what you're working on is pretty cool. Do

696
00:41:28.960 --> 00:41:31.360
<v Speaker 2>you mind if we use it to build VS code?

697
00:41:31.639 --> 00:41:33.400
<v Speaker 2>So I don't think VS code because it was such

698
00:41:33.440 --> 00:41:37.719
<v Speaker 2>a complex jawscript application. They really wanted a strongly typed language,

699
00:41:37.760 --> 00:41:41.480
<v Speaker 2>so they were built actually at the same time using

700
00:41:41.960 --> 00:41:43.960
<v Speaker 2>really within Microsoft Amazing.

701
00:41:44.639 --> 00:41:49.599
<v Speaker 1>I just do. Yeah, that's the other thing I know.

702
00:41:49.840 --> 00:41:52.840
<v Speaker 1>I mean when I look at projects that somehow get

703
00:41:52.880 --> 00:41:55.519
<v Speaker 1>by with our typescript, they're usually very small, and it's

704
00:41:55.519 --> 00:41:58.679
<v Speaker 1>a legitimate thing. But all the projects that I've been

705
00:41:58.719 --> 00:42:03.360
<v Speaker 1>working on in the world of JavaScript development, be it

706
00:42:03.920 --> 00:42:06.440
<v Speaker 1>in the browser or be it in node, in the

707
00:42:06.480 --> 00:42:10.920
<v Speaker 1>past decade have been really large. I mean projects where

708
00:42:10.960 --> 00:42:14.079
<v Speaker 1>you've got teams of at least ten, sometimes as large

709
00:42:14.079 --> 00:42:17.000
<v Speaker 1>as fifty working on code basis that can be up

710
00:42:17.000 --> 00:42:21.920
<v Speaker 1>to a million lines of code. Doing that without typing

711
00:42:23.039 --> 00:42:25.159
<v Speaker 1>is bordering on insane.

712
00:42:25.400 --> 00:42:30.360
<v Speaker 2>Yeah, because I mean, just in very simple terms, when

713
00:42:30.400 --> 00:42:33.880
<v Speaker 2>you're working on like, the more developers you add to

714
00:42:33.920 --> 00:42:37.039
<v Speaker 2>the projects, the more likely you are that one of

715
00:42:37.079 --> 00:42:38.960
<v Speaker 2>those developers is going to make a mistake. You know,

716
00:42:39.159 --> 00:42:41.159
<v Speaker 2>just the number of mistakes goes up as the number

717
00:42:41.159 --> 00:42:44.079
<v Speaker 2>of developers working on something goes up. It's just you

718
00:42:44.119 --> 00:42:48.679
<v Speaker 2>know how maths works, and when you have something that

719
00:42:48.840 --> 00:42:51.480
<v Speaker 2>you can just sort of stick in a project, you

720
00:42:51.480 --> 00:42:53.639
<v Speaker 2>can run on your CI Let's say, you know, whenever

721
00:42:53.679 --> 00:42:56.039
<v Speaker 2>a pr comes in and just check if anyone's made

722
00:42:56.039 --> 00:42:58.960
<v Speaker 2>a typo, check if a whole class of those mistakes.

723
00:43:00.199 --> 00:43:02.719
<v Speaker 2>That's just so valuable for teams, and especially when you

724
00:43:02.760 --> 00:43:04.559
<v Speaker 2>have code that's being worked on at the same time

725
00:43:04.639 --> 00:43:06.320
<v Speaker 2>you want to check if that code is compassible with

726
00:43:06.360 --> 00:43:10.360
<v Speaker 2>each other. Having an automated system for doing that is incredible.

727
00:43:10.400 --> 00:43:12.679
<v Speaker 2>And of course touch Coupe doesn't catch everything, but it

728
00:43:12.719 --> 00:43:17.119
<v Speaker 2>catches an enormous amount for a very low or comparatively

729
00:43:17.159 --> 00:43:18.000
<v Speaker 2>low level of effort.

730
00:43:18.800 --> 00:43:21.119
<v Speaker 1>I totally agree. And there's the other side of it,

731
00:43:21.400 --> 00:43:25.599
<v Speaker 1>which is the fact that jobscript is so very forgiving,

732
00:43:25.679 --> 00:43:29.320
<v Speaker 1>and so is the browser, and so so are basically

733
00:43:29.400 --> 00:43:32.480
<v Speaker 1>in almost any environment that runs JavaScript. So you know,

734
00:43:32.519 --> 00:43:35.159
<v Speaker 1>again people would say, why do I need JavaScript, I've

735
00:43:35.199 --> 00:43:39.599
<v Speaker 1>got tests. But the thing is that the environment is

736
00:43:39.639 --> 00:43:44.840
<v Speaker 1>so forgiving that you can have a catastrophic failure and

737
00:43:44.920 --> 00:43:48.880
<v Speaker 1>still pass the test. So unless the test is specific enough,

738
00:43:50.719 --> 00:43:55.599
<v Speaker 1>you can still get by with bugs. Like I mentioned

739
00:43:55.599 --> 00:43:59.000
<v Speaker 1>before that I'm fixing legacy software, I'm catching a lot

740
00:43:59.039 --> 00:44:05.679
<v Speaker 1>of bugs. These are often systems that have uh end

741
00:44:05.719 --> 00:44:08.400
<v Speaker 1>to ntest that's saying place and the end to ntest

742
00:44:08.519 --> 00:44:13.599
<v Speaker 1>pass because the browser is such a forgiving environment. But

743
00:44:13.719 --> 00:44:16.280
<v Speaker 1>it doesn't change the fact that you you've had a

744
00:44:16.320 --> 00:44:18.400
<v Speaker 1>stupid bug in there that you know, you've got some

745
00:44:18.519 --> 00:44:21.519
<v Speaker 1>undefined in there where you should have had some value

746
00:44:21.559 --> 00:44:24.719
<v Speaker 1>and it's somehow able to buddle through until you know

747
00:44:24.880 --> 00:44:28.800
<v Speaker 1>maybe it does it anyway, So I would like to

748
00:44:28.840 --> 00:44:32.440
<v Speaker 1>get to the next my next question. And you know,

749
00:44:33.480 --> 00:44:37.800
<v Speaker 1>typescript keeps evolving, uh and and getting new features. What

750
00:44:37.960 --> 00:44:39.639
<v Speaker 1>version are we at? Five point what.

751
00:44:40.559 --> 00:44:43.760
<v Speaker 2>I think we're five point seven now? Is that right?

752
00:44:44.480 --> 00:44:49.440
<v Speaker 2>Let me check five point seven is the new beta

753
00:44:49.480 --> 00:44:50.719
<v Speaker 2>that's coming out, So I'm pretty sure.

754
00:44:50.800 --> 00:44:53.880
<v Speaker 1>Okay, So first of all, let's start with with one thing.

755
00:44:54.000 --> 00:44:56.480
<v Speaker 1>Let's start with what do you I think we kind

756
00:44:56.519 --> 00:44:58.880
<v Speaker 1>of covered it, but maybe you can be more explicit

757
00:44:58.920 --> 00:45:02.119
<v Speaker 1>about it. What do you like most about Typescript? But

758
00:45:02.239 --> 00:45:04.880
<v Speaker 1>the other side of that equation, is there anything that

759
00:45:04.920 --> 00:45:09.079
<v Speaker 1>you hate about typescript? And if so, what is that?

760
00:45:10.199 --> 00:45:14.559
<v Speaker 2>Yeah, so there are lots of things I don't like

761
00:45:14.599 --> 00:45:17.159
<v Speaker 2>about typescript. Definitely lots of things. I think they could

762
00:45:17.199 --> 00:45:20.719
<v Speaker 2>improve features I wish they would add. I think we've

763
00:45:20.800 --> 00:45:23.119
<v Speaker 2>got we've got the love. The thing I love is

764
00:45:23.119 --> 00:45:26.079
<v Speaker 2>that it makes my ide ten times more powerful, It

765
00:45:26.199 --> 00:45:29.159
<v Speaker 2>makes developing stuff easier, makes me feel more secure. So

766
00:45:29.360 --> 00:45:33.679
<v Speaker 2>let's go on to the fun stuff. The stuff I hate. Flow,

767
00:45:34.719 --> 00:45:38.519
<v Speaker 2>which is Meta's sort of version of typescripts. It's a

768
00:45:38.639 --> 00:45:43.039
<v Speaker 2>version of strongly type JavaScript. It has something called exact

769
00:45:43.199 --> 00:45:46.800
<v Speaker 2>object types. What that means is that if you create

770
00:45:46.840 --> 00:45:49.880
<v Speaker 2>an object in flow and you say, okay, this is

771
00:45:50.480 --> 00:45:53.920
<v Speaker 2>this is an object of this type, then you basically

772
00:45:53.920 --> 00:45:56.719
<v Speaker 2>can't add any extra properties to it. So if you

773
00:45:56.800 --> 00:46:00.239
<v Speaker 2>have an object with ABC, then you can never in

774
00:46:00.280 --> 00:46:03.440
<v Speaker 2>any situation in flow add a d property to it.

775
00:46:04.039 --> 00:46:07.719
<v Speaker 2>But in Typescript, in various situations you can do that.

776
00:46:08.400 --> 00:46:11.679
<v Speaker 2>So touch script has open objects, objects that are open

777
00:46:11.719 --> 00:46:14.800
<v Speaker 2>to extension, and that means that in various places you

778
00:46:14.840 --> 00:46:18.199
<v Speaker 2>can actually get into situations where you have these random

779
00:46:18.239 --> 00:46:21.320
<v Speaker 2>sort of properties kind of floating about. And if we

780
00:46:21.519 --> 00:46:23.199
<v Speaker 2>if we were doing code, I could show you. But

781
00:46:24.199 --> 00:46:27.360
<v Speaker 2>you can read my chapter of my book on exact

782
00:46:27.360 --> 00:46:30.320
<v Speaker 2>object times, which is free by the way is you know,

783
00:46:30.440 --> 00:46:31.159
<v Speaker 2>just google.

784
00:46:30.880 --> 00:46:36.079
<v Speaker 1>It and what that means. Book. By the way, it's a.

785
00:46:36.039 --> 00:46:38.159
<v Speaker 2>Total type Script Essentials, So if you go to total

786
00:46:38.159 --> 00:46:40.400
<v Speaker 2>touch gript dot com clickbook, you'll you'll.

787
00:46:40.199 --> 00:46:42.840
<v Speaker 1>Find it and recommended.

788
00:46:43.440 --> 00:46:48.719
<v Speaker 2>Oh, thank you very much. This means that various things

789
00:46:48.760 --> 00:46:50.960
<v Speaker 2>in touch script are not as good as they could be.

790
00:46:51.480 --> 00:46:54.119
<v Speaker 2>So object dot keys, for instance, when you're iterating over

791
00:46:54.159 --> 00:46:57.400
<v Speaker 2>an object's keys, when you iterate over a B and C,

792
00:46:57.639 --> 00:46:59.639
<v Speaker 2>you would expect the type of that to be a

793
00:46:59.800 --> 00:47:02.159
<v Speaker 2>B or C as aws a B or C, but

794
00:47:02.280 --> 00:47:05.440
<v Speaker 2>in fact it's just a string, so it's extra wide.

795
00:47:05.559 --> 00:47:08.679
<v Speaker 2>So it's wide because it's sort of it knows time

796
00:47:08.719 --> 00:47:11.760
<v Speaker 2>script knows are well it could contain D and I

797
00:47:11.800 --> 00:47:14.719
<v Speaker 2>don't actually know about that. And that means that that

798
00:47:14.880 --> 00:47:18.000
<v Speaker 2>extra wide type sort of gets a bit frustrating to use,

799
00:47:18.039 --> 00:47:20.440
<v Speaker 2>because when you go to index back into that object,

800
00:47:20.519 --> 00:47:23.079
<v Speaker 2>it's horrible. So I wish, I wish, I wish, I

801
00:47:23.119 --> 00:47:25.079
<v Speaker 2>wish timescript had exact object keys.

802
00:47:25.320 --> 00:47:28.599
<v Speaker 1>I think it's something you can configure somehow with tears configure.

803
00:47:29.280 --> 00:47:33.480
<v Speaker 2>It's just so baked into the way that typescript works

804
00:47:33.840 --> 00:47:36.039
<v Speaker 2>that it's impossible to go back. It's a feature I

805
00:47:36.039 --> 00:47:39.760
<v Speaker 2>wish they could add, but I I would be shocked if.

806
00:47:39.599 --> 00:47:43.360
<v Speaker 1>They managed to do it, honestly, So you're saying it's

807
00:47:43.400 --> 00:47:47.199
<v Speaker 1>such an integral or core aspect of the way in

808
00:47:47.239 --> 00:47:52.599
<v Speaker 1>which they structured types of the language that backtracking on

809
00:47:52.639 --> 00:47:55.519
<v Speaker 1>that on this now would be extremely hard, like adding

810
00:47:55.559 --> 00:47:59.239
<v Speaker 1>a brilliant flag in the configure. Theoretically be possible, but

811
00:47:59.400 --> 00:48:01.760
<v Speaker 1>practically it would be very.

812
00:48:01.639 --> 00:48:05.719
<v Speaker 2>Challenging, very very tough. And I suppose they could add

813
00:48:05.719 --> 00:48:08.599
<v Speaker 2>some sort of keyword, you know, like the exact keywords

814
00:48:08.599 --> 00:48:11.880
<v Speaker 2>to make make it work, because Flow has exact objects

815
00:48:11.880 --> 00:48:15.079
<v Speaker 2>by defaults, but you can make them like typeescript if

816
00:48:15.119 --> 00:48:18.280
<v Speaker 2>you want to opt in. But yeah, I just don't

817
00:48:18.320 --> 00:48:22.440
<v Speaker 2>think they they do it, because it does have benefits too.

818
00:48:22.679 --> 00:48:26.119
<v Speaker 2>It's it means that you can pass wider objects to

819
00:48:26.559 --> 00:48:28.559
<v Speaker 2>smaller ones, which is useful when you're doing things with

820
00:48:28.599 --> 00:48:32.760
<v Speaker 2>classes and stuff. But I don't think they're gonna they're

821
00:48:32.800 --> 00:48:34.239
<v Speaker 2>going to get around to it, which is a shame.

822
00:48:34.880 --> 00:48:39.159
<v Speaker 1>M anything else, then you would wish.

823
00:48:38.480 --> 00:48:40.280
<v Speaker 2>There's a lot of there's some more complex stuff, like

824
00:48:41.880 --> 00:48:45.360
<v Speaker 2>the way that typescript works with generic functions. If you

825
00:48:45.400 --> 00:48:49.880
<v Speaker 2>can actually pass types to certain functions. But then if

826
00:48:49.880 --> 00:48:52.760
<v Speaker 2>you pass one type, then any other types that you

827
00:48:52.800 --> 00:48:56.119
<v Speaker 2>don't pass don't get automatically inferred. So this is called

828
00:48:56.119 --> 00:48:59.599
<v Speaker 2>the partial inference problem. I wish they would bloody fix that.

829
00:49:00.440 --> 00:49:02.440
<v Speaker 2>I was talking to Tannel Linsley about this, I think

830
00:49:02.480 --> 00:49:04.400
<v Speaker 2>three years ago, and he was saying, Oh, they might

831
00:49:04.440 --> 00:49:07.079
<v Speaker 2>fix it, and they've been shaping up to maybe fix it.

832
00:49:07.119 --> 00:49:12.519
<v Speaker 2>But it just makes certain APIs impossible basically you, and

833
00:49:12.559 --> 00:49:14.119
<v Speaker 2>it makes things a little bit harder.

834
00:49:14.199 --> 00:49:16.280
<v Speaker 1>So I would love to fix that too, you know what.

835
00:49:16.519 --> 00:49:19.079
<v Speaker 1>I was saving this question for later, But since you

836
00:49:19.159 --> 00:49:22.320
<v Speaker 1>brought up type inference, maybe you can explain briefly what

837
00:49:22.360 --> 00:49:27.199
<v Speaker 1>type inference means, and then you might say what is

838
00:49:27.239 --> 00:49:30.920
<v Speaker 1>your attitude towards type inference, Like if there is a

839
00:49:31.000 --> 00:49:34.760
<v Speaker 1>place where type can be inferred, should it always be

840
00:49:34.800 --> 00:49:39.280
<v Speaker 1>inferred or do you prefer to be explicit sometimes or always?

841
00:49:39.639 --> 00:49:42.480
<v Speaker 1>So let's start with what is type inference and go

842
00:49:42.559 --> 00:49:43.000
<v Speaker 1>from there.

843
00:49:43.800 --> 00:49:47.079
<v Speaker 2>Yeah, so let's imagine you have a function and that

844
00:49:47.119 --> 00:49:50.280
<v Speaker 2>function can either take in a string or a number.

845
00:49:51.320 --> 00:49:54.280
<v Speaker 2>Then there are some things that Tychkriit can't infer. Like

846
00:49:54.360 --> 00:49:57.480
<v Speaker 2>let's say you're creating a function. Whenever you create that

847
00:49:57.519 --> 00:49:59.920
<v Speaker 2>function in strict mode, you have to annotate the parameter.

848
00:50:00.360 --> 00:50:03.079
<v Speaker 2>That's usually where most people are writing their types. Actually,

849
00:50:03.280 --> 00:50:05.599
<v Speaker 2>So imagine this function takes an input of string or number.

850
00:50:06.159 --> 00:50:08.400
<v Speaker 2>Then we do like an if statement and we check

851
00:50:08.599 --> 00:50:11.239
<v Speaker 2>if the input is a string. If we do, then

852
00:50:11.280 --> 00:50:14.559
<v Speaker 2>we call like input dot two upper case or something.

853
00:50:15.000 --> 00:50:17.599
<v Speaker 2>Otherwise we do something else. So if you imagine, there

854
00:50:17.599 --> 00:50:20.239
<v Speaker 2>are kind of three blocks there. There's the function, there's

855
00:50:20.280 --> 00:50:22.079
<v Speaker 2>the first if statement where we were checking if it's

856
00:50:22.079 --> 00:50:23.840
<v Speaker 2>a string, and the second if statement if we'd check

857
00:50:23.840 --> 00:50:27.199
<v Speaker 2>in if it's a number. Now, without this magical thing

858
00:50:27.199 --> 00:50:29.400
<v Speaker 2>called inference, we would have to add types in all

859
00:50:29.400 --> 00:50:31.840
<v Speaker 2>those places. Right, we have to say, Okay, it's a

860
00:50:31.840 --> 00:50:34.719
<v Speaker 2>string or number up here, it's a string here, and

861
00:50:34.760 --> 00:50:39.039
<v Speaker 2>it's a number here. But Typescript can actually infer that

862
00:50:39.360 --> 00:50:42.400
<v Speaker 2>based on the behavior of our code, based on the

863
00:50:43.039 --> 00:50:44.760
<v Speaker 2>It just looks at the code. It says, oh, yeah,

864
00:50:44.800 --> 00:50:47.440
<v Speaker 2>it's an if statement that's checking this thing. It must

865
00:50:47.480 --> 00:50:49.519
<v Speaker 2>only be a string in this particular closure.

866
00:50:50.039 --> 00:50:53.280
<v Speaker 1>By the way, just to interrupt you briefly, that was

867
00:50:53.360 --> 00:50:57.039
<v Speaker 1>one of the magical aspects for me of Typescript that

868
00:50:57.159 --> 00:51:01.840
<v Speaker 1>initially didn't get because again I came into, as I

869
00:51:01.880 --> 00:51:06.480
<v Speaker 1>said before, my background was from language statically type languages

870
00:51:06.800 --> 00:51:11.280
<v Speaker 1>which usually don't need these types of shenanigans because something

871
00:51:11.639 --> 00:51:15.639
<v Speaker 1>is a strict type, you don't have to infer that, hey,

872
00:51:15.639 --> 00:51:17.880
<v Speaker 1>it's this type in this context and that type in

873
00:51:17.920 --> 00:51:21.639
<v Speaker 1>that context. You might do some crazy stuff around templates

874
00:51:22.480 --> 00:51:26.880
<v Speaker 1>to narrow to narrow the passing types, but within the

875
00:51:26.920 --> 00:51:30.960
<v Speaker 1>code itself, you don't. And it took in the realization

876
00:51:31.840 --> 00:51:36.119
<v Speaker 1>that you that typescript does static analysis of your code

877
00:51:36.159 --> 00:51:39.679
<v Speaker 1>and narrows the types based on what it reads in

878
00:51:39.719 --> 00:51:42.880
<v Speaker 1>your actual code, like ifs and stuff like that, and

879
00:51:42.920 --> 00:51:46.360
<v Speaker 1>now you also have type guards and stuff like that.

880
00:51:46.360 --> 00:51:49.960
<v Speaker 1>That was pretty amazing to me. And once I realized

881
00:51:50.000 --> 00:51:52.559
<v Speaker 1>that that was one of the things that really like

882
00:51:52.679 --> 00:51:56.119
<v Speaker 1>got me to to really appreciate typescript one.

883
00:51:56.079 --> 00:51:58.880
<v Speaker 2>Hund And it's such a hard problem as well. I

884
00:51:58.880 --> 00:52:01.840
<v Speaker 2>imagine building that from scratch, you know, something that looks

885
00:52:01.840 --> 00:52:04.480
<v Speaker 2>at your code and understands, okay, in all of these places,

886
00:52:04.519 --> 00:52:07.760
<v Speaker 2>this is what type these values are. It's crazy. They

887
00:52:07.760 --> 00:52:10.159
<v Speaker 2>pulled it off. So it works. This is what's called

888
00:52:10.239 --> 00:52:13.559
<v Speaker 2>narrowing in typescripts. You know, it works with switch statements,

889
00:52:13.960 --> 00:52:16.880
<v Speaker 2>works with objects, works with now it actually works with

890
00:52:16.920 --> 00:52:19.719
<v Speaker 2>functions too, So you can create a function that checks

891
00:52:19.719 --> 00:52:22.119
<v Speaker 2>if something is a string and it will automatically. You

892
00:52:22.119 --> 00:52:24.480
<v Speaker 2>don't need to add any type annotations apart from just

893
00:52:24.519 --> 00:52:28.079
<v Speaker 2>the input. It's amazing the way it works. So that's

894
00:52:28.079 --> 00:52:31.320
<v Speaker 2>what type inference is. It's typeescript looking at your runtime

895
00:52:31.400 --> 00:52:34.719
<v Speaker 2>code and inferring the types from it. And I have

896
00:52:34.760 --> 00:52:37.119
<v Speaker 2>an exercise in my course where I basically say, okay,

897
00:52:37.440 --> 00:52:39.599
<v Speaker 2>we do all of this code, and I basically annotate

898
00:52:39.800 --> 00:52:42.800
<v Speaker 2>every single place that you could possibly annotate, you know,

899
00:52:44.039 --> 00:52:47.800
<v Speaker 2>like on variables, on function parameters, on function return types

900
00:52:47.840 --> 00:52:48.280
<v Speaker 2>as well.

901
00:52:48.800 --> 00:52:51.199
<v Speaker 1>And I just saw return types, by the ways, where

902
00:52:51.239 --> 00:52:55.440
<v Speaker 1>I usually think about inference, Like you said, parameters usually

903
00:52:55.480 --> 00:52:58.039
<v Speaker 1>need to be typed, I mean, because you really can't

904
00:52:58.039 --> 00:53:02.800
<v Speaker 1>infer the parameters. That's the entry point. But the exit

905
00:53:02.840 --> 00:53:05.719
<v Speaker 1>point is certainly the place there's something that you can

906
00:53:05.800 --> 00:53:09.480
<v Speaker 1>often infer, Like you know, if it's an AD function

907
00:53:09.599 --> 00:53:11.760
<v Speaker 1>that takes A and b in returns A plus b.

908
00:53:11.880 --> 00:53:14.440
<v Speaker 1>If both A and b are numbers, then obviously A

909
00:53:14.480 --> 00:53:19.199
<v Speaker 1>plus b is a number. So yeah, So the question

910
00:53:19.320 --> 00:53:24.840
<v Speaker 1>then really becomes if the function return type can be inferred,

911
00:53:25.719 --> 00:53:28.360
<v Speaker 1>should I be explicit about it or should I just

912
00:53:28.559 --> 00:53:30.360
<v Speaker 1>let typescript inferred.

913
00:53:31.000 --> 00:53:34.159
<v Speaker 2>Yeah, so this I go back and forth on this.

914
00:53:34.159 --> 00:53:38.599
<v Speaker 2>This is a tricky question, and there are various cases

915
00:53:38.599 --> 00:53:41.519
<v Speaker 2>where it's obvious that you should type the return time

916
00:53:41.639 --> 00:53:45.360
<v Speaker 2>because what you're saying is when you create your function definition, basically,

917
00:53:45.400 --> 00:53:48.119
<v Speaker 2>the types at the top are your description of how

918
00:53:48.119 --> 00:53:52.039
<v Speaker 2>the function should work, and when you're in let's say

919
00:53:52.039 --> 00:53:55.000
<v Speaker 2>a library setting or a utils folder setting, you probably

920
00:53:55.079 --> 00:53:58.639
<v Speaker 2>always want to create those types actually, because it's a

921
00:53:58.679 --> 00:54:00.760
<v Speaker 2>way for someone who doesn't want to read the body

922
00:54:00.800 --> 00:54:02.440
<v Speaker 2>of the function to just go, oh, I see what

923
00:54:02.480 --> 00:54:04.880
<v Speaker 2>this is doing, right, I understand. Okay, it's a function

924
00:54:04.960 --> 00:54:07.199
<v Speaker 2>that takes in a string and returns an object with

925
00:54:07.239 --> 00:54:11.639
<v Speaker 2>a value in our something. So what it means then

926
00:54:11.719 --> 00:54:14.679
<v Speaker 2>to type those is that it gives you a contract

927
00:54:14.760 --> 00:54:17.039
<v Speaker 2>that you have to be able to meet. And so

928
00:54:17.079 --> 00:54:19.800
<v Speaker 2>it means that this is type driven developments. You're taking

929
00:54:20.000 --> 00:54:21.960
<v Speaker 2>the types and saying this is what I want to create,

930
00:54:22.039 --> 00:54:24.719
<v Speaker 2>and then you're creating it. If you don't do that,

931
00:54:25.519 --> 00:54:27.480
<v Speaker 2>then it does give you a bit more flexibility. It

932
00:54:27.559 --> 00:54:30.360
<v Speaker 2>means that the things that you're returning, for instance, from

933
00:54:30.360 --> 00:54:34.320
<v Speaker 2>your function are just like automatically inferred. This is a

934
00:54:34.360 --> 00:54:38.599
<v Speaker 2>really good, a really good example is React components. For instance,

935
00:54:38.920 --> 00:54:42.000
<v Speaker 2>they are always every single React component is always going

936
00:54:42.039 --> 00:54:44.239
<v Speaker 2>to return the same type, always going to return a

937
00:54:44.280 --> 00:54:47.039
<v Speaker 2>type of React dot React node because you're just returning

938
00:54:47.079 --> 00:54:50.360
<v Speaker 2>gsx so in every single React component, so you're going

939
00:54:50.360 --> 00:54:54.000
<v Speaker 2>to be returning the same thing, And to annotate React

940
00:54:54.039 --> 00:54:56.639
<v Speaker 2>components return type just seems a bit weird to me.

941
00:54:58.960 --> 00:55:02.920
<v Speaker 2>There are link rules that force you to add a

942
00:55:05.480 --> 00:55:08.480
<v Speaker 2>type to every single function return, and I find those

943
00:55:08.599 --> 00:55:12.000
<v Speaker 2>extremely annoying because there are tons of use cases and

944
00:55:12.079 --> 00:55:13.800
<v Speaker 2>tons of cases where I don't want to add the

945
00:55:13.800 --> 00:55:17.519
<v Speaker 2>return type at all. But it is sometimes beneficial to

946
00:55:17.559 --> 00:55:19.920
<v Speaker 2>just give yourself a guardrail, give yourself a contract that

947
00:55:19.960 --> 00:55:22.199
<v Speaker 2>you need to meet, And honestly, I find myself doing

948
00:55:22.199 --> 00:55:24.079
<v Speaker 2>it more and more and more because it just feels

949
00:55:24.119 --> 00:55:26.119
<v Speaker 2>good to be able to say this function does this

950
00:55:26.199 --> 00:55:27.679
<v Speaker 2>thing and then implement it.

951
00:55:28.320 --> 00:55:32.000
<v Speaker 1>So basically you're saying is if I'm I'm doing the

952
00:55:32.039 --> 00:55:37.199
<v Speaker 1>function outside in I'm actually specifying the function parameters and

953
00:55:37.280 --> 00:55:40.960
<v Speaker 1>return types before I write the function body, then I've

954
00:55:41.000 --> 00:55:44.079
<v Speaker 1>got the return type as a validation that what I'm

955
00:55:44.119 --> 00:55:49.159
<v Speaker 1>returning actually matches that type. So I get two benefits.

956
00:55:49.360 --> 00:55:52.719
<v Speaker 1>I get, You know, anybody looking at the function declaration,

957
00:55:52.920 --> 00:55:56.440
<v Speaker 1>knows what the function will be returning without having to

958
00:55:57.199 --> 00:55:59.920
<v Speaker 1>read the code. Although you know, there's an interesting point

959
00:56:00.000 --> 00:56:02.679
<v Speaker 1>about that. I'll get to that in a second. And

960
00:56:02.679 --> 00:56:07.039
<v Speaker 1>the other aspect is that the fact that you're providing

961
00:56:07.079 --> 00:56:10.000
<v Speaker 1>a guardrail for yourself making sure that you are in

962
00:56:10.039 --> 00:56:13.039
<v Speaker 1>fact returning the correct type. Yep.

963
00:56:13.599 --> 00:56:14.239
<v Speaker 2>Absolutely.

964
00:56:15.199 --> 00:56:18.440
<v Speaker 1>The interesting thing is, again looking at my experience with

965
00:56:18.559 --> 00:56:22.400
<v Speaker 1>other statically type programming languages, there are programming languages that

966
00:56:22.880 --> 00:56:29.159
<v Speaker 1>actively advocate the type inference approach, where ideally you even

967
00:56:29.199 --> 00:56:32.639
<v Speaker 1>though they're statically typed, their inference is so good that

968
00:56:32.760 --> 00:56:37.639
<v Speaker 1>you're expected to hardly ever write any types because it's

969
00:56:37.760 --> 00:56:40.639
<v Speaker 1>it's basically you don't need to think what the type,

970
00:56:40.920 --> 00:56:43.880
<v Speaker 1>what the types are, which again, which again takes me

971
00:56:43.960 --> 00:56:47.480
<v Speaker 1>back to this aspect, because in a sense, if I

972
00:56:47.800 --> 00:56:52.840
<v Speaker 1>don't really if if if my all my assignments are initializations,

973
00:56:53.639 --> 00:56:57.519
<v Speaker 1>m so all my variables are calls like not variables,

974
00:56:57.559 --> 00:57:02.760
<v Speaker 1>they're they're mutable to an extent, I don't need to

975
00:57:02.800 --> 00:57:05.199
<v Speaker 1>think about I almost don't need to think about the type.

976
00:57:05.880 --> 00:57:09.599
<v Speaker 1>So I'm assigning the return value of a function into

977
00:57:09.599 --> 00:57:13.639
<v Speaker 1>a variable. It is what it is. I know that

978
00:57:13.960 --> 00:57:17.079
<v Speaker 1>whichever way I use it is correct. I can only

979
00:57:17.159 --> 00:57:19.400
<v Speaker 1>pass it into the appropriate functions, or if I do

980
00:57:19.480 --> 00:57:22.599
<v Speaker 1>the dot, I'll get the correct completion. I don't need

981
00:57:22.639 --> 00:57:24.159
<v Speaker 1>to be explicit about the type.

982
00:57:25.920 --> 00:57:28.320
<v Speaker 2>There are situations where, of course, you do want to

983
00:57:28.360 --> 00:57:31.519
<v Speaker 2>be explicit about the type, where you know, you know

984
00:57:31.719 --> 00:57:34.960
<v Speaker 2>more about the type that something should be than typescript

985
00:57:35.000 --> 00:57:37.800
<v Speaker 2>can infer from the run time. A really good example

986
00:57:37.840 --> 00:57:40.280
<v Speaker 2>of this is like index signatures. So, for instance, if

987
00:57:40.320 --> 00:57:43.320
<v Speaker 2>you have an object that you know, okay, I'm going

988
00:57:43.360 --> 00:57:47.880
<v Speaker 2>to be adding keys to this dynamically like IDs for instance,

989
00:57:48.360 --> 00:57:52.199
<v Speaker 2>and they're going to have this value of property on them,

990
00:57:52.559 --> 00:57:54.880
<v Speaker 2>then you need to tell touch script that upfront, because

991
00:57:54.880 --> 00:57:57.920
<v Speaker 2>if you just initialize like an empty object, then touch

992
00:57:58.239 --> 00:58:00.679
<v Speaker 2>is just going to infer it as an empty object basically.

993
00:58:01.119 --> 00:58:08.079
<v Speaker 2>And so I'm adding that level of you making a map.

994
00:58:08.320 --> 00:58:10.119
<v Speaker 2>But even with a map, you need to you know.

995
00:58:10.440 --> 00:58:14.960
<v Speaker 1>Yeah, maplicit. Yeah, you're obviously exhisit about the time. By

996
00:58:14.960 --> 00:58:16.920
<v Speaker 1>the way, one of the things that kind of also

997
00:58:16.960 --> 00:58:20.239
<v Speaker 1>blew my mind about modern typescript is how you can

998
00:58:20.400 --> 00:58:26.880
<v Speaker 1>create types with string expressions that you can actually structure.

999
00:58:26.960 --> 00:58:30.599
<v Speaker 1>Is say, not we give example before about keys that

1000
00:58:30.760 --> 00:58:33.239
<v Speaker 1>it's not just any string. It's it's the keys of

1001
00:58:33.239 --> 00:58:36.400
<v Speaker 1>an object. But it also can be a particular structure

1002
00:58:36.440 --> 00:58:40.159
<v Speaker 1>of a string, so a string that has like hello

1003
00:58:40.280 --> 00:58:42.559
<v Speaker 1>at the beginning or something like that, which is pretty

1004
00:58:42.559 --> 00:58:43.239
<v Speaker 1>insane to me.

1005
00:58:44.000 --> 00:58:46.599
<v Speaker 2>Yeah, if you, if you're following on at home, if

1006
00:58:46.599 --> 00:58:48.519
<v Speaker 2>you've got us in your ear and you're at your laptop,

1007
00:58:49.199 --> 00:58:52.480
<v Speaker 2>try just typing crypto dot random you U, I, D

1008
00:58:52.880 --> 00:58:55.280
<v Speaker 2>and call the function and see what if you just

1009
00:58:55.320 --> 00:58:57.639
<v Speaker 2>hover over the thing that it returns, you'll see that

1010
00:58:57.679 --> 00:59:01.280
<v Speaker 2>it returns basically it what it returns in real life

1011
00:59:01.320 --> 00:59:04.159
<v Speaker 2>is like a UID, so it's like five parts of

1012
00:59:04.159 --> 00:59:07.960
<v Speaker 2>a string separated by dashes, and you'll see in the

1013
00:59:07.960 --> 00:59:10.119
<v Speaker 2>return time that it actually does the same thing on

1014
00:59:10.159 --> 00:59:12.920
<v Speaker 2>the type level. It's crazy. It's crazy that you can

1015
00:59:12.960 --> 00:59:16.199
<v Speaker 2>basically represent these strings in a type safe way. It's

1016
00:59:16.199 --> 00:59:17.000
<v Speaker 2>absolutely wonkers.

1017
00:59:17.360 --> 00:59:20.800
<v Speaker 1>Another thing that really confused me initially when I got

1018
00:59:20.840 --> 00:59:24.639
<v Speaker 1>into typescript, because again of my actually my background with

1019
00:59:24.800 --> 00:59:28.519
<v Speaker 1>type languages working against me, with statically type languages working

1020
00:59:28.559 --> 00:59:34.199
<v Speaker 1>against me, was the document dot create element. The fact

1021
00:59:34.559 --> 00:59:39.000
<v Speaker 1>that the type returned was based on the string parameter

1022
00:59:39.320 --> 00:59:43.199
<v Speaker 1>passed into that function kind of blew my mind. This

1023
00:59:44.519 --> 00:59:46.840
<v Speaker 1>was not C plus plus. They're like, you know this,

1024
00:59:48.199 --> 00:59:50.880
<v Speaker 1>it's the fact that you know they had to do

1025
00:59:50.920 --> 00:59:53.320
<v Speaker 1>it from the get go because otherwise create element would

1026
00:59:53.360 --> 00:59:55.480
<v Speaker 1>have been pretty useless. And it's part of the dome.

1027
00:59:56.119 --> 00:59:59.440
<v Speaker 1>But the fact that if you pass in the string

1028
00:59:59.559 --> 01:00:04.679
<v Speaker 1>div the time, the return type is is HTML div,

1029
01:00:04.800 --> 01:00:07.360
<v Speaker 1>but if you pass in span, it's HGML span. If

1030
01:00:07.360 --> 01:00:10.199
<v Speaker 1>it's a button, then it's HML button. It's pretty insane

1031
01:00:10.239 --> 01:00:13.599
<v Speaker 1>to me. Yeah, and I think that was from day one.

1032
01:00:14.840 --> 01:00:17.599
<v Speaker 2>Yeah, I think because that's that's another thing that tapskib

1033
01:00:17.639 --> 01:00:19.639
<v Speaker 2>does too. Is it just it gives you a lot

1034
01:00:19.639 --> 01:00:22.519
<v Speaker 2>of confidence in these dom APIs, and some of the

1035
01:00:22.559 --> 01:00:24.800
<v Speaker 2>domapis are pretty funky, you know, in terms of what

1036
01:00:24.840 --> 01:00:25.320
<v Speaker 2>they do.

1037
01:00:25.480 --> 01:00:30.599
<v Speaker 1>And you talked about Jquerry. The dollar function in Jquerry

1038
01:00:30.840 --> 01:00:34.840
<v Speaker 1>literally could accept anything in what you passed in really

1039
01:00:34.880 --> 01:00:38.000
<v Speaker 1>determine what you got out. So the fact that it

1040
01:00:38.079 --> 01:00:41.159
<v Speaker 1>could infer what you got out based on on on

1041
01:00:41.320 --> 01:00:45.039
<v Speaker 1>the value of what you passed in was again pretty insane.

1042
01:00:46.039 --> 01:00:47.920
<v Speaker 2>I can't believe they pulled it off, to be honest,

1043
01:00:48.000 --> 01:00:49.960
<v Speaker 2>like it is. I mean that you've you've got an

1044
01:00:49.960 --> 01:00:52.519
<v Speaker 2>incredible team there, You've got Steve Luca, You've got Andres

1045
01:00:52.519 --> 01:00:53.639
<v Speaker 2>Hausbergs that are working on.

1046
01:00:53.599 --> 01:00:55.280
<v Speaker 1>This thing, and this is my god.

1047
01:00:55.400 --> 01:00:58.559
<v Speaker 2>You know, yeah, everyone's good. It seems like such a

1048
01:00:58.679 --> 01:01:00.800
<v Speaker 2>nice guy as well. And I'm never met him in person,

1049
01:01:00.840 --> 01:01:01.519
<v Speaker 2>but I would love to.

1050
01:01:02.239 --> 01:01:05.800
<v Speaker 1>I'll do a quick aside. You know that. You know,

1051
01:01:05.880 --> 01:01:10.519
<v Speaker 1>people know him from typescript and from C sharp, but

1052
01:01:10.679 --> 01:01:14.199
<v Speaker 1>for me, he'll be forever the person associated with Tubo Pascal.

1053
01:01:15.119 --> 01:01:18.039
<v Speaker 1>I really, you know, you know what Tubo Pascal was

1054
01:01:18.159 --> 01:01:18.480
<v Speaker 1>or is.

1055
01:01:18.679 --> 01:01:21.079
<v Speaker 2>I don't think I do. I mean, I know the words,

1056
01:01:21.079 --> 01:01:21.840
<v Speaker 2>but I don't know the.

1057
01:01:22.360 --> 01:01:26.360
<v Speaker 1>So so so. Pascal is a programming language that originated

1058
01:01:26.440 --> 01:01:28.639
<v Speaker 1>back in the I don't remember if it's the seventies

1059
01:01:28.719 --> 01:01:34.679
<v Speaker 1>or the eighties, created as a strongly typed language intended

1060
01:01:34.719 --> 01:01:39.199
<v Speaker 1>for teaching computer science in the universities, quickly open sourced,

1061
01:01:39.239 --> 01:01:43.320
<v Speaker 1>which made it fairly popular. And what happened, so we

1062
01:01:42.920 --> 01:01:47.320
<v Speaker 1>are everybody working on on PCs back in the in

1063
01:01:47.360 --> 01:01:49.960
<v Speaker 1>the day and back in the eighties or early nineties

1064
01:01:50.440 --> 01:01:53.800
<v Speaker 1>was basically working in Basic, which was a terrible programming

1065
01:01:53.840 --> 01:01:58.239
<v Speaker 1>language in a lot of ways. And then Anders as

1066
01:01:58.280 --> 01:02:02.760
<v Speaker 1>this young man, released Tubo Pascal, which basically was an

1067
01:02:02.800 --> 01:02:07.760
<v Speaker 1>implementation of Pascal and an ID, so it was both

1068
01:02:07.840 --> 01:02:12.800
<v Speaker 1>the programming language, the compiler, and an integrated ID, which

1069
01:02:12.880 --> 01:02:16.000
<v Speaker 1>was miles ahead of anything else available at the time,

1070
01:02:17.119 --> 01:02:23.280
<v Speaker 1>ran on really low endpcs with blazingly fast compilation. So

1071
01:02:23.639 --> 01:02:27.119
<v Speaker 1>all of a sudden we went. I went from writing

1072
01:02:27.719 --> 01:02:33.119
<v Speaker 1>slow code in Basic to writing super fast code in

1073
01:02:33.159 --> 01:02:39.000
<v Speaker 1>Tubo Pascal in Pascal, and it literally blew my mind,

1074
01:02:39.159 --> 01:02:42.000
<v Speaker 1>rocked my world, and made me into the developer that

1075
01:02:42.079 --> 01:02:45.440
<v Speaker 1>I am today in a lot of ways. So if

1076
01:02:45.480 --> 01:02:47.840
<v Speaker 1>I'm thinking about people that I owe my career to,

1077
01:02:48.440 --> 01:02:50.039
<v Speaker 1>Andrews is high on that list.

1078
01:02:51.000 --> 01:02:54.119
<v Speaker 2>Wow, I guess me too, man, I'm me too. I

1079
01:02:54.119 --> 01:02:57.760
<v Speaker 2>mean he didn't invent Touchkik like a lot of people think,

1080
01:02:57.800 --> 01:03:00.719
<v Speaker 2>but his influence and his guy didn't say very I

1081
01:03:00.719 --> 01:03:02.800
<v Speaker 2>mean he's still involved today, is still making pians today.

1082
01:03:03.280 --> 01:03:07.519
<v Speaker 1>He's an incredible guy anyway, So I have a few

1083
01:03:07.519 --> 01:03:10.000
<v Speaker 1>more questions. So we talked about the things that we

1084
01:03:10.199 --> 01:03:12.239
<v Speaker 1>like or did like, or you like or don't like

1085
01:03:12.320 --> 01:03:16.760
<v Speaker 1>about typescript. By the way, we are starting to run

1086
01:03:16.800 --> 01:03:19.079
<v Speaker 1>a long I don't know how much time you have.

1087
01:03:19.199 --> 01:03:20.960
<v Speaker 1>I would love to have as much time with you

1088
01:03:20.960 --> 01:03:24.480
<v Speaker 1>as I possibly can, but don't hesitate to let me

1089
01:03:24.599 --> 01:03:27.159
<v Speaker 1>know that you need to stop or whatever.

1090
01:03:27.280 --> 01:03:30.440
<v Speaker 2>I've probably got a hard stop at half past so

1091
01:03:30.599 --> 01:03:31.920
<v Speaker 2>in eighteen minutes, sadly.

1092
01:03:32.639 --> 01:03:35.679
<v Speaker 1>Okay, So maybe we'll you know, just need to schedule

1093
01:03:35.719 --> 01:03:39.119
<v Speaker 1>a follow on, so I'll try to get one or

1094
01:03:39.159 --> 01:03:43.960
<v Speaker 1>maybe two more questions into there. The next question that

1095
01:03:44.039 --> 01:03:48.360
<v Speaker 1>I have is, again, given the new versions of Typescript

1096
01:03:48.920 --> 01:03:54.519
<v Speaker 1>coming out, what recent or upcoming addition to Typescript has

1097
01:03:54.599 --> 01:03:55.599
<v Speaker 1>you the most excited.

1098
01:03:56.320 --> 01:04:00.280
<v Speaker 2>Yeah. So the thing that really got me excited was

1099
01:04:00.320 --> 01:04:02.960
<v Speaker 2>five point five, and I want to get this right.

1100
01:04:03.000 --> 01:04:09.360
<v Speaker 2>This was five point five Typescript which built or added

1101
01:04:09.360 --> 01:04:11.440
<v Speaker 2>something that I just did not think they'd ever add,

1102
01:04:11.679 --> 01:04:15.039
<v Speaker 2>which was inferred type predicates. This is something I sort

1103
01:04:15.039 --> 01:04:17.559
<v Speaker 2>of touched on earlier, which is when you have a

1104
01:04:18.440 --> 01:04:21.920
<v Speaker 2>function that you can check whether it's a string or

1105
01:04:21.960 --> 01:04:24.960
<v Speaker 2>not a thing that's passed in before. To get this

1106
01:04:24.960 --> 01:04:26.719
<v Speaker 2>to work in Typescript, you would need to add this

1107
01:04:26.800 --> 01:04:31.320
<v Speaker 2>kind of slightly janky looking input is string return type,

1108
01:04:31.360 --> 01:04:35.880
<v Speaker 2>which checked whether the basically sort of duplicated the runtime

1109
01:04:35.920 --> 01:04:40.599
<v Speaker 2>logic in the type level. And now you can just

1110
01:04:40.679 --> 01:04:44.840
<v Speaker 2>delete that and Typescript will infer it automatically. This makes

1111
01:04:45.199 --> 01:04:48.519
<v Speaker 2>many things a lot easier. For instance, if you need

1112
01:04:48.559 --> 01:04:51.159
<v Speaker 2>to filter, if you have an array of things that

1113
01:04:51.280 --> 01:04:54.320
<v Speaker 2>might be string or null, then you can actually filter

1114
01:04:54.440 --> 01:04:57.559
<v Speaker 2>those with array dot filter, and then you can write

1115
01:04:57.559 --> 01:05:02.159
<v Speaker 2>a little inside that. Top filter basically just says a

1116
01:05:02.199 --> 01:05:05.480
<v Speaker 2>type of string, a type of input equals string, and

1117
01:05:05.760 --> 01:05:08.039
<v Speaker 2>before again you need to do this junky little thing,

1118
01:05:08.239 --> 01:05:11.119
<v Speaker 2>but now you can just delete that and it infers

1119
01:05:11.159 --> 01:05:14.519
<v Speaker 2>it automatically. So it's just something that has a huge

1120
01:05:14.559 --> 01:05:15.440
<v Speaker 2>downstream effect.

1121
01:05:16.039 --> 01:05:21.880
<v Speaker 1>So basically all the arra utility functions or iteration utility

1122
01:05:21.920 --> 01:05:27.360
<v Speaker 1>functions now emit the proper type definition. I think I

1123
01:05:27.440 --> 01:05:29.320
<v Speaker 1>saw this as well, and it also kind of blew

1124
01:05:29.400 --> 01:05:33.800
<v Speaker 1>my mind. And it will be especially especially interesting to

1125
01:05:33.840 --> 01:05:37.559
<v Speaker 1>see if it is able to work with iterator helpers.

1126
01:05:38.199 --> 01:05:40.679
<v Speaker 1>If they get that to work, that will be like

1127
01:05:41.119 --> 01:05:42.039
<v Speaker 1>really insane.

1128
01:05:42.639 --> 01:05:43.639
<v Speaker 2>Yeah, that's very cool.

1129
01:05:43.719 --> 01:05:43.920
<v Speaker 1>Yeah.

1130
01:05:43.960 --> 01:05:47.559
<v Speaker 2>This was made by Dan Vanderkam, who's another timescript author.

1131
01:05:47.880 --> 01:05:50.320
<v Speaker 2>I think he went on like a coding retreats for

1132
01:05:50.360 --> 01:05:52.360
<v Speaker 2>a couple of weeks and just built a feature, his

1133
01:05:52.480 --> 01:05:55.880
<v Speaker 2>first ever PR timescript and they accepted it and it's

1134
01:05:55.920 --> 01:05:58.280
<v Speaker 2>now an incredible, incredible feature.

1135
01:05:58.280 --> 01:06:00.679
<v Speaker 1>Which again I don't I don't think will have enough

1136
01:06:00.719 --> 01:06:03.320
<v Speaker 1>time to talk about it. But again, one of the

1137
01:06:03.360 --> 01:06:08.920
<v Speaker 1>things that I especially learned to love about typescript is

1138
01:06:09.039 --> 01:06:13.920
<v Speaker 1>null safety. Yeah, people don't appreciate it that whether or

1139
01:06:14.039 --> 01:06:20.760
<v Speaker 1>not something is noullable is part of the type and

1140
01:06:21.039 --> 01:06:26.280
<v Speaker 1>if you pass a non noble argument in then you

1141
01:06:26.360 --> 01:06:31.199
<v Speaker 1>don't need to worry about it being null. So the

1142
01:06:32.119 --> 01:06:36.199
<v Speaker 1>if you're doing it correctly, all the null errors that

1143
01:06:36.440 --> 01:06:39.119
<v Speaker 1>what's known as that you know, that famous one billion

1144
01:06:39.159 --> 01:06:42.039
<v Speaker 1>dollar mistake, even though it's probably way more than one

1145
01:06:42.039 --> 01:06:45.840
<v Speaker 1>billion dollars by now, all those null references. If you

1146
01:06:45.960 --> 01:06:50.679
<v Speaker 1>do typescript correctly, it's it just solves that.

1147
01:06:51.320 --> 01:06:53.920
<v Speaker 2>And the fact that it discriminates between null and undefined

1148
01:06:54.000 --> 01:06:56.840
<v Speaker 2>as well, which is that that's like a strictness setting,

1149
01:06:56.840 --> 01:06:59.280
<v Speaker 2>So you can basically sort of turn that I always

1150
01:06:59.320 --> 01:07:01.639
<v Speaker 2>recommend you turn on. And that's part of strict true,

1151
01:07:02.400 --> 01:07:05.679
<v Speaker 2>which is timescript sort of basic strictness level. The fact

1152
01:07:05.719 --> 01:07:07.880
<v Speaker 2>that it discriminates between those two as well is just

1153
01:07:08.400 --> 01:07:10.800
<v Speaker 2>you can feel extra strict sometimes, but it just saves

1154
01:07:10.840 --> 01:07:12.039
<v Speaker 2>you an extra level of pain.

1155
01:07:12.440 --> 01:07:14.760
<v Speaker 1>Yeah, I do wish, you know, if I could have

1156
01:07:14.800 --> 01:07:18.840
<v Speaker 1>gone back in time to nineteen eighty five and whisper

1157
01:07:18.920 --> 01:07:22.800
<v Speaker 1>on Brendan Ike's ear I would have said, maybe not both,

1158
01:07:22.920 --> 01:07:24.320
<v Speaker 1>maybe just one or the other.

1159
01:07:25.000 --> 01:07:28.960
<v Speaker 2>I strongly agree, and maybe just fix the thing where

1160
01:07:29.000 --> 01:07:30.719
<v Speaker 2>type of nell is an object as well.

1161
01:07:30.760 --> 01:07:34.639
<v Speaker 1>That's blood. You know, that's a funny one that one

1162
01:07:34.679 --> 01:07:40.679
<v Speaker 1>actually slightly bothers me less interestingly enough. I get why

1163
01:07:40.719 --> 01:07:43.519
<v Speaker 1>that is. Let's put it this way. But again I think,

1164
01:07:43.599 --> 01:07:46.559
<v Speaker 1>you know, that's a different discussion. And there is one

1165
01:07:46.599 --> 01:07:49.239
<v Speaker 1>more thing that I would like to touch on before

1166
01:07:49.239 --> 01:07:51.880
<v Speaker 1>we finish, and it kind of goes to the fact that,

1167
01:07:52.000 --> 01:07:57.199
<v Speaker 1>as you mentioned, whenever converting a project, there's likely a

1168
01:07:57.320 --> 01:08:00.239
<v Speaker 1>UTILS folder, And on the one hand, you want to

1169
01:08:00.400 --> 01:08:03.960
<v Speaker 1>start there because probably everything is dependent on you tills,

1170
01:08:03.960 --> 01:08:06.880
<v Speaker 1>but utils is probably not dependent on anything, or at

1171
01:08:06.960 --> 01:08:15.280
<v Speaker 1>least or not on anything internal and the question. But

1172
01:08:15.400 --> 01:08:18.960
<v Speaker 1>on the other hand, it's the one that's most likely

1173
01:08:19.039 --> 01:08:23.600
<v Speaker 1>to need advanced Typescript features like generics and stuff like that,

1174
01:08:23.720 --> 01:08:28.960
<v Speaker 1>so you're probably also starting with the hardest part. And

1175
01:08:29.760 --> 01:08:35.439
<v Speaker 1>my question here is so generics, like, does every Typescript

1176
01:08:35.479 --> 01:08:40.279
<v Speaker 1>developer need to understand generics or is this something that

1177
01:08:40.359 --> 01:08:43.239
<v Speaker 1>we can be relegated to a few like quote unquote

1178
01:08:43.239 --> 01:08:46.960
<v Speaker 1>Typescript wizards. And in this context, I think it was

1179
01:08:47.079 --> 01:08:52.359
<v Speaker 1>THEO if I'm mistaken, then I apologized. Who once in

1180
01:08:52.399 --> 01:08:57.359
<v Speaker 1>a video kind of made a distinction between the typescript

1181
01:08:58.039 --> 01:09:02.439
<v Speaker 1>at the app level versus typescript at the library level

1182
01:09:03.039 --> 01:09:08.319
<v Speaker 1>that when you're working at like the userland slash application level,

1183
01:09:08.880 --> 01:09:13.840
<v Speaker 1>you can be you don't need all the fancy schmancy

1184
01:09:13.960 --> 01:09:19.640
<v Speaker 1>Java typeescript features. It's basically mostly simple or very explicit types.

1185
01:09:20.359 --> 01:09:23.680
<v Speaker 1>But when you work at the library level, then you

1186
01:09:23.840 --> 01:09:29.359
<v Speaker 1>probably need to get into various APIs and sorry, you

1187
01:09:29.439 --> 01:09:32.279
<v Speaker 1>need to deal with sophisticated APIs, and then you need

1188
01:09:32.279 --> 01:09:36.520
<v Speaker 1>stuff like generics, and we talked about covariant and contravariant

1189
01:09:36.560 --> 01:09:41.479
<v Speaker 1>and stuff like that. So do you agree with this distinction?

1190
01:09:41.680 --> 01:09:45.439
<v Speaker 1>Do you think it should exist or should Does every

1191
01:09:45.479 --> 01:09:49.119
<v Speaker 1>typescript developer need to know generics one? You know, sooner

1192
01:09:49.239 --> 01:09:49.640
<v Speaker 1>or later.

1193
01:09:51.720 --> 01:09:53.920
<v Speaker 2>Let me break this down in a couple of places.

1194
01:09:54.960 --> 01:09:58.159
<v Speaker 2>The first place I'll break it down is that generics

1195
01:09:58.319 --> 01:10:01.920
<v Speaker 2>as a concept. I think there's kind of three or

1196
01:10:01.920 --> 01:10:05.640
<v Speaker 2>two things in there, which is that there's generics as

1197
01:10:05.840 --> 01:10:10.039
<v Speaker 2>a consumer, which is basically the person consuming the functions,

1198
01:10:10.079 --> 01:10:12.760
<v Speaker 2>calling the functions. You need to know, for instance, how

1199
01:10:12.760 --> 01:10:15.960
<v Speaker 2>to pass a type to another type which is generics,

1200
01:10:15.960 --> 01:10:18.439
<v Speaker 2>you know, So if you have an ACYNC function, you

1201
01:10:18.479 --> 01:10:21.560
<v Speaker 2>need to understand how the promise type helper works, which

1202
01:10:21.600 --> 01:10:24.520
<v Speaker 2>is of course a generic type. But then the thing

1203
01:10:24.600 --> 01:10:26.960
<v Speaker 2>that I suppose we're really talking about is generic functions,

1204
01:10:27.000 --> 01:10:32.039
<v Speaker 2>declaring your own generic functions. Designing APIs. If you're in

1205
01:10:32.079 --> 01:10:35.239
<v Speaker 2>the business of designing an API, and I mean like

1206
01:10:35.800 --> 01:10:37.840
<v Speaker 2>an API for a function that other people are going

1207
01:10:37.840 --> 01:10:41.319
<v Speaker 2>to call, then you will probably need some generics at

1208
01:10:41.359 --> 01:10:44.239
<v Speaker 2>that point. And that's when we start to get this

1209
01:10:44.319 --> 01:10:46.960
<v Speaker 2>sort of spectrum coming in of we've got the app

1210
01:10:47.000 --> 01:10:51.279
<v Speaker 2>developers on one side, who are mostly just consuming generic functions,

1211
01:10:51.640 --> 01:10:54.399
<v Speaker 2>and then we've got the library developers on the other side,

1212
01:10:54.439 --> 01:10:58.600
<v Speaker 2>who are creating the generic functions, you know. And this

1213
01:10:58.760 --> 01:11:01.399
<v Speaker 2>sort of is a nice feature of typescripts, I think,

1214
01:11:01.439 --> 01:11:06.119
<v Speaker 2>because it means that a lot of complexity can just

1215
01:11:06.159 --> 01:11:10.359
<v Speaker 2>be held inside those generic functions and then just used

1216
01:11:10.399 --> 01:11:13.239
<v Speaker 2>in a very simple way with very few type pannotations

1217
01:11:13.239 --> 01:11:16.119
<v Speaker 2>by the app developers. I would say, I think of

1218
01:11:16.159 --> 01:11:19.399
<v Speaker 2>there as being three places, three sites of three levels

1219
01:11:19.399 --> 01:11:23.119
<v Speaker 2>of tacticrit wizardry. Let's say where you have the app

1220
01:11:23.119 --> 01:11:26.119
<v Speaker 2>developers on one side, you do have the library developers

1221
01:11:26.119 --> 01:11:27.720
<v Speaker 2>on the other side, who had to deal with all

1222
01:11:27.760 --> 01:11:32.079
<v Speaker 2>sorts of stuff like infer and conditional types and typescript performance,

1223
01:11:32.239 --> 01:11:35.720
<v Speaker 2>you know, like which is the performance of your types?

1224
01:11:35.840 --> 01:11:39.159
<v Speaker 2>You know, how fast does your idea update and things

1225
01:11:39.199 --> 01:11:41.840
<v Speaker 2>like that. And then I'd say that the utils folder

1226
01:11:42.039 --> 01:11:44.880
<v Speaker 2>is like a level in between where you don't necessarily

1227
01:11:44.920 --> 01:11:47.640
<v Speaker 2>need and this is not my idea is to actually

1228
01:11:47.720 --> 01:11:50.760
<v Speaker 2>orto the Rocks's idea. Who's a great typescript term was

1229
01:11:50.800 --> 01:11:54.000
<v Speaker 2>on the touch script team, great typical contributor, and the

1230
01:11:54.079 --> 01:11:57.439
<v Speaker 2>utils folder. I think you can get by with just

1231
01:11:57.479 --> 01:11:59.479
<v Speaker 2>a bit of types of knowledge, especially now you have

1232
01:11:59.520 --> 01:12:03.359
<v Speaker 2>things like gubt with Claude that can help you out

1233
01:12:03.359 --> 01:12:06.399
<v Speaker 2>a little bit with these. If you can declare a

1234
01:12:06.439 --> 01:12:10.760
<v Speaker 2>generic function, declare a generic type, I think that is

1235
01:12:10.840 --> 01:12:13.000
<v Speaker 2>going to really help you just in terms of your

1236
01:12:13.000 --> 01:12:16.279
<v Speaker 2>app developments, because it's going to mean that you can

1237
01:12:16.319 --> 01:12:19.439
<v Speaker 2>design your types a lot better. You can make types

1238
01:12:19.439 --> 01:12:22.399
<v Speaker 2>that sort of flow in beautiful ways, you can make

1239
01:12:22.479 --> 01:12:25.520
<v Speaker 2>generic fund make functions that do what you want them

1240
01:12:25.560 --> 01:12:27.680
<v Speaker 2>to on the type level as well as the runtime level,

1241
01:12:28.279 --> 01:12:30.720
<v Speaker 2>and so you don't if you're starting and it's like

1242
01:12:30.760 --> 01:12:33.840
<v Speaker 2>your first month doing type scripts don't dive into generics immediately.

1243
01:12:33.920 --> 01:12:36.760
<v Speaker 2>You know, there's no need, you can just consume generics.

1244
01:12:36.800 --> 01:12:42.199
<v Speaker 2>Just do that. But I think that as your apps grow,

1245
01:12:42.359 --> 01:12:44.680
<v Speaker 2>as more code gets shared, more code goes into the

1246
01:12:44.720 --> 01:12:48.399
<v Speaker 2>details folder knowing this stuff is going to just benefit

1247
01:12:48.439 --> 01:12:49.039
<v Speaker 2>you enormously.

1248
01:12:49.960 --> 01:12:53.279
<v Speaker 1>Yeah, I think that's the key point. I think it's

1249
01:12:53.319 --> 01:12:58.199
<v Speaker 1>totally fine to start before your quote unquote and expert.

1250
01:12:58.239 --> 01:13:01.479
<v Speaker 1>If we all waited to become expert before we actually

1251
01:13:01.520 --> 01:13:05.319
<v Speaker 1>started doing something, that we will never stop. Like the

1252
01:13:05.359 --> 01:13:10.560
<v Speaker 1>worst enemy of good is better, you know, fake it

1253
01:13:10.600 --> 01:13:13.439
<v Speaker 1>till you make it, and whatever is actually is actually

1254
01:13:13.479 --> 01:13:18.479
<v Speaker 1>a legitimate approach in this context that said, don't stop.

1255
01:13:19.039 --> 01:13:23.439
<v Speaker 1>If typescript is a core part of your development process,

1256
01:13:23.680 --> 01:13:25.800
<v Speaker 1>then I think that you owe it to yourself, to

1257
01:13:25.840 --> 01:13:29.000
<v Speaker 1>your career, to your team, to your product to become

1258
01:13:29.039 --> 01:13:32.000
<v Speaker 1>as proficient as possible in it. And I think that

1259
01:13:32.039 --> 01:13:35.119
<v Speaker 1>it's definitely worthwhile to put in the effort to go

1260
01:13:35.279 --> 01:13:38.840
<v Speaker 1>to websites like yours, to read the newsletters that you

1261
01:13:38.920 --> 01:13:42.840
<v Speaker 1>put out, to try things out, to make sure that

1262
01:13:42.920 --> 01:13:46.800
<v Speaker 1>you do understand you know, how things actually work, and

1263
01:13:47.199 --> 01:13:51.640
<v Speaker 1>stuff like that. So as long as you you know,

1264
01:13:52.000 --> 01:13:54.399
<v Speaker 1>say okay, I am going to put in the effort

1265
01:13:55.439 --> 01:13:58.800
<v Speaker 1>to fill in the blanks. I think it's a legitimate approach.

1266
01:13:59.600 --> 01:14:01.720
<v Speaker 2>Yeah, and learning this stuff as well, learning the mental

1267
01:14:01.760 --> 01:14:04.279
<v Speaker 2>models behind it. They just benefit you so much when

1268
01:14:04.319 --> 01:14:07.319
<v Speaker 2>you're building stuff because you just you don't get stuck

1269
01:14:07.359 --> 01:14:09.600
<v Speaker 2>so often. You know, you can just work your way

1270
01:14:09.640 --> 01:14:11.399
<v Speaker 2>through errors. You can understand what's going on.

1271
01:14:11.680 --> 01:14:14.479
<v Speaker 1>Now, if you've got another minute or two, I want

1272
01:14:14.560 --> 01:14:17.159
<v Speaker 1>to pick up one question that we got in in

1273
01:14:17.279 --> 01:14:20.199
<v Speaker 1>the in one of the chats. Let's see if I

1274
01:14:20.199 --> 01:14:23.279
<v Speaker 1>if I properly understand it or if you do. It's

1275
01:14:23.319 --> 01:14:27.319
<v Speaker 1>from either Poe or Poan. I hope I'm pronouncing it correctly,

1276
01:14:27.840 --> 01:14:31.960
<v Speaker 1>and he asks, how can we automatically convert typescript to

1277
01:14:32.119 --> 01:14:36.199
<v Speaker 1>runtime assertions? What are the options and the tool sets?

1278
01:14:37.000 --> 01:14:40.359
<v Speaker 2>Yeah, so one key part of typescript understanding is that

1279
01:14:40.399 --> 01:14:43.039
<v Speaker 2>it just doesn't operate at runtime at all, like.

1280
01:14:43.039 --> 01:14:43.880
<v Speaker 1>It's just gone.

1281
01:14:44.399 --> 01:14:47.399
<v Speaker 2>It's gone. It's just you know, like they're they're just

1282
01:14:47.520 --> 01:14:50.439
<v Speaker 2>cleaned out those types and so there can iterate.

1283
01:14:50.640 --> 01:14:54.640
<v Speaker 1>You can't iterate over like a lot of people like say,

1284
01:14:54.720 --> 01:14:57.159
<v Speaker 1>I hate the fact that you kind of define certain

1285
01:14:57.199 --> 01:15:00.760
<v Speaker 1>things like twice part once as values ones in types

1286
01:15:00.800 --> 01:15:04.079
<v Speaker 1>and one can can iterate over the type you can

1287
01:15:04.399 --> 01:15:07.000
<v Speaker 1>because it's not part of the run time, not part

1288
01:15:07.000 --> 01:15:07.560
<v Speaker 1>of the runtime.

1289
01:15:07.680 --> 01:15:10.680
<v Speaker 2>They just don't exist at runtime. And so this I

1290
01:15:10.720 --> 01:15:13.920
<v Speaker 2>think this question is sort of asking how do I

1291
01:15:14.079 --> 01:15:17.039
<v Speaker 2>make a type and sort of pull it into the runtime.

1292
01:15:17.600 --> 01:15:20.880
<v Speaker 2>And you probably could with some kind of cogen library,

1293
01:15:20.880 --> 01:15:23.000
<v Speaker 2>you know, an AI could probably m could probably do

1294
01:15:23.039 --> 01:15:27.760
<v Speaker 2>it for you. But yeah, I mean, there's there's no

1295
01:15:29.000 --> 01:15:32.239
<v Speaker 2>I think people who ask this question are asking the

1296
01:15:32.239 --> 01:15:35.680
<v Speaker 2>wrong thing, which is, instead of taking a type and

1297
01:15:35.680 --> 01:15:38.199
<v Speaker 2>putting it into the runtime, you should be thinking how

1298
01:15:38.239 --> 01:15:40.640
<v Speaker 2>do I take the runtime and turn it into a type.

1299
01:15:41.000 --> 01:15:43.720
<v Speaker 2>Because there's a really nice operator called the type of

1300
01:15:43.840 --> 01:15:48.800
<v Speaker 2>operator in typescripts, which it's same as the JavaScript operator

1301
01:15:48.840 --> 01:15:51.960
<v Speaker 2>but sort of operates slightly differently, which just lets you basically,

1302
01:15:52.000 --> 01:15:54.399
<v Speaker 2>if you're using something like zod which is a runtime

1303
01:15:54.479 --> 01:15:58.039
<v Speaker 2>validator runtime schema library, then you can take that and

1304
01:15:58.079 --> 01:16:01.960
<v Speaker 2>you can say type of z dot's schema and it

1305
01:16:02.079 --> 01:16:03.159
<v Speaker 2>just gives you a type of.

1306
01:16:03.439 --> 01:16:07.359
<v Speaker 1>The simple example. The simple example is the key is keys.

1307
01:16:08.000 --> 01:16:12.720
<v Speaker 1>Is the fact that you can use specify like an

1308
01:16:12.760 --> 01:16:18.199
<v Speaker 1>object with various keys infer a type from that. So

1309
01:16:18.239 --> 01:16:20.600
<v Speaker 1>now you've got the actual object which you can use

1310
01:16:20.640 --> 01:16:23.479
<v Speaker 1>at run time, but you've also inferred the type that

1311
01:16:23.520 --> 01:16:27.359
<v Speaker 1>you can use at you know, build slash programming type.

1312
01:16:27.920 --> 01:16:30.520
<v Speaker 2>Yeah, totally. A really good example is let's say you

1313
01:16:30.560 --> 01:16:34.920
<v Speaker 2>have an object of APIs that you want to hit

1314
01:16:35.119 --> 01:16:37.720
<v Speaker 2>with different sort of environments attached to them. So you

1315
01:16:37.760 --> 01:16:40.920
<v Speaker 2>have your your QA environment, your development environment, and your

1316
01:16:40.960 --> 01:16:43.600
<v Speaker 2>production environment. You have that on an object. You can

1317
01:16:43.640 --> 01:16:46.319
<v Speaker 2>pull those keys off and suddenly you have a union

1318
01:16:46.359 --> 01:16:49.479
<v Speaker 2>of those three keys. So I call this derived types,

1319
01:16:49.520 --> 01:16:52.840
<v Speaker 2>where you basically derive some sort of type from the

1320
01:16:52.880 --> 01:16:55.840
<v Speaker 2>type of thing. And this could be really powerful because

1321
01:16:56.159 --> 01:16:58.119
<v Speaker 2>it means that you don't need to maintain the type

1322
01:16:58.119 --> 01:17:00.920
<v Speaker 2>in two places. You just add an the key you

1323
01:17:00.960 --> 01:17:03.520
<v Speaker 2>had a staging environment, and then that suddenly appears in

1324
01:17:03.560 --> 01:17:05.840
<v Speaker 2>the type. It's really really powerful stuff.

1325
01:17:06.319 --> 01:17:10.640
<v Speaker 1>So before we've really run out of time, if people

1326
01:17:10.880 --> 01:17:13.199
<v Speaker 1>want to get in touch with you to you know,

1327
01:17:13.760 --> 01:17:16.680
<v Speaker 1>get on your news letter, your website, your book, whatever,

1328
01:17:16.880 --> 01:17:19.479
<v Speaker 1>what's the best way to find you? How how how

1329
01:17:19.520 --> 01:17:22.119
<v Speaker 1>do we you know, find all your stuff? Excellent stuff

1330
01:17:22.119 --> 01:17:23.000
<v Speaker 1>that you're putting out.

1331
01:17:23.640 --> 01:17:26.439
<v Speaker 2>Thank you. So this is total touch. Script dot com

1332
01:17:26.560 --> 01:17:29.359
<v Speaker 2>is basically the site where I put pretty much everything. Now,

1333
01:17:29.600 --> 01:17:30.640
<v Speaker 2>so there is a newsletter.

1334
01:17:30.680 --> 01:17:30.840
<v Speaker 1>There.

1335
01:17:30.840 --> 01:17:32.680
<v Speaker 2>There is my free book on there, which I mean

1336
01:17:32.920 --> 01:17:35.119
<v Speaker 2>it's a free book. It sounds like it's just a

1337
01:17:35.159 --> 01:17:37.279
<v Speaker 2>cheap giveaway. It took me nine months to write this thing,

1338
01:17:37.319 --> 01:17:38.920
<v Speaker 2>you know what I mean. Like, and it's being released

1339
01:17:38.920 --> 01:17:42.560
<v Speaker 2>as as an actual paper book as well. And I've

1340
01:17:42.560 --> 01:17:44.359
<v Speaker 2>got a course up there, and there are tons of

1341
01:17:44.359 --> 01:17:49.000
<v Speaker 2>free tutorials and sixty articles I've written up there. It's

1342
01:17:49.039 --> 01:17:50.800
<v Speaker 2>a it's a really solid resource.

1343
01:17:51.439 --> 01:17:53.560
<v Speaker 1>And in terms of paid stuff that you put out,

1344
01:17:53.680 --> 01:17:56.640
<v Speaker 1>what do you what is there? What's there? What's Yeah?

1345
01:17:57.279 --> 01:18:01.079
<v Speaker 2>So I've got I've got two courses, or two levels

1346
01:18:01.079 --> 01:18:05.640
<v Speaker 2>of courses, one which is pro Essentials, which is I

1347
01:18:05.680 --> 01:18:08.640
<v Speaker 2>mean it's about two hundred two hundred and forty exercises

1348
01:18:08.680 --> 01:18:12.319
<v Speaker 2>I think where basically it takes you from total beginner

1349
01:18:12.359 --> 01:18:14.880
<v Speaker 2>in tap script to sort of like the bottom end

1350
01:18:14.880 --> 01:18:17.159
<v Speaker 2>of Wizard, I'd say, So we cover generics, and there

1351
01:18:17.159 --> 01:18:20.600
<v Speaker 2>we cover all sorts of stuff related to typescript, and

1352
01:18:20.640 --> 01:18:23.760
<v Speaker 2>then the other stuff, which is the complete volume is

1353
01:18:23.800 --> 01:18:27.600
<v Speaker 2>I've got a series of really advanced workshops which I

1354
01:18:27.720 --> 01:18:31.359
<v Speaker 2>taught live, which are basically sort of I turned into

1355
01:18:31.399 --> 01:18:33.880
<v Speaker 2>a self paced course as well. So the whole thing,

1356
01:18:33.960 --> 01:18:37.079
<v Speaker 2>I think it's about five hundred exercises or so, like

1357
01:18:37.119 --> 01:18:41.640
<v Speaker 2>it's an enormous, great, big thing, But I love the exercises.

1358
01:18:41.800 --> 01:18:43.159
<v Speaker 2>You can just sort of dive into them in an

1359
01:18:43.199 --> 01:18:45.520
<v Speaker 2>your lunch break. Basically it should take about sort of

1360
01:18:45.520 --> 01:18:48.920
<v Speaker 2>five or ten minutes to solve each and there we've

1361
01:18:48.920 --> 01:18:51.359
<v Speaker 2>gotten feedback that it's just like a really addictive process.

1362
01:18:51.399 --> 01:18:53.199
<v Speaker 2>You can just go bam bam bam bamm solving all

1363
01:18:53.239 --> 01:18:55.159
<v Speaker 2>the exercises and it's great fun.

1364
01:18:55.720 --> 01:18:57.920
<v Speaker 1>And the very last thing before we let you go,

1365
01:18:58.039 --> 01:19:00.960
<v Speaker 1>is there anything interesting that you're working on now, something

1366
01:19:01.079 --> 01:19:02.199
<v Speaker 1>that we can look forward to.

1367
01:19:03.119 --> 01:19:06.680
<v Speaker 2>Well, I'm diving into the world of AI, I think,

1368
01:19:06.880 --> 01:19:10.960
<v Speaker 2>and I'm starting to find that I'm someone who's kind

1369
01:19:10.960 --> 01:19:13.479
<v Speaker 2>of allergic to hype. Really, I just hate the whole

1370
01:19:13.520 --> 01:19:16.840
<v Speaker 2>hype cycle for things like crypto, and I just want

1371
01:19:16.920 --> 01:19:19.640
<v Speaker 2>to get to the interesting stuff and the meat that's

1372
01:19:19.680 --> 01:19:23.960
<v Speaker 2>gonna kind of make me more money or make companies

1373
01:19:24.000 --> 01:19:26.920
<v Speaker 2>more productive, or like somewhere I can provide value, you

1374
01:19:26.920 --> 01:19:29.680
<v Speaker 2>know what I mean. I don't want to speculate on

1375
01:19:29.720 --> 01:19:34.039
<v Speaker 2>crypto rubbish. And AI has got a lot of hype

1376
01:19:34.079 --> 01:19:37.920
<v Speaker 2>around it, but it's also very, very real and based

1377
01:19:37.960 --> 01:19:41.000
<v Speaker 2>on a lot of good science, and yeah, I'm finding

1378
01:19:41.039 --> 01:19:44.239
<v Speaker 2>it very very interesting and potentially thinking about making something

1379
01:19:44.239 --> 01:19:44.720
<v Speaker 2>from it.

1380
01:19:45.520 --> 01:19:49.119
<v Speaker 1>Oh so very cool. So you know, people are used

1381
01:19:49.119 --> 01:19:51.720
<v Speaker 1>to us also having a pick section, but I think

1382
01:19:51.760 --> 01:19:55.399
<v Speaker 1>we've kind of ran out of time. I would love

1383
01:19:55.439 --> 01:19:57.560
<v Speaker 1>to have you on again. There are so many questions

1384
01:19:57.560 --> 01:19:59.399
<v Speaker 1>on my list that we didn't get around to, and

1385
01:19:59.520 --> 01:20:03.439
<v Speaker 1>we didn't about AI at all, So hopefully I can

1386
01:20:03.479 --> 01:20:07.359
<v Speaker 1>get you on again. In any event, it's been excellent.

1387
01:20:07.479 --> 01:20:09.920
<v Speaker 1>I've learned a lot. It's been such a joy speaking

1388
01:20:09.920 --> 01:20:12.239
<v Speaker 1>with you. I hope our listeners have learned as well.

1389
01:20:12.760 --> 01:20:15.079
<v Speaker 1>So thank you for coming on our show, and to

1390
01:20:15.119 --> 01:20:19.439
<v Speaker 1>all our listeners, you know, thank you for listening to us.

1391
01:20:19.479 --> 01:20:23.520
<v Speaker 1>And again reminder if you're thinking about filling in the

1392
01:20:23.600 --> 01:20:27.880
<v Speaker 1>job as the JAS survey mention us you know given

1393
01:20:28.039 --> 01:20:32.800
<v Speaker 1>excellent content like this one. And thank you all and goodbye.
