WEBVTT

1
00:00:06.400 --> 00:00:10.480
Hey, welcome back to another episode
of JavaScript Jabber. This week, on

2
00:00:10.480 --> 00:00:14.560
our panel, we have a j
O'Neal yo yo yo, coming at your

3
00:00:14.560 --> 00:00:19.480
live from the Is my audio in
sync? It looks like it is.

4
00:00:20.760 --> 00:00:23.519
That's a new place. I haven't
heard of that place before. Yeah.

5
00:00:23.519 --> 00:00:28.079
Well I was on the boot dot
dev podcast and when it got released on

6
00:00:28.120 --> 00:00:33.039
YouTube, I'm like half a second
off. Oh yeah, it looks terrible

7
00:00:33.840 --> 00:00:36.039
and I was trying to figure it
out. And as far as I can

8
00:00:36.119 --> 00:00:38.799
tell, my audio is in sync
on this end. And look, I

9
00:00:38.840 --> 00:00:42.920
can see lag too, now that
you say it, Yeah, there is

10
00:00:42.960 --> 00:00:46.039
a slight lag. Really you're looking
for it, you can see it.

11
00:00:46.560 --> 00:00:50.520
Well, that's what we need to
know because I can fix that extremely easily.

12
00:00:50.600 --> 00:00:56.320
I can fix that with Okay,
is the lag better or worse?

13
00:00:57.799 --> 00:01:02.679
Not, bab, that's the same. How about now is it is double

14
00:01:02.679 --> 00:01:07.799
shooting live on the show? I
know, yeah, I think it looks

15
00:01:07.840 --> 00:01:11.599
better now. I think yeah,
okay, deal a right hundred millisecond to

16
00:01:11.760 --> 00:01:14.480
like, this is how the sausage
is made, Yes, this is how

17
00:01:14.480 --> 00:01:18.319
the sausage is made. Coming at
your live from how the sausage is made,

18
00:01:19.400 --> 00:01:22.879
I think there is still an I
would add another one hundred millisecond by

19
00:01:22.879 --> 00:01:26.400
the way, all right, thanks, all right. We also have Dan

20
00:01:26.439 --> 00:01:34.400
Shapier Hey from an Israel still at
war, Steve Edwards Yo from I'm only

21
00:01:34.439 --> 00:01:40.799
one yo, not yo yo yo
from uh that's very foggy Portland area where

22
00:01:40.799 --> 00:01:44.640
we need more snow. Yeah,
I'm Charles Maxwood from top End Devs and

23
00:01:45.599 --> 00:01:49.040
I'm gonna tell you all to go
over to top endevs dot com slash calendar.

24
00:01:49.079 --> 00:01:53.439
We have a whole bunch of stuff
coming up and I'm super excited to

25
00:01:53.480 --> 00:01:57.359
be uh working with folks to help
them get ahead and figure things out.

26
00:01:57.400 --> 00:02:04.359
So yeah, this week we're going
to be talking about typescript and JavaScript.

27
00:02:04.359 --> 00:02:07.840
And Dan, you've done a whole
bunch of Twitter polls that you wanted to

28
00:02:07.879 --> 00:02:12.719
talk through, and I think that's
kind of an interesting thing that you're doing

29
00:02:12.759 --> 00:02:15.960
there. Do you want to give
us a little bit of backstory though on

30
00:02:15.680 --> 00:02:22.080
what prompted you to ask these questions
and why these particular ones. Yeah,

31
00:02:22.360 --> 00:02:25.039
Well, as you said, over
the past couple of weeks, I've been

32
00:02:25.120 --> 00:02:30.520
running a series of polls. They're
actually fairly easy to find on my account

33
00:02:30.599 --> 00:02:34.319
because i've more or less phrased all
of them the same way. All of

34
00:02:34.360 --> 00:02:38.439
them start with a question what kind
of a JS slash tsdev are you?

35
00:02:38.199 --> 00:02:43.039
And then I pose a particular question
and we will go through the list of

36
00:02:43.120 --> 00:02:46.400
questions. Now. The reason is
that, as we know, and as

37
00:02:46.439 --> 00:02:53.039
AJ loves, there are multiple ways
to do anything in JavaScript, and over

38
00:02:53.199 --> 00:02:58.919
the past number of years, the
number of ways has been steadily increasing,

39
00:02:59.800 --> 00:03:05.280
and all the tooling is also influencing
the way in which we're using JavaScript,

40
00:03:05.319 --> 00:03:10.960
and it kind of made me curious
about, you know, our developers primarily

41
00:03:12.080 --> 00:03:19.199
using the new ways the old ways. I've seen I've been surprised by some

42
00:03:19.280 --> 00:03:22.120
of the things that I've seen people
do. You know, I review a

43
00:03:22.120 --> 00:03:25.319
lot of code. I've been surprised
by things that I've see in code.

44
00:03:27.159 --> 00:03:30.759
Now, you know, we've got
tools like Prettier and whatnot to kind of

45
00:03:31.319 --> 00:03:39.680
rectify a lot of the you know, various discrepancies that creep into our code.

46
00:03:39.719 --> 00:03:43.680
But be that as it may,
I was really interested in, you

47
00:03:43.719 --> 00:03:46.719
know, how people, you know, what are their default preferences as it

48
00:03:46.800 --> 00:03:53.520
were, you know, And so
I started running these polls just you know,

49
00:03:53.639 --> 00:03:57.280
various questions that popped into my head
about the ways in which people are

50
00:03:57.400 --> 00:04:02.400
using JavaScript or typescript or both,
and sometimes I was surprised by the answers,

51
00:04:02.599 --> 00:04:08.280
sometimes less so. And I thought
that it would be a great topic

52
00:04:08.400 --> 00:04:12.639
to discuss, you know, especially
in this episode, which we are recording

53
00:04:13.000 --> 00:04:15.759
on January first, So it's kind
of like the beginning of the new year

54
00:04:16.480 --> 00:04:23.040
and trying to kind of take stock
where we all are as web developers or

55
00:04:23.160 --> 00:04:27.720
JavaScript developers. So, as you
said, I've ran all this whole bunch

56
00:04:27.759 --> 00:04:32.480
of questions. I doubt that we
will have time to go through all of

57
00:04:32.480 --> 00:04:36.920
them, but we will see,
you know, maybe we'll have more for

58
00:04:38.000 --> 00:04:42.000
an additional episode. Maybe I'll run
I'll have ideas for more questions to ask

59
00:04:42.160 --> 00:04:47.399
following this episode. But I've copied
all the other questions and the answers that

60
00:04:47.439 --> 00:04:55.279
I got. I didn't organize them
according to the order in which I asked

61
00:04:55.279 --> 00:04:59.199
them, because that was pretty random
as things occurred to me. Rather,

62
00:04:59.360 --> 00:05:05.000
I tried to group them and also
kind of sort them from the more general,

63
00:05:05.279 --> 00:05:10.680
you might say, to the more
specific, so we will see how

64
00:05:10.680 --> 00:05:14.560
it goes and how farther far down
the list we can get. So the

65
00:05:14.600 --> 00:05:17.240
first question which I asked, the
first question on the poll, and one

66
00:05:17.399 --> 00:05:21.439
of the questions that got the most
votes, it got something like three hundred

67
00:05:21.480 --> 00:05:29.800
and seventy six votes, not like
exactly, and the question was about the

68
00:05:29.959 --> 00:05:34.079
usage of you might say, typescript
versus JavaScript. So I basically gave four

69
00:05:34.160 --> 00:05:45.079
options typescript without any, typescript with
any JS doc, and JavaScript without any

70
00:05:45.120 --> 00:05:49.720
explicit types. Now it's important to
kind of emphasize that when I'm what I

71
00:05:49.800 --> 00:05:57.240
meant by typescript without any is not
that there's absolutely positively no use of any

72
00:05:57.279 --> 00:06:01.959
anywhere in the code, rather that
then an effort is made in order to

73
00:06:02.040 --> 00:06:08.639
get rid of any as much as
makes sense. So it's about people who

74
00:06:08.680 --> 00:06:15.079
take a more strict attitude towards typescript
versus those that take a more relaxed kind

75
00:06:15.120 --> 00:06:21.920
of attitude towards typescript. But you
might say that both these groups actually use

76
00:06:23.000 --> 00:06:29.879
typescript. In fact, I might
argue that anybody is using jastock is effectively

77
00:06:30.000 --> 00:06:36.720
also using typescript, just with a
different syntax and different tool chain. And

78
00:06:36.759 --> 00:06:44.920
the makers just felt would agree with
that, Yeah, for sure. And

79
00:06:45.279 --> 00:06:49.079
it's also worth mentioning that, you
know, one of the Twitter brew ha

80
00:06:49.199 --> 00:06:53.639
haas that we had back in twenty
twenty three, you know, so long

81
00:06:53.680 --> 00:07:00.560
ago was the one started by Dagge
about whether or not using explicit types is

82
00:07:00.600 --> 00:07:04.439
a good thing or not. And
you know, whether we should be just

83
00:07:04.600 --> 00:07:12.920
using javascripted dynamic types or should we
be you know, converting to static typing

84
00:07:12.959 --> 00:07:17.519
as much as we can. And
it's important to emphasize that difference between uh

85
00:07:17.839 --> 00:07:23.680
a Dhege takes take and the one
taken let's say in Spelt, which you

86
00:07:23.800 --> 00:07:31.199
mentioned where they they ditched the typescript
syntax, but not the typescript approach because

87
00:07:31.240 --> 00:07:41.000
as as Steve said, they embraced
jaystoc. So if we go, if

88
00:07:41.040 --> 00:07:46.839
we look at the results, we
see that almost fifty five percent use typescript

89
00:07:46.079 --> 00:07:56.000
without any then another, yeah,
how do I do that? Is there?

90
00:07:56.439 --> 00:08:01.759
Oh? Yeah, a present that's
the one? Okay, sure,

91
00:08:01.839 --> 00:08:09.360
screen, Okay, just keep in
mind that most of our audio only,

92
00:08:09.439 --> 00:08:15.120
so we need to make it friendly
to that. Yeah, obviously, here

93
00:08:15.160 --> 00:08:22.319
we go. Can you see it
now? Nope? I got to add

94
00:08:22.319 --> 00:08:30.839
it to the Oh there we go. Good deal. Okay. The only

95
00:08:30.879 --> 00:08:33.799
problem is that then now I don't
see you guys. But you know,

96
00:08:33.039 --> 00:08:41.039
be that as it may, it
can be a good thing. Yeah.

97
00:08:41.039 --> 00:08:48.679
So again the numbers are fifty five
percent almost used typescript without any, twenty

98
00:08:48.720 --> 00:08:58.159
percent used typescript with any, another
fourteen percent use JS stock and there and

99
00:08:58.200 --> 00:09:05.279
then and then percent just use JavaScript. I think I vuted in this one,

100
00:09:05.320 --> 00:09:09.720
and I think I was the last
because I've just I've been too lazy

101
00:09:09.759 --> 00:09:16.279
to really deeply go for any of
it. So you're you're just using JavaScript

102
00:09:16.279 --> 00:09:22.399
and benefiting from the type information that
the VS code can provide for you regardless,

103
00:09:22.480 --> 00:09:26.559
because yeah, basically for the libraries
and whatnot. Yeah, but you

104
00:09:26.639 --> 00:09:35.159
also have to understand that my contract
is a Ruby contract and so right,

105
00:09:35.279 --> 00:09:41.639
so a lot of those people are
probably not writing full stacked JavaScript, right,

106
00:09:41.679 --> 00:09:45.080
They're they're doing something where hey,
you know, it pulls in the

107
00:09:45.159 --> 00:09:48.720
JavaScript stuff and it does the JavaScript
stuff. M Does that make sense?

108
00:09:50.159 --> 00:09:54.279
Yes? It does so, And
and you know, if your usage of

109
00:09:54.399 --> 00:10:00.399
JavaScript is kind of minimal, and
especially if you're working solo, it makes

110
00:10:00.440 --> 00:10:05.120
a whole lot of sense. In
my opinion, I once tweeted, joked

111
00:10:05.240 --> 00:10:11.159
or shit tweeted or whatever you call
it, that my optimal use of typescript

112
00:10:11.240 --> 00:10:16.360
is everybody uses typescript and I just
use JavaScript and benefits from everybody else's hard

113
00:10:16.399 --> 00:10:24.039
work. So I totally get it. And most of the organizations that I

114
00:10:24.200 --> 00:10:28.759
see using typescript actually are you know, multiple developers working together on the same

115
00:10:28.799 --> 00:10:33.279
code base. It could be like
five people, it might be fifty people.

116
00:10:33.600 --> 00:10:37.840
And in those environments it makes sense
to be as strict as you possibly

117
00:10:37.879 --> 00:10:43.559
can about stuff well the moment you
have to refactor something. Okay, first

118
00:10:43.600 --> 00:10:46.200
of all, I'm not talking about
typescript, I'm talking about types. I'm

119
00:10:46.240 --> 00:10:50.799
not even talking about types. I'm
talking about tooling. Because all of this

120
00:10:50.200 --> 00:10:54.879
is completely it really is just completely
bogus, entirely because there's no such thing

121
00:10:54.919 --> 00:10:58.519
as types. There's only tooling.
Once it runs his machine code, the

122
00:10:58.559 --> 00:11:05.120
machine runs whatever the machine code says. The machine does not care about types

123
00:11:05.480 --> 00:11:09.679
whatsoever. That's how we get all
the security vulnerabilities, uh in memory corruption

124
00:11:09.960 --> 00:11:13.240
and and you know, all of
that stuff, right, because the machine

125
00:11:13.320 --> 00:11:18.799
doesn't know what types are. The
types are in the tooling, and the

126
00:11:18.840 --> 00:11:24.240
Typescript checker is probably the best tooling
that we have in JavaScript. I think

127
00:11:24.279 --> 00:11:28.279
we could have something way better.
I think it pales in comparison to what

128
00:11:28.759 --> 00:11:33.720
somebody just looking at JavaScript as a
language could come up with if they had

129
00:11:33.759 --> 00:11:39.080
the resources that the typescript team had, Right. But jas doc and the

130
00:11:39.080 --> 00:11:45.000
typescript checker gives you tooling that lets
you know when things are out of alignment.

131
00:11:46.240 --> 00:11:50.840
So you change you missed, you
misspell something, you misspell a property

132
00:11:50.919 --> 00:11:56.360
name, you get the spell check
on it. You you need to change

133
00:11:56.320 --> 00:12:01.000
the name and type of something.
Say that. Know, you did the

134
00:12:01.039 --> 00:12:07.120
dummy thing and you put in as
a float, but you realize, oh,

135
00:12:07.200 --> 00:12:11.440
that should be a string instead,
because it's money and money and floats

136
00:12:11.440 --> 00:12:13.960
don't mix right, and you know, so you change it to a string.

137
00:12:13.559 --> 00:12:22.000
It gives you that capability to get
errors where you forgot something, and

138
00:12:22.000 --> 00:12:28.639
I think that's really where the core
value of it is. Well, I

139
00:12:28.759 --> 00:12:35.159
have to say first of all that
these days, if you're using doing money

140
00:12:35.159 --> 00:12:41.080
in JavaScript, you should be using
like a big int rather than strings.

141
00:12:41.679 --> 00:12:48.720
Oh sure, pardon my French.
Yeah, but it's interesting that I agree

142
00:12:48.759 --> 00:12:52.879
with the gist of what you said, but I do disagree with some of

143
00:12:52.919 --> 00:13:00.360
the details. I think you're correct
about the run time carrying, you know,

144
00:13:00.440 --> 00:13:03.240
not caring that much about types in
terms of the machine code, although

145
00:13:03.279 --> 00:13:07.639
you know it does. You know, these days, if used to differentiate

146
00:13:07.679 --> 00:13:15.360
between floats and ends and stuff like
that. But the types in many programming

147
00:13:15.440 --> 00:13:22.360
languages do determine the code that gets
generated. It's interesting that in the typescript

148
00:13:22.480 --> 00:13:28.879
JavaScript combination, you know, all
the type information is effectively jettisoned, and

149
00:13:28.919 --> 00:13:35.320
then the JavaScript engine kind of needs
to infer the stuff dynamically at runtime and

150
00:13:35.600 --> 00:13:39.200
generate the code based on that on
what it actually encounters and sees, and

151
00:13:39.720 --> 00:13:45.639
totally disregard the information that it had
probably you know, probably correct information that

152
00:13:45.720 --> 00:13:54.120
it might have had in typescript.
Yes, but if you are using and

153
00:13:54.200 --> 00:13:58.320
again not typescript, but if you're
using JavaScript types and you're using them consistently,

154
00:13:58.799 --> 00:14:03.279
if you're only using you know,
if you never switch a variable name

155
00:14:03.600 --> 00:14:09.519
between what type it is, so
you do strict typing, and then you

156
00:14:09.639 --> 00:14:20.320
also use specific types for specific purpose
strong typing, then you will when the

157
00:14:20.919 --> 00:14:28.519
when the JIT optimizer looks at your
object. If you provided the object that

158
00:14:28.559 --> 00:14:33.600
you're going to use from the start
and you use it the same way throughout,

159
00:14:33.480 --> 00:14:37.639
then it's going to be optimized.
If you're stretching up the way you're

160
00:14:37.720 --> 00:14:43.440
using it, it can't optimize it. Again, I'll slightly rephrase, you're

161
00:14:43.879 --> 00:14:48.120
I if you are consistent in terms
of the type information, you're making it

162
00:14:48.240 --> 00:14:52.960
much easier for the JIT to optimize
it. It still may not optimize it.

163
00:14:54.039 --> 00:14:58.000
For example, if it's only run
once, then it might decide that

164
00:14:58.039 --> 00:15:03.559
it's just not worth the effort.
But but yeah, by by doing things

165
00:15:05.000 --> 00:15:11.039
poorly in terms of type consistency,
you're effectively preventing GIT from optimizing it,

166
00:15:11.080 --> 00:15:18.799
even if it wants to. The
Other point that I wanted to make is

167
00:15:20.200 --> 00:15:26.360
that I don't know what surprised me
more. Is was it the fact that

168
00:15:26.600 --> 00:15:37.200
eighty eight percent effectively used typescript or
that twelve percent don't. Well we had

169
00:15:37.240 --> 00:15:41.120
a comment somebody said that fifty percent
is lying, and I I'm gonna agree

170
00:15:41.120 --> 00:15:45.960
with them. Well, just to
back up, you know, you said

171
00:15:45.960 --> 00:15:50.120
that typescript with any is or without
any is, you're making an effort to

172
00:15:50.159 --> 00:15:52.120
minimize any But I don't know if
I get that from this question. So

173
00:15:52.919 --> 00:15:56.080
oh, I added it in a
follow up comment. I should have probably

174
00:15:56.120 --> 00:16:03.200
specified it more explicitly in the original
original question. But if that's the case,

175
00:16:03.240 --> 00:16:07.679
if people read it to be,
you know, really without any than

176
00:16:07.919 --> 00:16:11.720
fifty five percent, Yes, it's
very optimistic. It is very optimistic.

177
00:16:11.799 --> 00:16:22.679
Yeah. Yes, from what I'm
seeing in the real world, then there's

178
00:16:22.840 --> 00:16:26.720
much more use of any than we
would like. By the way, Ah

179
00:16:26.759 --> 00:16:30.559
yeah, I remember one more thing
that I wanted to say about what you

180
00:16:30.720 --> 00:16:36.240
mentioned before a J. I actually
think that the Typescript team have done an

181
00:16:36.320 --> 00:16:41.879
amazing work of corraling what is likely
the most dynamic of any of all dynamic

182
00:16:42.000 --> 00:16:49.000
languages into some sort of static type
system. You know, JavaScript was not

183
00:16:49.320 --> 00:16:55.960
designed with static typing in mind.
This is not okamal, this is not

184
00:16:56.120 --> 00:17:04.200
Haskell. Uh And being able to
retrofit a sane static type system, you

185
00:17:04.240 --> 00:17:08.319
know, you can argue the same
part, but you know, being able

186
00:17:08.400 --> 00:17:15.039
to retrofit something like that on top
of JavaScript is pretty amazing. I'll give

187
00:17:15.079 --> 00:17:22.160
you an example. Think about a
method like document dot create element. The

188
00:17:22.319 --> 00:17:30.720
type returned depends on this value of
the string passed into the function. So

189
00:17:32.400 --> 00:17:37.680
you know that's something that's really kind
of difficult to do if you think about

190
00:17:37.720 --> 00:17:45.599
it, you know, making the
return type conditioned on the value of the

191
00:17:45.759 --> 00:17:49.519
argument. Well, I think I
think this is where languages need to go,

192
00:17:49.599 --> 00:17:55.480
and this is one of the things
that ZIG has maybe not pioneered but

193
00:17:55.920 --> 00:18:03.480
advertises there's no reason that your tooling
shouldn't be able to look at your code

194
00:18:03.519 --> 00:18:08.319
and effectively run whatever is runnable at
dev time, Like it shouldn't have to

195
00:18:08.359 --> 00:18:15.000
wait until its machine code to be
able to understand, Oh, this string,

196
00:18:15.319 --> 00:18:22.359
it's obviously the word div you know. So I'm not as impressed by

197
00:18:22.359 --> 00:18:29.160
that as I am disappointed that it's
taken this long and has so few implementations.

198
00:18:30.720 --> 00:18:33.519
There's a whole other topic which I
think is beyond the scope today,

199
00:18:34.240 --> 00:18:40.480
which is about the fact that typescript
really has effectively like two levels. There's

200
00:18:40.519 --> 00:18:45.440
the level of usage by most application
developers, and then there's the level used

201
00:18:45.480 --> 00:18:52.559
by library creators, which is much
more difficult and is much more use of

202
00:18:52.640 --> 00:19:00.480
things like generics and stuff like that
in order to make the interfaces as type

203
00:19:00.559 --> 00:19:04.160
safe as possible, and sometimes that
does require a lot of know how an

204
00:19:04.200 --> 00:19:07.359
effort. But again, I think
that kind of goes beyond the scope of

205
00:19:07.799 --> 00:19:11.480
you know, how much we want
to talk about that particular question, otherwise

206
00:19:11.519 --> 00:19:15.880
you'll never get to any of the
others. Yeah, but so to that

207
00:19:17.079 --> 00:19:22.200
end, did you hear about a
floppy bird being implemented in Typeescript? Well,

208
00:19:22.640 --> 00:19:26.200
yes, I did. And it's
not surprising because in order to do.

209
00:19:26.279 --> 00:19:30.920
You know, once you introduce generics
into the type system, you've effectively

210
00:19:32.000 --> 00:19:36.279
made your type system a programming language. Yeah. And by typescript I meant

211
00:19:36.279 --> 00:19:40.559
not typescript, but type the types
of type. Yeah, the typescript types.

212
00:19:41.160 --> 00:19:44.920
Yeah, the type. Yeah.
I've seen similar things, by the

213
00:19:44.960 --> 00:19:48.960
way, done in for example,
in C plus plus once when C plus

214
00:19:48.960 --> 00:19:55.839
plus got generics, the C plus
plus template system. Because again, once

215
00:19:55.880 --> 00:20:00.640
you throw in generics and and stuff
like that, and effectively it becomes a

216
00:20:00.680 --> 00:20:04.559
programming language. You can start doing
conditionals and loops and from that point on,

217
00:20:04.640 --> 00:20:08.799
you know you're after the races.
Okay, next question. The next

218
00:20:08.880 --> 00:20:14.640
question was, and here I need
to thank a few people. You know,

219
00:20:14.720 --> 00:20:18.359
we will link to I won't try
to read the names. We can

220
00:20:18.400 --> 00:20:23.440
link to the to the actual list
of tweets and the people can see it.

221
00:20:23.799 --> 00:20:29.279
Basically, it was to see whether
or not people are using semi colons

222
00:20:29.359 --> 00:20:33.400
or not, because again this became
a whole Twitter debate all over again.

223
00:20:33.519 --> 00:20:37.839
Surprisingly so I really didn't expect it
in twenty twenty three, but here we

224
00:20:37.920 --> 00:20:45.759
are whether or not you use semi
colons at the end of JavaScript statements.

225
00:20:47.039 --> 00:20:51.200
Now, obviously we've got tools like
prettier that can add it or remove it

226
00:20:51.359 --> 00:20:56.079
depending on your preferences. My question
was mainly about what is your preference,

227
00:20:56.240 --> 00:21:02.160
what do you prefer to do,
how do you prefer to write your jobscript

228
00:21:02.240 --> 00:21:07.759
code? And I'm happy to see
that the majority prefer semi colons, because

229
00:21:07.839 --> 00:21:14.519
that's also my preference. Anybody here
likes of, you know, not using

230
00:21:14.880 --> 00:21:19.079
not putting in semi colons explicitly something
from the PHP world where they're required is

231
00:21:19.079 --> 00:21:22.680
to sort of have it anymore for
me. It for me, it just

232
00:21:22.720 --> 00:21:27.039
makes neater and easier to read code. You know. That's and there's times

233
00:21:27.039 --> 00:21:32.319
where code won't have a semi colon, but that's pretty rare for me.

234
00:21:33.000 --> 00:21:37.000
Yeah, at the risk of dragging
DHH back into this, so most of

235
00:21:37.039 --> 00:21:41.559
his JavaScript code samples don't have them, which is kind of funny because I

236
00:21:42.319 --> 00:21:48.319
prefer putting them in. I get
that we have automatic semi colon insertion and

237
00:21:48.440 --> 00:21:52.799
other things that make it so that, you know, generally you don't have

238
00:21:52.880 --> 00:21:56.480
to put them in. I just
I don't know for me, it's kind

239
00:21:56.480 --> 00:22:02.880
of just an explicit hey, you
know, anyway I put them in I'm

240
00:22:02.960 --> 00:22:08.240
actually I feel like seventy percent right
here. Yeah. My take on this

241
00:22:08.599 --> 00:22:12.839
is that, again, it's not
that semi colons are optional in JavaScript.

242
00:22:12.880 --> 00:22:18.079
It's that we have asi automatic semi
colon insertion, which basically means that the

243
00:22:18.160 --> 00:22:26.119
JavaScript parser parses stuff errors out because
there's a missing semi coolon, and when

244
00:22:26.160 --> 00:22:30.319
it does, it catches that error
and then tries to figure out where's the

245
00:22:30.440 --> 00:22:37.319
most logical place to insert that missing
semicolon. And I don't like my tooling

246
00:22:37.759 --> 00:22:42.920
doing guesses about, you know,
where semi colons should go. You know,

247
00:22:45.079 --> 00:22:48.160
I like magic in my code,
but not this kind of magic.

248
00:22:48.759 --> 00:22:52.440
That's one of the things that's nice
about Prettier is when you accidentally forget a

249
00:22:52.480 --> 00:22:56.200
semicolon or whatever, Prettier reformats your
code in such a way that it is

250
00:22:56.359 --> 00:23:03.400
clearly obvious that the structure of the
code and the way it's executing has changed.

251
00:23:04.079 --> 00:23:10.759
But I will also say one of
the reasons that I'm against not using

252
00:23:10.799 --> 00:23:15.759
semi colons is that they are required
because there's a list of edge cases that

253
00:23:15.799 --> 00:23:19.519
you have to be aware of,
and you can either choose to just always

254
00:23:19.519 --> 00:23:25.240
put a semi colon, or you
can carry around in your head that list

255
00:23:25.279 --> 00:23:30.839
of like five or seven checks,
and then always be thinking about, like,

256
00:23:30.960 --> 00:23:36.279
every single time you don't insert a
semicolon, is it breaking any of

257
00:23:36.319 --> 00:23:41.759
these five or seven rules? And
if you are willing to do that mental

258
00:23:41.799 --> 00:23:49.599
gymnastics, then you don't need semi
colons. However, I've found a very

259
00:23:49.720 --> 00:23:56.000
very simple list of rules that I
believe also would eliminate the need for semi

260
00:23:56.000 --> 00:24:03.039
colons, which is if you either
all capture the result of a function or

261
00:24:03.200 --> 00:24:10.960
use the keyword void to explicitly disregard
what the return of the Java and JavaScript

262
00:24:10.960 --> 00:24:15.759
are the same. I knew it. And you know, if you never

263
00:24:15.519 --> 00:24:22.359
do something that requires parentheses, uh
in the order of operations fashion, you

264
00:24:22.400 --> 00:24:26.960
know, like if you never if
you always split multiplication in addition onto two

265
00:24:26.960 --> 00:24:30.240
lines, or you know, something
like that, anything that would require parentheses

266
00:24:30.279 --> 00:24:36.680
to be able to yeah, and
be careful of the return keyword and other

267
00:24:36.799 --> 00:24:42.519
various rules just easier to semi colons. Uh yeah, Yeah. I agree

268
00:24:42.519 --> 00:24:48.200
with the tooling that we have,
but I I believe that we could have

269
00:24:48.440 --> 00:24:55.359
a a version of JavaScript that doesn't
require semi collins. Oh, which would

270
00:24:55.359 --> 00:24:56.839
be nice if we could. If
we could get there, but it would

271
00:24:56.880 --> 00:25:02.440
require it following other rules that people
anyway, Yeah, it's called python.

272
00:25:03.920 --> 00:25:10.480
I was I was actually gonna call
it ai script, but there we go.

273
00:25:11.240 --> 00:25:15.160
Yeah, exactly. Okay, moving
on to the next one. Another

274
00:25:15.279 --> 00:25:21.480
question about how people write, or
style more precisely, their their JavaScript code.

275
00:25:21.920 --> 00:25:26.319
And this one is about how do
you write a named function? And

276
00:25:26.480 --> 00:25:32.839
the two options are either to be
old school and use the function keywords,

277
00:25:32.920 --> 00:25:37.519
So let's say it's function foo open
parentheses, bar close parentheses, and then

278
00:25:37.599 --> 00:25:41.519
you know, open curly brackets and
so forth. The other option, which

279
00:25:41.519 --> 00:25:48.359
I'm seeing a lot in code these
days, is using an assignment of the

280
00:25:48.720 --> 00:25:53.920
function expression, so you would do
something like constant fou equals a bar arrow

281
00:25:55.480 --> 00:26:03.240
and then the curly brackets, so
it's assigning function expression into an named variable

282
00:26:03.480 --> 00:26:14.880
or identifier more precisely. Now Here
it was fairly evenly split, but still

283
00:26:15.119 --> 00:26:23.400
fifty five percent preferred the good old
fashion function keyword, which I'm happy to

284
00:26:23.440 --> 00:26:30.039
say is what I also prefer.
And by the way, an important point

285
00:26:30.119 --> 00:26:33.880
to make here is that when I
look at the code base, if it

286
00:26:33.920 --> 00:26:40.480
doesn't use the approach that I prefer, I don't change it. I maintain

287
00:26:40.559 --> 00:26:45.400
consistency with a code base. Wow, that's very mature review. I know,

288
00:26:45.599 --> 00:26:51.000
Dan, I know, I have
to say the readability wise, I

289
00:26:51.079 --> 00:26:55.319
prefer the bottom one, but I
am freaking lazy, and so I very

290
00:26:55.359 --> 00:27:03.039
often do the top one. Why
just a macro like if you want to

291
00:27:03.039 --> 00:27:08.720
be lazy, be really lazy,
like use the tools. Why are you

292
00:27:08.759 --> 00:27:12.119
typing out the whole word cost when
you could just type fn and tab.

293
00:27:18.200 --> 00:27:23.319
Now I feel bad, to be
honest, I really don't know why people

294
00:27:23.799 --> 00:27:34.839
preferred the assignment of the arrow.
You know, maybe it's look it.

295
00:27:36.799 --> 00:27:41.599
There is the one benefit which or
there are a few benefits. First of

296
00:27:41.640 --> 00:27:48.920
all, it does explicitly make the
identified immutable, which is probably what you

297
00:27:48.000 --> 00:27:52.759
want in a function in like ninety
nine point nine percent of the time.

298
00:27:55.119 --> 00:28:00.799
Another advantage is that you don't that
this is not bound, which is again

299
00:28:00.960 --> 00:28:08.319
is what you generally want these days. Uh. And another advantage is that

300
00:28:10.000 --> 00:28:15.079
you don't there's the arguments object doesn't
exist, and the argument object is something

301
00:28:15.119 --> 00:28:18.799
that you probably don't want to use
anyway these days. Other than that,

302
00:28:21.519 --> 00:28:26.759
it's I don't see like it's it
seems less readable to me, like being

303
00:28:26.000 --> 00:28:30.799
saying something is a function is a
much more explicit way of saying something is

304
00:28:30.799 --> 00:28:37.240
a function, and I like my
god to be explicit. The other thing

305
00:28:37.440 --> 00:28:44.519
is hoisting. I like hoisting with
with the assignment. It's you know,

306
00:28:45.079 --> 00:28:52.079
it's not hoisted, and you can
get into trouble in unexpected scenarios. What

307
00:28:52.559 --> 00:28:59.440
do you think about exports dot foo
equals or exports being a stand in for

308
00:29:00.359 --> 00:29:07.279
the larger object people dot get name
equals, et cetera. I'm not sure

309
00:29:07.279 --> 00:29:11.720
I follow. Well. Most of
the time you have a function, it's

310
00:29:11.720 --> 00:29:15.680
not an object, right, so
you just no, not necessarily a lot

311
00:29:15.680 --> 00:29:21.720
of My code just has a lot
of exported functions. Not necessarily a lot,

312
00:29:21.799 --> 00:29:25.759
but uh, you know one or
more exported functions from a fire,

313
00:29:25.960 --> 00:29:29.799
from a module. Right. So
what I'm saying is you just assign the

314
00:29:29.839 --> 00:29:33.160
function to the object that gets exported. No, I use the export keyword.

315
00:29:37.480 --> 00:29:44.240
You can't so your then so you
can do structure. No, he's

316
00:29:44.319 --> 00:29:48.880
just using common JS. That's that's
the thing. It took me a moment

317
00:29:48.039 --> 00:29:52.119
to realize what he meant. But
even if it's not common JS, I

318
00:29:52.119 --> 00:29:56.279
mean just having you know, whatever
object you're exporting be the thing that you

319
00:29:56.319 --> 00:30:03.240
attached. The functions to, But
why why not just have export on the

320
00:30:03.480 --> 00:30:07.160
functions or on the identifiers as you
know, as you can these days in

321
00:30:07.240 --> 00:30:14.720
modern JavaScript. Well, because then
you have a lot it's just a lot

322
00:30:14.720 --> 00:30:17.599
more to parse. It's a lot
like if you try to grap through the

323
00:30:17.640 --> 00:30:22.960
code, it's a lot easier to
see the get name function attached to person

324
00:30:22.039 --> 00:30:26.839
than it is to see a bunch
of get name functions across the code base

325
00:30:26.880 --> 00:30:30.039
through the different you know, like
there's a get name in person, there's

326
00:30:30.039 --> 00:30:34.720
a get name and dog there's a
name. I get what you're saying things.

327
00:30:36.279 --> 00:30:37.599
Yeah, I get what you're saying. The way that I deal with

328
00:30:37.680 --> 00:30:41.880
it is, first of all,
that's the kind of the First of all,

329
00:30:41.920 --> 00:30:45.559
the reason that I like hoisting is
that I put the exported stuff at

330
00:30:45.559 --> 00:30:51.839
the top, so it's not as
if you're likely to you'll see something exported

331
00:30:51.920 --> 00:30:56.640
and then a lot of unexported stuff
and then another exported something you know as

332
00:30:56.640 --> 00:31:00.359
soon. So that's one thing.
Another sting, just to back up for

333
00:31:00.519 --> 00:31:04.079
people who are really new to JavaScript. So what hoisting does is if you

334
00:31:04.119 --> 00:31:08.960
declare a variable, it'll move it
to the top of your you know when

335
00:31:10.000 --> 00:31:12.680
it does it stuff, And that
way, you can put the exported stuff

336
00:31:12.720 --> 00:31:18.720
at the top. And since you
have by the property of hoisting, anything

337
00:31:18.759 --> 00:31:22.319
you don't declare lower that's going to
be used by the stuff you're exporting will

338
00:31:22.319 --> 00:31:26.240
get moved up above. Right,
it's available to the things at the top

339
00:31:26.480 --> 00:31:30.200
exactly you haven't declared it yet,
exactly, assuming you use a function keyword

340
00:31:30.640 --> 00:31:40.400
right. And so that's that's one. Another thing is that I tend to

341
00:31:40.480 --> 00:31:44.240
keep my module small, so it's
not as if I'm going to be exporting

342
00:31:44.279 --> 00:31:48.359
one hundred things out of the same
file. Again, unless it's like this

343
00:31:48.759 --> 00:31:53.880
special like you know, some people
like coalesce a lot of the exports like

344
00:31:55.079 --> 00:31:59.680
it into the like sort of an
index file at the root of a library

345
00:31:59.759 --> 00:32:02.480
or something, so to make it
easier to import things. But for most

346
00:32:02.519 --> 00:32:07.880
actual implementations, I don't export a
ton of stuff, So again you don't

347
00:32:07.920 --> 00:32:13.000
need to scan an entire and a
large amount of code just to find all

348
00:32:13.039 --> 00:32:17.000
the exports. So but but I
do get what you're saying, AJ there

349
00:32:17.079 --> 00:32:22.519
is merit in that, you know, if if if you're exporting something that

350
00:32:22.599 --> 00:32:27.799
looks that feels like an interface,
it makes sense to like put it all

351
00:32:28.079 --> 00:32:32.440
within an object or something. I
just just so you can see what's public

352
00:32:34.200 --> 00:32:37.240
at a glance, and when you
grap through the code, you can easily

353
00:32:37.319 --> 00:32:42.000
find like, show me everything,
show me all the methods that are exported

354
00:32:42.000 --> 00:32:45.960
from person at a glance, I
can just grab person dot right, and

355
00:32:46.039 --> 00:32:52.960
you also can get the potentially easier
completion. I don't use completion, but

356
00:32:53.160 --> 00:32:58.160
maybe so it takes too long to
pop up on the screen. I can

357
00:32:58.160 --> 00:33:02.519
finish typing it by the time we
did have a comment here, And I

358
00:33:02.519 --> 00:33:07.480
think it's an interesting kind of I
know you're talking about name functions here,

359
00:33:07.839 --> 00:33:14.720
but and I'm sorry if I butcher
your name. Bollogi, Ballage, Jaco.

360
00:33:14.920 --> 00:33:19.039
Anyway, he says good old function
every day all day. The only

361
00:33:19.079 --> 00:33:22.880
time I use the aero function are
in callback. So I guess the question

362
00:33:22.920 --> 00:33:29.680
that I'm aiming at here is do
you ever use aerow functions for a function?

363
00:33:30.079 --> 00:33:35.920
Or for sure the name implies the
describes their use. There are function

364
00:33:36.039 --> 00:33:44.440
expressions, so whenever I need a
function alambda effectively within an expression, I

365
00:33:45.039 --> 00:33:47.640
use arrows. So you know,
I'm a big fan, for example,

366
00:33:47.640 --> 00:33:53.359
of chaining, you know, using
stuff like map or filter, stuff like

367
00:33:53.400 --> 00:33:59.000
that, and in those you know, unless it's some sort of a reusable

368
00:33:59.079 --> 00:34:05.200
code or really complex let's say filter
that I you know, you probably don't

369
00:34:05.200 --> 00:34:09.079
want overly complicated filters and their functions
anyway, but if but otherwise, I

370
00:34:09.159 --> 00:34:15.239
definitely use function expressions there or lambdas, and then I definitely use arrows.

371
00:34:15.920 --> 00:34:20.199
I never, I never. You
know, you can use the function keyword

372
00:34:20.719 --> 00:34:23.159
for lambda's. You know, that's
the old that's the old school way of

373
00:34:23.239 --> 00:34:31.320
yeah, exactly, I I don't
do that, okay. So the problem

374
00:34:31.320 --> 00:34:38.119
with that, with the the lambda
expression style is that the opening and closing

375
00:34:38.159 --> 00:34:43.840
curly braces become ambiguous, and so
it's very difficult to tell whether you're returning

376
00:34:43.880 --> 00:34:49.239
an object or whether you're defining a
block. That's that's my beef there.

377
00:34:49.239 --> 00:34:52.039
I've had bugs pop up with that
multiple times. Yeah, it's always a

378
00:34:52.079 --> 00:34:54.599
block, and if you really want
it to be an object, you need

379
00:34:54.599 --> 00:35:01.440
to surround it in parentheses with yeah, so then it looks yeah anyway.

380
00:35:02.079 --> 00:35:10.760
Yeah. Yeah, So I'm I'm
hard against the implicit parentheses. Mhmm.

381
00:35:13.880 --> 00:35:16.679
Yeah, but again this has to
do with the whole expression thing that it's

382
00:35:16.880 --> 00:35:21.360
you know, but yeah, I
can see your point. You know,

383
00:35:21.440 --> 00:35:24.800
nothing's perfect moving on to the next
one. I was just I was just

384
00:35:24.920 --> 00:35:30.920
curious how people use you know,
how people write strings these days? Do

385
00:35:30.960 --> 00:35:36.199
they use single quotes, double quotes, backticks? What do they use for

386
00:35:36.280 --> 00:35:44.360
simple strings? And not surprisingly,
the majority prefer single quotes. It's not

387
00:35:44.440 --> 00:35:47.159
surprising to me because why press the
shift key when you don't have to.

388
00:35:50.960 --> 00:35:52.800
I looked at that one and I
was trying to decide why anybody cared.

389
00:35:54.199 --> 00:36:00.559
Oh, I was just curious.
You know you do you by the way,

390
00:36:00.639 --> 00:36:04.480
Interestingly, in the old days of
JavaScript, you know, like I'm

391
00:36:04.480 --> 00:36:08.480
talking like fifteen twenty years ago,
is I recall, most people did the

392
00:36:08.639 --> 00:36:15.199
double quotes, and it's and it's
kind of changed over the past decade or

393
00:36:15.280 --> 00:36:21.159
two from what I'm what I experienced. So I write the single quotes,

394
00:36:21.440 --> 00:36:23.800
but I commit the double quotes because
every time I write single quotes, it

395
00:36:23.840 --> 00:36:30.079
just gets transpiled to double quotes with
prettier. The reason for that is that

396
00:36:30.159 --> 00:36:35.880
in every other programming language, single
quotes are constants and double quotes are expressions.

397
00:36:36.480 --> 00:36:42.920
So I tend to only use single
quotes intentionally when it's something that is

398
00:36:43.400 --> 00:36:49.920
a constant value, and I use
double quotes in general because it's because usually

399
00:36:50.000 --> 00:36:58.480
you're doing expressions, you're not doing
constants. Well I'm not sure what you

400
00:36:58.599 --> 00:37:05.039
mean by expression versus constant really yeah, never mind, Yeah, I can't

401
00:37:05.079 --> 00:37:09.239
say. The difference is is that
you can interpolate within double quotes and you

402
00:37:09.360 --> 00:37:15.199
can't within single quotes. Yeah,
so Ruby double quotes are like the backticks,

403
00:37:15.400 --> 00:37:22.800
aren't they kind of like kind of
but yeah. But but the thing

404
00:37:22.920 --> 00:37:28.320
is is that people try to make
all kinds of arguments about like performance and

405
00:37:28.320 --> 00:37:30.280
stuff like that, and I just
haven't seen anything there the holds water.

406
00:37:30.920 --> 00:37:36.519
So that that's why I'm saying.
You know, if people look at it

407
00:37:36.559 --> 00:37:38.519
and they know it's a string,
then why why do you cat? I

408
00:37:38.559 --> 00:37:43.800
will make one more, the one
real. There are two reasons I initially

409
00:37:43.840 --> 00:37:49.599
when I got into JavaScript, I
initially tended to use double quotes. Was

410
00:37:49.719 --> 00:37:54.800
because I come from C C plus
plus and in those languages, double quotes

411
00:37:55.280 --> 00:38:01.719
are zero terminated or now terminated,
and single quotes are not. And usually

412
00:38:01.760 --> 00:38:07.400
you want the string to be no
al terminated usually. So yeah, now,

413
00:38:07.440 --> 00:38:15.400
the only vulnerabilities you definitely want the
exactly now the only comment. I'm

414
00:38:15.480 --> 00:38:21.119
not really surprised that hardly anybody chose
the backticks. The only thing that's kind

415
00:38:21.119 --> 00:38:25.840
of surprising about that is that we
will see later on people do like backticks

416
00:38:25.880 --> 00:38:32.800
for template expressions. Yes, and
uh. And it's kind of funny that

417
00:38:32.960 --> 00:38:37.880
you if a string becomes templatet and
a template expression, which it might,

418
00:38:38.360 --> 00:38:44.159
you need to change the quotes.
And then if it stops being a template

419
00:38:44.199 --> 00:38:47.920
expression for some reason, you need
to change the quotes again rather than just

420
00:38:49.079 --> 00:38:52.559
leave them as they are, which
works. So you could just use backticks

421
00:38:52.639 --> 00:38:57.800
everywhere, but apparently people don't like
that. Can't You can't? Actually,

422
00:38:58.199 --> 00:39:04.920
so why I was actually on full
backtick everywhere train for a while. You

423
00:39:05.000 --> 00:39:15.280
cannot use backticks for a key name. So if you were to an object

424
00:39:15.639 --> 00:39:22.320
and you put double quotes around you
know, name and then colon double quotes

425
00:39:22.639 --> 00:39:30.880
AJ, you cannot do backtick name
colon backtick AJ, you can't do that.

426
00:39:30.519 --> 00:39:35.719
And I think this just goes to
I. This is very confusing to

427
00:39:35.760 --> 00:39:40.360
me because we have a template syntax
for keys and an object, which is

428
00:39:40.400 --> 00:39:45.400
to put square brackets around it,
and to me it seems I guess they

429
00:39:45.400 --> 00:39:51.280
were standardized at different times, Like
why this is seems redundant? And silly.

430
00:39:51.920 --> 00:39:53.800
We should just be able to use
the backticks as the template expression,

431
00:39:53.840 --> 00:39:59.440
but instead, if it's an object
key, the template expression is you put

432
00:39:59.440 --> 00:40:06.840
brackets aroun round the variable name.
Another interesting thing is that JSON uses double

433
00:40:06.920 --> 00:40:10.199
quotes. Yes, that's sewn me
off before more times, and I care

434
00:40:10.280 --> 00:40:17.320
you remember. Yeahah, I think
everybody NPM install fixed Jason, and it'll

435
00:40:17.400 --> 00:40:22.519
usually get picked up by your editor
automatically. And then when you're editing Jason

436
00:40:22.559 --> 00:40:24.559
and you put a single quote by
mistake, it'll just swap it to double

437
00:40:24.599 --> 00:40:29.960
quotes. It'll also deal with the
trailing commas and stuff like that. Yeah,

438
00:40:29.960 --> 00:40:34.239
that's the other annoying thing. So
my rule DAN is generally default to

439
00:40:35.119 --> 00:40:38.760
single quotes everywhere double quotes if I
have to quote something inside a single quote,

440
00:40:38.800 --> 00:40:45.480
like say an attribute inside of a
template like an abuse single file component

441
00:40:45.639 --> 00:40:50.000
in the template portion, and then
the only time I ever find myself using

442
00:40:50.000 --> 00:40:52.119
backticks is when I needed to do
a template string. And the example that

443
00:40:52.159 --> 00:40:57.599
I've been using a lot lately is
if I'm defining a poster at get url

444
00:40:58.840 --> 00:41:02.280
within my view component and it requires
a dynamic value like an ID value,

445
00:41:02.639 --> 00:41:06.079
you know, as part of the
string or something dynamic, and I use

446
00:41:06.119 --> 00:41:09.719
the backtick with the dollar sign curly
brackets around it. But general rule is

447
00:41:09.960 --> 00:41:15.119
single unless I have to otherwise.
So the vast majority agree with you,

448
00:41:15.119 --> 00:41:20.559
Steve. And that also exactly goes
to the next question on my list,

449
00:41:20.920 --> 00:41:28.760
which was about building a string from
a static value and the dynamic value.

450
00:41:28.840 --> 00:41:35.119
So would you write greet equals hello
plus name or greet equals backtick hello,

451
00:41:35.519 --> 00:41:40.639
dollar curly bracket, name, curly
bracket. And it's amazing to see how

452
00:41:40.800 --> 00:41:46.400
popular template strings have become. You
know, people have told me that it's

453
00:41:46.400 --> 00:41:52.559
not really surprising because most default y
lint rules or linting rules. Now we

454
00:41:52.719 --> 00:41:57.679
kind of enforced this approach so people
really got used to it. But still

455
00:41:58.400 --> 00:42:04.440
it's interesting that so many people just
prefer to use the template the template literals.

456
00:42:04.679 --> 00:42:07.840
Well, it makes sense. It
makes sense because basically you're not switching

457
00:42:07.880 --> 00:42:10.920
in and out of your of your
context. You don't have to do like

458
00:42:12.159 --> 00:42:17.840
hello plus space plus string, variable
plus comment and quotes. But you know,

459
00:42:17.880 --> 00:42:22.039
in this you can just do it
all in one fell swoop with having

460
00:42:22.039 --> 00:42:27.280
to switch context like that. Well, and in my opinion, it's easier

461
00:42:27.320 --> 00:42:32.360
to parse because the plus with the
quotes, it blends into one line more

462
00:42:32.400 --> 00:42:37.559
easily. The dollar bracket stands out
more and so you know where you're sticking

463
00:42:37.639 --> 00:42:42.719
dynamic values into that sucker. Yeah, and my at least in might id

464
00:42:42.920 --> 00:42:45.679
and I'm assuming I use PHP storm. I'm assuming it does the most.

465
00:42:45.320 --> 00:42:50.800
It will highlight those colors, highlights
your template strings, and they stand out

466
00:42:50.800 --> 00:42:54.760
more easily. So I know exactly
what I did. And that's always my

467
00:42:54.920 --> 00:43:00.400
issue is how can I make it
easier for future me or some other idiot,

468
00:43:00.400 --> 00:43:05.239
But it's usually future meet. It's
the idiot right to look at this

469
00:43:05.320 --> 00:43:09.679
and go, oh, I can
easily see what's going on here. Yeah,

470
00:43:09.719 --> 00:43:15.639
and the vast majority agree with you, like eighty eight point four percent.

471
00:43:16.000 --> 00:43:22.400
Yes, AJ. So what convinced
me on this? Because I've gone

472
00:43:22.599 --> 00:43:25.880
every which way with the template strings
unfortunately, because there's no consistent way to

473
00:43:27.000 --> 00:43:30.400
use them, Like I wish that
there was a consistent way to use them,

474
00:43:30.400 --> 00:43:34.039
but there's an edge case where they
don't work. No, like,

475
00:43:34.400 --> 00:43:38.119
no matter which style of coding you
prefer, that like you just run into

476
00:43:38.559 --> 00:43:43.920
something where you can't you can't be
consistent in the way you use strings in

477
00:43:44.000 --> 00:43:50.280
jonascript. But three sixty five JS
things, which is well, I guess

478
00:43:50.280 --> 00:43:52.239
the Twitter handle is actually at unique
name, but this is Corey Brown.

479
00:43:53.719 --> 00:44:02.679
He made the argument that it's easier
for you and the interpreter because you don't

480
00:44:02.719 --> 00:44:09.400
have to worry about order of operations
errors or concatenation type changes. So if

481
00:44:09.480 --> 00:44:15.199
you think putting the two things inside
the template string, you know they're both

482
00:44:15.239 --> 00:44:17.239
going to be strings. So if
one happens to be a number and the

483
00:44:17.280 --> 00:44:22.440
other happens to be a number,
if you use plus, but you were

484
00:44:22.519 --> 00:44:25.079
thinking that you were assigning a string, you're actually you know, I mean,

485
00:44:25.079 --> 00:44:28.760
that's kind of a weird case.
But still, I mean weird cases

486
00:44:28.760 --> 00:44:30.880
are what where the rugs come from? I know. And by the way,

487
00:44:31.039 --> 00:44:36.360
one of the most like if if
I could have gone back in time

488
00:44:36.440 --> 00:44:42.880
and whispered on berendan Ike's years back
when he was creating JavaScript, one of

489
00:44:42.920 --> 00:44:45.719
the things that I would have suggested
to him would have been to use a

490
00:44:45.760 --> 00:44:52.599
different operator for audition versus concatenation of
strings. Yeah, and this gives you

491
00:44:52.639 --> 00:45:00.440
that this, so that's yeah,
effectively it does. Yeah. Okay,

492
00:45:00.440 --> 00:45:04.199
moving on to the next one,
where now we're entering a new topic,

493
00:45:04.360 --> 00:45:08.079
which is array processing. So I
asked a bunch of questions about, you

494
00:45:08.119 --> 00:45:13.880
know, the ways in which people
work with arrays. And the first question

495
00:45:14.119 --> 00:45:17.920
is kind of like the most basic
one, and which is, how would

496
00:45:17.960 --> 00:45:24.639
you iterate over an array in the
scenario where you're you kind of you know,

497
00:45:24.719 --> 00:45:29.199
in the side effect scenario. So
forget, for example, about something

498
00:45:29.320 --> 00:45:32.079
like a map or a filter.
Let's say I want to log all the

499
00:45:32.199 --> 00:45:37.719
values of an array, or I
want to send over the network all the

500
00:45:37.800 --> 00:45:40.239
values of an array, or I
want to add to the dom all the

501
00:45:40.320 --> 00:45:45.079
values of an array or something like
that. How would you iterate over the

502
00:45:45.199 --> 00:45:51.119
array? The first option is the
old school one, which is, you

503
00:45:51.119 --> 00:45:55.239
know, I equals zero ie less
than a dot length I plus plus.

504
00:45:57.039 --> 00:46:02.039
The next one is more modern use
of four of you know, it might

505
00:46:02.119 --> 00:46:07.920
be four cons to v of A
And the last one is the dot for

506
00:46:08.159 --> 00:46:15.719
each and it depends what you want
to do. Oh, by the way,

507
00:46:15.880 --> 00:46:23.000
is an area like an array?
Just kidding you? So yeah,

508
00:46:23.039 --> 00:46:30.119
it's interesting. I generally like to
use four each. I guess the caveat

509
00:46:30.159 --> 00:46:35.400
here, DAN is what you're trying
to do as compared to something like a

510
00:46:35.480 --> 00:46:37.800
map or filter. Right, you
just want to do something twitter item is

511
00:46:37.840 --> 00:46:44.440
you don't necessarily want to filter out
certain items or only extract certain items from

512
00:46:44.559 --> 00:46:47.960
Yeah, as I said before,
I like chaining, so when I can

513
00:46:49.159 --> 00:46:54.920
chain stuff, I usually go for
chaining. But I explicitly wanted to look

514
00:46:54.960 --> 00:47:04.360
at the scenario where you're just looping
over the u an array and just doing

515
00:47:04.440 --> 00:47:07.039
something with the values, like I
said, maybe sending them over the network,

516
00:47:07.199 --> 00:47:12.119
or or adding them to the dom
or something like that. I've seen

517
00:47:12.199 --> 00:47:19.639
arguments that for each is performance inhibitive. But it's funny some of those arguments

518
00:47:19.679 --> 00:47:21.960
I see. They say, well, there are a performance here and here,

519
00:47:21.960 --> 00:47:24.440
but the difference is like microscopic.
First of all, First of all

520
00:47:24.480 --> 00:47:29.760
the different First of all, let's
say this, I'll be surprised or shocked

521
00:47:30.199 --> 00:47:36.000
if that's the actual performance issue in
your code, and it is, you

522
00:47:36.039 --> 00:47:38.320
know, prove it to me with
a profiler. That's point number one.

523
00:47:38.639 --> 00:47:44.639
Point number two is I can't think
of scenarios in which four each would actually

524
00:47:44.719 --> 00:47:52.199
have better performance. Because JavaScript,
the JavaScript engines actually optimize functions as a

525
00:47:52.239 --> 00:47:57.800
whole in most cases, so they
either optimize the entire function or they don't

526
00:47:57.840 --> 00:48:04.360
optimize the entire function. With each
they can optimize the function being invoked in

527
00:48:04.519 --> 00:48:08.559
the function expression being invoked inside the
four each, even if for some reason

528
00:48:08.599 --> 00:48:15.880
they cannot it optimize the containing function. And in that scenario, you'll actually

529
00:48:15.920 --> 00:48:22.440
get the optimization of the code called
on each iteration sooner or faster or more

530
00:48:22.440 --> 00:48:27.360
easily than with the others. So
here's a scenario where that one might actually

531
00:48:27.559 --> 00:48:32.880
execute faster. But again, I
highly doubt that that will be the performance

532
00:48:32.920 --> 00:48:37.559
bottleneck in your code either way.
So it's very much more of a stylistic

533
00:48:37.639 --> 00:48:43.400
choice than anything else. Yeah,
I just want to chime in here because

534
00:48:43.400 --> 00:48:46.119
this was the debate in the Ruby
community between the single quotes and the double

535
00:48:46.199 --> 00:48:52.480
quotes. If somebody did the profiling
and it was like a twenty pcos second

536
00:48:52.880 --> 00:48:55.000
difference, right, and so they
were saying, see, it's more performant,

537
00:48:55.000 --> 00:48:58.880
and I was just like, so
what you're telling me is I could

538
00:48:58.880 --> 00:49:01.480
just keep being lazy and I'm gonna
add twenty pico seconds here or there to

539
00:49:01.519 --> 00:49:05.039
my code. Okay, great,
I'm just going to keep using the whole

540
00:49:05.119 --> 00:49:12.840
quotes. So what you guys prefer, which which approach to you would you

541
00:49:12.920 --> 00:49:16.519
take? I use four each whenever
I can, I I got on the

542
00:49:16.559 --> 00:49:23.559
four each bus early, but then
when promises were introduced, I'm not when

543
00:49:23.599 --> 00:49:27.360
a sink await was introduced, eventually
I had to get off the four each

544
00:49:27.400 --> 00:49:31.599
chasing or the for each bus because
then you you you end up with this

545
00:49:31.679 --> 00:49:35.719
what color is your fore loop and
I just don't want to deal with it.

546
00:49:35.760 --> 00:49:38.880
So I've stopped using four each map
filter all it just like I've thrown

547
00:49:38.920 --> 00:49:45.199
it all away because it's just not
worth the the overhead of having to go

548
00:49:45.280 --> 00:49:49.440
back and refactor code for something that
is I mean it's one line anyway.

549
00:49:52.000 --> 00:49:58.199
Just just saying, yeah, just
saying that once a sink iterator for helpers

550
00:49:58.639 --> 00:50:04.000
hit the language, whenever they finally
do you sorry, you get in there,

551
00:50:04.760 --> 00:50:07.519
yeah, and now you need to
stop. Well it had it on

552
00:50:07.599 --> 00:50:14.199
looping, yeah, and looping is
the topic. All I was saying is

553
00:50:14.239 --> 00:50:22.039
that if and when perfectly timed,
that's the best one of all ten year

554
00:50:22.119 --> 00:50:30.039
run. Uh. If and when
sync iterator helpers actually land in JavaScript AJ,

555
00:50:30.239 --> 00:50:32.880
then you would be able I don't
know if you want to, but

556
00:50:32.960 --> 00:50:43.840
you would be able to go back
to those US iteration methods. But yeah,

557
00:50:43.840 --> 00:50:46.239
you can start doing it right again. It'd be hard it'd be hard

558
00:50:46.280 --> 00:50:52.599
to get me back on that bus
because iterators introduce their own set of problems.

559
00:50:52.639 --> 00:50:57.800
Somebody needs to go through the the
twelve different standard bodies that govern JavaScript

560
00:50:58.159 --> 00:51:00.880
and just come out with like a
unified standard of javascripts so that we have

561
00:51:00.960 --> 00:51:07.920
one language, not a language,
and six implementations by different committees that don't

562
00:51:07.920 --> 00:51:12.320
communicate with each other. And I
think that's what Winter CG is trying to

563
00:51:12.320 --> 00:51:17.159
do. Well. No, Winter
Winter Oh, that's not exactly the case.

564
00:51:17.400 --> 00:51:22.320
You know, it's an aside.
Winter CG is about the library code,

565
00:51:22.360 --> 00:51:25.320
so it's about the fetch and stuff
like that, not things that are

566
00:51:25.400 --> 00:51:30.639
actually part of the language. So
part of the language itself is still owned

567
00:51:30.719 --> 00:51:35.599
by TC thirty nine and will continue
to be there, but we kind of

568
00:51:35.599 --> 00:51:38.760
deviated. I have to say that
I was kind of surprised that more people

569
00:51:39.199 --> 00:51:45.760
preferred four of over four each.
It was pretty close. It's forty two

570
00:51:45.800 --> 00:51:51.559
percent versus forty point five percent,
so it's kind of neck and neck,

571
00:51:52.920 --> 00:51:58.760
but you know, it still surprised
me. I was expecting far fewer people

572
00:51:58.800 --> 00:52:02.440
to actually use four all. I'm
guessing aj that it's probably because of the

573
00:52:02.519 --> 00:52:07.320
reason that you mentioned. You know, people really like a sink of weight,

574
00:52:07.880 --> 00:52:13.440
and it's much easier to use them
with the four of rather than four

575
00:52:13.519 --> 00:52:21.079
each. Uh. And I am
happy that people are ditching four I,

576
00:52:21.320 --> 00:52:25.920
although you know, eighteen percent using
it is still a lot simply because it's

577
00:52:27.639 --> 00:52:30.159
it's too much, it's tmi,
it's you know, it's it's why are

578
00:52:30.280 --> 00:52:36.440
you in the nitty gritty of you
know, the index and whatnots teaching your

579
00:52:36.440 --> 00:52:39.480
computer science class. But this is
again, this goes this goes back to

580
00:52:39.719 --> 00:52:45.199
a lack of foresight in these committees. Right, most languages that have an

581
00:52:45.239 --> 00:52:52.840
iterator construct it would be four K
com a V of A. You can

582
00:52:52.880 --> 00:52:55.679
actually do that here. You can
actually kind of do that. You can

583
00:52:55.679 --> 00:53:00.960
do constant v let's say v I
of n trees, so you can have

584
00:53:01.000 --> 00:53:07.639
both the key and the value.
Okay, so you can't do four you

585
00:53:07.679 --> 00:53:16.840
do a constant open square brackets key
comma value of a dot entries. I'm

586
00:53:16.880 --> 00:53:21.239
gonna have to try because Yeah.
The reason that I do revert back to

587
00:53:21.280 --> 00:53:28.000
the I plus equals one loop is
because there are occasions where I need access

588
00:53:28.039 --> 00:53:34.639
to the index for some reason.
Sometimes it's modifying the original array. Sometimes

589
00:53:34.800 --> 00:53:38.960
it's so so instead of keys,
you use the you use entries that returns

590
00:53:40.000 --> 00:53:45.960
a sequence of arrays of like well
tuples where you've got like the first is

591
00:53:46.039 --> 00:53:51.199
the key and then the value.
Uh, and then you destructure them into

592
00:53:51.360 --> 00:53:58.599
a key and into a key and
of value. Okay, I I might

593
00:53:58.719 --> 00:54:00.840
play with it, but I I
just have a sense that something will go

594
00:54:00.840 --> 00:54:07.079
wrong there. The one more important
thing to mention, of course, is

595
00:54:07.119 --> 00:54:13.599
that four of is not that well. Let's put it this way. All

596
00:54:13.679 --> 00:54:17.559
three actually do a different thing.
So they're used for the symp for the

597
00:54:17.639 --> 00:54:22.599
same purpose or the very similar purpose, but each one really does a different

598
00:54:22.639 --> 00:54:29.440
thing. Four I literally you know, goes over all the values from zero

599
00:54:29.519 --> 00:54:36.800
to lengths. Four of actually uses
an iterator, so it's syntactic sugar for

600
00:54:36.960 --> 00:54:39.239
iterator, which is why A doesn't
need to be an ara. It can

601
00:54:39.280 --> 00:54:45.320
be anything which exposes an iterator.
It could be a map or a set

602
00:54:45.639 --> 00:54:50.079
or whatnot. Okay, yeah,
because it's not intuitive when it works and

603
00:54:50.079 --> 00:54:52.000
when it doesn't, I always convert
things to a raise before using it,

604
00:54:52.000 --> 00:54:55.320
because I thought it worked in a
case where the thing was an object.

605
00:54:55.400 --> 00:55:00.760
But then it works in the case
so that where A is an object,

606
00:55:00.800 --> 00:55:07.719
assuming A is an object that has
an iterator. Yeah, and for each

607
00:55:07.480 --> 00:55:13.960
depends on what the implementation of for
each is on that object. You can,

608
00:55:14.239 --> 00:55:20.039
you know, so if it's standard
javascripts. Yeah, again, as

609
00:55:20.039 --> 00:55:22.360
I'm saying, you know, I
was saying, they effectively do the same

610
00:55:22.440 --> 00:55:28.639
thing in most cases. It's just
important to understand that the implementation is different.

611
00:55:30.239 --> 00:55:35.480
Well to the point of iterators.
They feel like, I guess metaprogramming.

612
00:55:35.719 --> 00:55:40.360
It's but that's the thing. But
that's the argument we keep having a

613
00:55:40.639 --> 00:55:46.239
j I totally agree that iterators kind
of failed in JavaScript in that nobody explicitly

614
00:55:46.360 --> 00:55:53.320
uses iterators in JavaScript, but everybody, but everybody uses iterators implicitly in JavaScript.

615
00:55:53.320 --> 00:55:55.440
First of all, as you can
see, almost half the people use

616
00:55:55.519 --> 00:56:00.800
four all, which is built on
top of iterators. Everybody he uses the

617
00:56:00.840 --> 00:56:07.039
spread operator, which is built on
top of iterators. So everybody's using iterators

618
00:56:07.079 --> 00:56:12.719
without thinking about the fact that it's
iterators under the hood. Sure, but

619
00:56:14.519 --> 00:56:20.480
you don't, okay, so,
but promises you If you're using a sync

620
00:56:20.519 --> 00:56:27.039
and await without knowing the how promises
work, you're probably creating bugs in your

621
00:56:27.079 --> 00:56:34.880
code or otherwise doing it wrong.
The iterator stuff. Thankfully, you don't

622
00:56:35.440 --> 00:56:42.079
have to have ever used an iterator
explicitly to use the spread operator. I

623
00:56:42.239 --> 00:56:46.000
totally agree, and that's a good
thing because iterators iterators were meant to be

624
00:56:46.199 --> 00:56:52.519
used explicitly by library creators. Library
It's like, you know, it's like

625
00:56:52.639 --> 00:56:57.159
as a library user, you just
get a nicer interface to the code and

626
00:56:57.239 --> 00:57:00.639
you don't need to think about how
it actually works on the inside. Yeah.

627
00:57:02.920 --> 00:57:06.760
Anyway, moving on to the next
one, which is kind of related,

628
00:57:07.639 --> 00:57:10.679
it's about how do you concatenate two
arrays. The two options are again

629
00:57:10.920 --> 00:57:19.280
either go old school and use the
concat methods. Yeah, you can see

630
00:57:19.280 --> 00:57:24.280
it here here it is, which
is Garcius. So you can either do

631
00:57:24.679 --> 00:57:30.800
like A equals B concat C,
or you can do the new spread thing,

632
00:57:30.960 --> 00:57:36.559
which is A equals open square brackets
three dots B comma three dot C

633
00:57:36.840 --> 00:57:44.840
closed square brackets. So again,
the code is not the same, and

634
00:57:44.920 --> 00:57:49.719
there are various edge cases in which
the code can behave really differently. For

635
00:57:49.880 --> 00:57:59.360
example, what happens if C is
not an array, But you know in

636
00:57:59.519 --> 00:58:01.559
most case is when A, B
and CR are all of them. When

637
00:58:01.639 --> 00:58:08.119
B and C are raised, the
results of the same. So it's it's

638
00:58:08.199 --> 00:58:14.280
interesting to see, you know,
what people use and it's interesting to see

639
00:58:14.320 --> 00:58:17.760
that most people eighty percent, almost
eighty percent of the people these days now

640
00:58:17.920 --> 00:58:24.559
prefer the spread operators inside square brackets
the deep side. I love it.

641
00:58:27.719 --> 00:58:31.320
I heard somebody give a deep sigh. Yeah, yeah, Why am I

642
00:58:31.400 --> 00:58:39.280
not surprised? Why are you?
Why? Why are you signing AJ for

643
00:58:39.400 --> 00:58:44.960
a couple of things again? Committees
and every other language. If you're doing

644
00:58:45.039 --> 00:58:49.800
a spread, the spread is on
the right side, not the left side.

645
00:58:49.840 --> 00:58:53.480
That is a collect The dots on
the left side are a collector.

646
00:58:53.800 --> 00:58:59.960
The dots on the right side are
a spreader. Okay, synax a side.

647
00:59:00.159 --> 00:59:06.559
It just is so much more complicated, Like I don't get the preference

648
00:59:07.280 --> 00:59:12.440
for people to use symbols over words
when the words are more clear to the

649
00:59:12.559 --> 00:59:16.000
most casual of observer. Right,
you do open bracket clothes, bracket dot

650
00:59:16.079 --> 00:59:20.320
can cat, B, comm a
se, which is an option you didn't

651
00:59:20.360 --> 00:59:24.599
list there. But that's the way
I actually do it. Just sorry,

652
00:59:25.079 --> 00:59:29.559
just just a new array dot can
cat and then b and then ce.

653
00:59:30.360 --> 00:59:35.519
Okay. But it's just it's just
so much more explicit, it's easier to

654
00:59:35.639 --> 00:59:42.199
read, and and just I just
see so much code that's like aero symbol

655
00:59:42.480 --> 00:59:50.960
brackets dots, and it just it's
really difficult because people people it's line noise,

656
00:59:51.280 --> 00:59:54.960
that's what you're saying. Line noise. Sure, And and so there's

657
00:59:54.960 --> 01:00:00.719
a lot of JavaScript that ends up
looking like pearl because it's just like arrows

658
01:00:00.880 --> 01:00:05.199
dots, and you know, just
like one thing after the other. And

659
01:00:06.280 --> 01:00:10.639
I'm looking at I don't know,
five lines of code that probably should be

660
01:00:10.760 --> 01:00:16.599
fifteen, trying to figure out what
the does this even do it it's worth

661
01:00:17.000 --> 01:00:22.000
By the way, I had an
interesting conversation about this with Evata we've had

662
01:00:22.559 --> 01:00:27.800
from Meta, We've had on the
show. He spoke about the vest testing

663
01:00:27.920 --> 01:00:34.039
library, and he actually prefers concat, and there are two reasons that he

664
01:00:34.199 --> 01:00:38.519
gave. One is that concat works
well with chaining, which he likes.

665
01:00:39.920 --> 01:00:45.039
Now, of course you can add
stuff after the closing square brackets, you

666
01:00:45.119 --> 01:00:51.079
can change stuff there, but then
the chaining looks less natural because you got

667
01:00:51.159 --> 01:00:53.840
some of the chain inside the brackets
and then some of the chain after the

668
01:00:53.920 --> 01:00:59.920
brackets. And the other reason that
he liked it, which I'm more ambivalent

669
01:01:00.079 --> 01:01:05.920
about, and I told him so, is that concat works when c is

670
01:01:06.039 --> 01:01:12.079
of value rather than a collection that's
bad, that's not good. That's what

671
01:01:12.239 --> 01:01:16.960
I think. But he likes it. Yeah. I have gotten a little

672
01:01:17.000 --> 01:01:28.199
bit scared sometimes because of concat Yeah, not knowing how it will interpret something,

673
01:01:28.199 --> 01:01:30.559
because I want the error in that
case right, Like I want to

674
01:01:30.599 --> 01:01:35.239
be like, oh, you you
have done you put the wrong variable in

675
01:01:35.320 --> 01:01:37.719
here. By the way, once
we get through a race, we should

676
01:01:37.760 --> 01:01:45.360
probably call it an episode. Yeah, for sure, So let's speed things

677
01:01:45.440 --> 01:01:47.639
up. We've got two more things
about arrays, which is great. You

678
01:01:47.719 --> 01:01:52.119
know, we've got things for next
time, and I'll probably have you know,

679
01:01:52.639 --> 01:01:57.280
by the way, if either you
or the listeners have ideas about you

680
01:01:57.360 --> 01:02:00.599
know, additional such polls that I
should run, I'd be more than happy

681
01:02:00.719 --> 01:02:05.000
to if you just send me a
link, you know, either DM me

682
01:02:05.519 --> 01:02:08.039
or send me by the way to
all our listeners. You know, if

683
01:02:08.119 --> 01:02:15.800
you're not following us on Twitter,
why you know, I'm Dance Shapee on

684
01:02:15.880 --> 01:02:20.840
Twitter exactly, I'm just Dance Shapiro
on Twitter. You know, follow me.

685
01:02:21.079 --> 01:02:23.440
I'll probably follow you back, and
you know we can all be friends.

686
01:02:23.840 --> 01:02:29.159
You like me here on the podcast, you you'd probably like me just

687
01:02:29.239 --> 01:02:34.239
as much on X anyway, moving
to the next to the next one,

688
01:02:35.039 --> 01:02:38.679
it's how to get the last item
of an array. So again we've got

689
01:02:38.760 --> 01:02:43.960
the old school approach, which is, uh, you know, just use

690
01:02:44.079 --> 01:02:50.840
the dot length minus one inside the
square brackets. Uh. Then we've got

691
01:02:51.840 --> 01:02:55.039
I'll go to the other extreme.
We've got the latest and greatest, which

692
01:02:55.199 --> 01:03:02.199
is the at method, and the
works exactly like an index, only it

693
01:03:02.320 --> 01:03:09.559
also supports negative values, so exactly
exactly like slice. So you know,

694
01:03:09.880 --> 01:03:16.719
doing an act at minus one gives
you the last value. By the way,

695
01:03:17.280 --> 01:03:27.800
I am slightly miffed that it's minus
one rather than minus zero. So

696
01:03:28.039 --> 01:03:30.559
zero based going one way and one
based going the other. Is that what

697
01:03:30.639 --> 01:03:35.880
you're saying. Yeah? And by
the way, JavaScript does have the concept

698
01:03:35.960 --> 01:03:42.320
of a minus zero as an almost
distinct value from zero. Yeah. This

699
01:03:42.599 --> 01:03:47.360
is one of the underscore versus low
dash things. This low dash handles negative

700
01:03:47.440 --> 01:03:55.960
zero perspec so so yeah, but
anyway, it isn't so the last item

701
01:03:57.079 --> 01:04:02.000
is minus one rather than minus zero. And the and the the kind of

702
01:04:02.039 --> 01:04:05.239
the middle of the road is to
do, uh, is to use the

703
01:04:05.360 --> 01:04:10.480
dot slice, which supported minus one
from way back when. Uh. And

704
01:04:10.639 --> 01:04:15.440
then you can just destructure the result
because the slice returns an array, so

705
01:04:15.559 --> 01:04:18.679
it was like zero. If you
don't want your code to look weird.

706
01:04:19.320 --> 01:04:27.360
Yeah, and uh, I like
slice. Yeah. It's the only downside,

707
01:04:27.400 --> 01:04:30.239
of course, is we were talking
overhead in the Pico seconds. It

708
01:04:30.400 --> 01:04:34.880
actually allocates an array and and copies
into that array. So there is a

709
01:04:34.960 --> 01:04:39.719
slight edition of my memory allocation.
Yeah, exactly, it's gonna be a

710
01:04:39.800 --> 01:04:43.800
tiny bit bigger. You know,
I've always used slice, I haven't used

711
01:04:43.880 --> 01:04:45.400
AT, but just looking at the
code, to me, it makes more

712
01:04:45.480 --> 01:04:49.800
sense. I like that. Yeah, looking at the difference between slice and

713
01:04:49.880 --> 01:04:56.920
splice and and uh yeah, and
AT is pretty much universally supported these days.

714
01:04:57.320 --> 01:05:00.760
It's it's obviously Node, the this
version of Node, and I think

715
01:05:00.840 --> 01:05:05.960
all the all the browsers now support
it. So it just works even if

716
01:05:06.000 --> 01:05:13.920
you don't use some transportations a step
or whatnot. But it's interesting to see

717
01:05:13.960 --> 01:05:19.039
that the majority of people fifty five
percent still go old school, but they

718
01:05:19.079 --> 01:05:24.840
don't know about it. They're finding
out about it today on this podcast.

719
01:05:25.039 --> 01:05:28.119
Yeah, or when they say yeah, but I get I gave the option

720
01:05:28.280 --> 01:05:30.320
on the poll. They could have
said, hey, that's cool, I

721
01:05:30.400 --> 01:05:32.760
don't use it, but I'll start
using it today and they yeah, But

722
01:05:32.800 --> 01:05:35.960
then they would have still answered the
pole honestly. Ah, yeah, okay,

723
01:05:38.280 --> 01:05:47.119
maybe maybe yeah, I'm I'm I'm
with with the act, but but

724
01:05:47.360 --> 01:05:53.280
yeah, uh, it's not complicated. It's easy to understand. The only

725
01:05:53.440 --> 01:05:58.159
potential downside that I see if it's
not an actual array but rather an array

726
01:05:58.360 --> 01:06:02.320
like object, you know, those
abominations. But other than that, you

727
01:06:02.400 --> 01:06:06.599
know, just use that so weird
thing. AT is not on Can I

728
01:06:06.760 --> 01:06:14.079
Use? Are you sure you can't
search for it? Probably because it's a

729
01:06:14.119 --> 01:06:17.400
two letter search term. I'm trying
to see if I can get it.

730
01:06:17.639 --> 01:06:23.960
Not it is not there. AT
is not on Can I Use? So,

731
01:06:24.360 --> 01:06:27.840
but I have started using AT for
my node code because now it's gotten

732
01:06:27.880 --> 01:06:31.320
mature enough in node that I feel
comfortable using it. Last time we had

733
01:06:31.639 --> 01:06:35.519
mentioned it on the show. It
I don't think that it had been in

734
01:06:36.719 --> 01:06:42.119
an LTS release yet or something like
that, but I believe that now it

735
01:06:42.280 --> 01:06:46.880
actually has been in an LTS release, so it's mature enough. But I'm

736
01:06:46.920 --> 01:06:50.159
not sure on the browser side if
browser's actually support it yet or not.

737
01:06:51.480 --> 01:06:57.880
Oh, browsers too, you know
what, Oh, I found it.

738
01:06:58.000 --> 01:07:00.920
I found it on Can I Use. It's just it's it's weird. Okay,

739
01:07:01.000 --> 01:07:06.440
Yeah, So basically it doesn't work
on any of the Asian browsers,

740
01:07:06.559 --> 01:07:15.039
So qqby do coos doesn't work on
the WIU or on feature phones on Android.

741
01:07:15.840 --> 01:07:17.599
Yeah, but you'll probably use it
built when you built for those,

742
01:07:17.719 --> 01:07:24.159
you probably use a transpolation. Then
you're fine. Well, but if you

743
01:07:24.199 --> 01:07:29.000
don't want to use transporlation, if
your target is people on feature phones,

744
01:07:29.079 --> 01:07:35.159
meaning non paying customers or Asians,
then you don't want to use it unless

745
01:07:35.159 --> 01:07:40.440
you dresspile. Okay, and now
moving on to the last question of the

746
01:07:40.519 --> 01:07:44.559
day, the last question in the
ARA category. This one is slightly contrived,

747
01:07:44.920 --> 01:07:49.719
or more than slightly, but still
it was interesting. Let's say you

748
01:07:49.920 --> 01:07:57.679
want an array where the values match
the index the index values, so it

749
01:07:57.760 --> 01:08:00.079
would be an era with the value
zero, one, two, three,

750
01:08:00.199 --> 01:08:04.760
four all the way up to nd
or what that. So there, how

751
01:08:04.840 --> 01:08:12.280
would you create this in uh in
your code? And and it does come

752
01:08:12.400 --> 01:08:15.720
up, you know, I've I've
I've run into this scenarios where you want

753
01:08:15.800 --> 01:08:20.319
it, and it's kind of annoying
that the there there's no easy way to

754
01:08:20.399 --> 01:08:25.279
get it, although in the spec
they are working towards something and we can

755
01:08:25.399 --> 01:08:31.319
mention it at the end. But
the options that I gave are using.

756
01:08:31.520 --> 01:08:35.319
It's you know, I'll basically be
reading out code. It's easy using using

757
01:08:35.560 --> 01:08:42.119
RA a dot from where you can
provide it with two arguments. One is

758
01:08:42.239 --> 01:08:46.199
just an object with the length property
that you you know, whatever your end

759
01:08:46.359 --> 01:08:49.399
that you want to go up to, and the other is kind of a

760
01:08:49.560 --> 01:08:56.319
map function that you can provide this
as an optional second argument to the from

761
01:08:56.920 --> 01:09:01.239
and you can use it to actually
fill in the values into the array that

762
01:09:01.359 --> 01:09:09.560
you're generating. So that's option number
one. Option number two is to create

763
01:09:11.880 --> 01:09:16.159
you know, you might call it
an empty array of length n by just

764
01:09:16.359 --> 01:09:21.079
using the array constructor with the value
n. Then use the dot fill to

765
01:09:21.159 --> 01:09:25.439
actually fill it with something, because
it so that it won't be empty,

766
01:09:25.920 --> 01:09:29.640
so you can fill it with zeros. And then you can use the map

767
01:09:30.119 --> 01:09:35.560
to actually put the indexes into the
array. And then finally there's the old

768
01:09:35.560 --> 01:09:42.760
school approach of just using whatever loop
construct you prefer with a push to push

769
01:09:42.880 --> 01:09:49.760
the values into what was initially an
empty array. So yeah, and interestingly,

770
01:09:50.560 --> 01:09:58.560
it kind of split almost well almost
equally between all those between these three

771
01:09:58.640 --> 01:10:04.880
options. Interestingly, ay from is
in the lead, which kind of surprised

772
01:10:04.920 --> 01:10:08.720
me. On the other hand,
only this one was the one that got

773
01:10:08.760 --> 01:10:13.479
the least amount of votes. Only
seventy one people voted on this particular poll,

774
01:10:14.039 --> 01:10:16.960
and it might be skewed by,
you know, the people who tend

775
01:10:17.039 --> 01:10:23.960
to follow me, So that's definitely
a possibility there. I'm curious what you

776
01:10:24.119 --> 01:10:30.439
guys would have used in this scenario. Preferring readability and being that looking at

777
01:10:30.479 --> 01:10:36.399
that screenshot is absolutely no clearer than
listening on the podcast. I prefer the

778
01:10:36.600 --> 01:10:43.359
obvious. I create a function called
range, and then I do whatever I

779
01:10:43.479 --> 01:10:45.760
do in there, and I can't
remember what I do, but it is

780
01:10:45.039 --> 01:10:48.520
a pain in the butt. Yes
it's it's weird, but I create a

781
01:10:48.600 --> 01:10:55.800
function called range so that it's clear
what I'm doing. How about you,

782
01:10:56.000 --> 01:11:00.039
Chuck, what would you use?
I do the loop and push. I

783
01:11:00.079 --> 01:11:02.960
didn't even know you could do the
other stuff. And Steve, how about

784
01:11:03.000 --> 01:11:10.000
you? What Jack said? By
the way, so again, if you

785
01:11:10.199 --> 01:11:16.439
tell I've mentioned before you know,
reminded me that an advantage of ray from

786
01:11:16.720 --> 01:11:21.760
over the array and then the fill
is that you iterate over the loop once

787
01:11:23.000 --> 01:11:27.920
rather than twice, because with phil
you first iterate to fill it with zero,

788
01:11:28.119 --> 01:11:30.159
and then you iterate again in order
to fill it. With the actual

789
01:11:30.399 --> 01:11:39.600
index values, so it is a
couple of picko seconds slower. Yeah,

790
01:11:39.880 --> 01:11:43.319
it's interesting. I don't you know, I really don't know what I would

791
01:11:43.439 --> 01:11:46.880
use. To be honest, I
probably do what Aj just said, which

792
01:11:46.960 --> 01:11:54.239
is why it's really great that JavaScript
standard is working on introducing a built in

793
01:11:54.960 --> 01:12:02.199
range method so that you will be
able to get such ranges, you know,

794
01:12:02.720 --> 01:12:05.920
out of the box, built in
without you having to implement them yourself.

795
01:12:08.680 --> 01:12:11.800
Yeah. So I'm definitely in support
of that making it to the standard

796
01:12:11.880 --> 01:12:16.720
library. Hopefully it's done in a
way that isn't incompatible with all the other

797
01:12:16.800 --> 01:12:23.560
types of loops we do. Let
me let me slightly and slightly annoy you.

798
01:12:23.920 --> 01:12:29.119
It's iterator dot range, so it
will be a method on the iterator

799
01:12:29.199 --> 01:12:33.680
object. They're going to force people
to accept the one iterator object. Huh.

800
01:12:33.960 --> 01:12:36.920
Yeah. But it does mean that
it will work with four of,

801
01:12:38.800 --> 01:12:42.720
So if you want to do a
four I over a range of values,

802
01:12:43.560 --> 01:12:47.479
you'd actually do a four of over
a range. And the advantage of doing

803
01:12:47.560 --> 01:12:51.920
it over as an iterator is that
it would never actually allocate the error,

804
01:12:54.079 --> 01:12:58.760
so you could do theoretically an infinite
range and then break out of it when

805
01:12:58.760 --> 01:13:00.880
you don't need it any know,
when you reach the point that you're done

806
01:13:00.920 --> 01:13:04.439
with it, I just I've got
to ask the question though, because this

807
01:13:04.600 --> 01:13:08.560
is this is you know, the
thing that people say about iterating, Oh,

808
01:13:08.600 --> 01:13:13.199
it doesn't allocate the memory in what
real UK use case? Are you

809
01:13:13.479 --> 01:13:20.119
generating such a big number of things? No? Actually, actually that's not

810
01:13:20.439 --> 01:13:26.239
the right way to think about it. You either you either generate uh,

811
01:13:26.760 --> 01:13:30.960
something that has a limited size,
in which case you're absolutely correct, or

812
01:13:31.600 --> 01:13:38.439
you generate something that looks as if
it's infinite sized and then you break out

813
01:13:38.479 --> 01:13:42.159
of it when when you're you reach
the point where you don't need to go

814
01:13:42.279 --> 01:13:48.439
any further. Okay, I I'm
not I get the sense of what you're

815
01:13:48.479 --> 01:13:56.279
saying. I'm not sure where it's
of practical think about and think about think

816
01:13:56.359 --> 01:14:00.960
about, for example, I've got
the sequence of all the all the odd

817
01:14:00.399 --> 01:14:05.479
numbers, and then I go as
far as I need to go again.

818
01:14:05.560 --> 01:14:10.439
It's it's like one of those things
that people say for mathematical purity. But

819
01:14:10.760 --> 01:14:15.560
okay, show me the use case
baby. Ah. Anyway, this is

820
01:14:15.640 --> 01:14:20.880
it for today. Uh. You
know, we've got like something like five

821
01:14:21.000 --> 01:14:25.960
more questions remaining that we can do
in some follow up episodes or not.

822
01:14:26.760 --> 01:14:30.279
You know, hopefully I'll have more
questions, more polls by then, but

823
01:14:30.640 --> 01:14:34.800
you know, like we're we're essentially
out of time. So Dan, did

824
01:14:34.840 --> 01:14:41.359
you calculate your margin of error for
this pulling? No? I did not,

825
01:14:41.680 --> 01:14:45.079
but I'll put it this way,
And that's another reason to follow me.

826
01:14:45.640 --> 01:14:49.520
I am betting that there's a certain
skew in my answers, given that,

827
01:14:49.800 --> 01:14:54.920
you know, thinking about the people
who follow me, people like Dan

828
01:14:55.039 --> 01:15:04.600
Abramov and Mitch Harris and Ryan Carniato
and Adiosmani and mischigiol hevery just throwing out

829
01:15:04.680 --> 01:15:12.760
the names, you know, So
if you want to be amongst that refined

830
01:15:13.000 --> 01:15:16.840
crowd, you should follow me,
and then you can and then you'll see

831
01:15:16.880 --> 01:15:20.880
my polls when they come out and
you can participate. All right, well,

832
01:15:21.079 --> 01:15:25.119
let's let's get to some picks.
And yeah, by all means if

833
01:15:25.159 --> 01:15:28.439
you have a question you think Dan
should ask, throw that at him too,

834
01:15:30.880 --> 01:15:33.640
All right, A j why don't
you start us off with our picks?

835
01:15:34.439 --> 01:15:41.399
Okay, picks, dang h.
One thing that I was thinking about

836
01:15:41.479 --> 01:15:45.359
recently is I got I'm now in
the third book of the Chaos Walking trilogy,

837
01:15:46.560 --> 01:15:53.720
and that is pretty good. I'm
going to be interested to watch the

838
01:15:53.800 --> 01:15:58.640
movie after I finish the books and
kind of see which trilogy is that Chaos

839
01:15:58.760 --> 01:16:03.840
Walking. It starts with the knife
of Never Letting Go. It's about it's

840
01:16:03.920 --> 01:16:11.880
about a colony. It's kind of
like a space western, but the people

841
01:16:12.039 --> 01:16:15.319
have crash landed their ship on a
planet and they're not going to be able

842
01:16:15.359 --> 01:16:17.239
to get off of it. And
then they you know, it's been almost

843
01:16:17.279 --> 01:16:24.399
a generation of people living there,
and then the next settlership is on its

844
01:16:24.479 --> 01:16:30.920
way. And so there was a
movie in twenty twenty one that sounds about

845
01:16:31.000 --> 01:16:38.319
right. Okay, yeah, so
but the movie got really bad reviews,

846
01:16:38.359 --> 01:16:42.960
and I think the problem was that
they tried to turn it into I think

847
01:16:43.039 --> 01:16:45.159
this is what I heard, is
that they tried to turn it into a

848
01:16:45.199 --> 01:16:50.000
story about sexism, and it just
didn't land with people because people didn't want

849
01:16:50.000 --> 01:16:54.560
to get preached at that wanted to
watch that movie. They wanted the story.

850
01:16:54.760 --> 01:16:58.920
And so a lot of people said
that they're really upset that they abused

851
01:16:58.960 --> 01:17:00.560
the movie. Uh, and that
the book, you know, if they

852
01:17:00.680 --> 01:17:04.560
followed the book instead of creating their
own story arc that you know, the

853
01:17:04.640 --> 01:17:10.319
movie could have done well. And
so That got me interested in the book

854
01:17:10.319 --> 01:17:12.920
because I liked the trailer for the
movie and I didn't know it was based

855
01:17:12.960 --> 01:17:15.960
on a book. But the reviews
were so bad that I just didn't go

856
01:17:15.119 --> 01:17:17.359
see it. But I saw a
review that said, look, you got

857
01:17:17.479 --> 01:17:21.600
to read the books because the books
actually are an interesting story. And the

858
01:17:23.039 --> 01:17:27.079
reason that it would be an easy
movie to turn into, you know,

859
01:17:27.159 --> 01:17:31.439
a political message about sexism is because
there is a divide the mint. So

860
01:17:31.600 --> 01:17:40.319
everybody is infected with a bacteria or
some pathogen or or parasite or whatever that,

861
01:17:41.600 --> 01:17:45.560
but it only affects males. It
doesn't affect females. Oh I remember,

862
01:17:45.920 --> 01:17:49.880
I now remember the trailer. Okay, so did they project their thoughts

863
01:17:50.000 --> 01:17:57.479
something like that? Yeah? Yeah, So all males project their thoughts as

864
01:17:58.159 --> 01:18:01.119
as something that and the females can
sense it. And this goes for animals

865
01:18:01.159 --> 01:18:06.039
as well as humans. So the
females can sense the males, but the

866
01:18:06.159 --> 01:18:12.560
females don't project their own thoughts.
So, you know, every impulsive thought

867
01:18:12.640 --> 01:18:16.840
that a man has, including about
women, you know, like, is

868
01:18:17.000 --> 01:18:25.760
immediately available on display to anyone within
earshot, let's say, of the man.

869
01:18:26.279 --> 01:18:33.399
And so this creates this rift in
society and there is a psychopath who

870
01:18:35.159 --> 01:18:43.880
wants does not like that women can
hear his thoughts, and the women mysteriously

871
01:18:44.000 --> 01:18:47.880
disappear, and that I'm in the
third book and that's still not entirely resolved.

872
01:18:47.920 --> 01:18:54.720
I'm still kind of waiting for the
reveal of what happened. But yeah,

873
01:18:54.800 --> 01:18:59.520
so there is there. There's there's
like this psychopath who needs complete control

874
01:18:59.680 --> 01:19:04.600
and the ability for others to hear
thoughts or like, it's it's it's kind

875
01:19:04.640 --> 01:19:10.600
of difficult to explain because of the
nature of the sci fi noess of it,

876
01:19:10.760 --> 01:19:15.560
but essentially, settlers land on the
planet, the women disappear, the

877
01:19:15.720 --> 01:19:24.199
men can see and hear each other's
thoughts, and a woman is discovered in

878
01:19:24.319 --> 01:19:30.000
the woods by the protagonist about like
two or three chapters in and and it's

879
01:19:30.039 --> 01:19:33.600
his first encounter with a woman,
and and uh, and she is from

880
01:19:34.199 --> 01:19:40.319
the other settlership that had been on
its way for a generation. So that's

881
01:19:40.439 --> 01:19:43.560
kind of that doesn't spoil too much, you know, other than the first

882
01:19:44.239 --> 01:19:46.399
you know, it doesn't spoil any
more than what's in the trailer for the

883
01:19:46.439 --> 01:19:50.960
movie, right, So I'll just
I'll just stick with that because we talked

884
01:19:51.000 --> 01:19:55.359
about it a whole bunch, and
I don't want to take up the remainder

885
01:19:55.439 --> 01:19:59.359
of the hour with that. But
interesting. Yeah, so Chaos, the

886
01:19:59.479 --> 01:20:03.399
Chaos Wall the book trilogy really interesting
to me. We'll we'll see what I

887
01:20:03.439 --> 01:20:06.359
think about it when I finished the
third book here, but I'm about two

888
01:20:06.479 --> 01:20:11.840
thirds through the third book and I'm
excited to see how things wrapped together,

889
01:20:12.520 --> 01:20:15.880
and I think there's gonna be a
twist ending. I'm not sure if I'm

890
01:20:15.880 --> 01:20:21.279
gonna like it or not. All
right, Steve, what are your picks?

891
01:20:24.479 --> 01:20:26.760
Well, before we get to the
high point of the episode, I

892
01:20:26.840 --> 01:20:31.600
will I do have another semi legit
pick. Some blog posts. I came

893
01:20:31.640 --> 01:20:36.479
across a hacker news from Ours Technica
and it's one of my favorite topics to

894
01:20:36.560 --> 01:20:41.920
read about. And it's titled how
Archaeologists reconstructed the Burning of Jerusalem in five

895
01:20:42.000 --> 01:20:47.960
eighty six BC or BCE, if
you're politically correct. Basically in the Old

896
01:20:48.039 --> 01:20:56.399
Testament the King Jim Chronicles. It
talks about how Nebbe Canezer came and completely

897
01:20:56.520 --> 01:21:00.640
destroyed Jerusalem in five eighty six.
He had captured it and taken off a

898
01:21:00.680 --> 01:21:08.920
lot of the Jews to Babylon,
but a couple of the kings that stayed

899
01:21:08.960 --> 01:21:12.439
there decided to try to rebel and
he said, screw this, I'm taking

900
01:21:12.439 --> 01:21:16.039
the yell down. And so he
basically completely destroyed the city. And so

901
01:21:17.000 --> 01:21:26.000
the article talks about a study that
was done there that used analytics of fire

902
01:21:26.920 --> 01:21:31.520
and how fire behaves and a lot
of the things we can tell now,

903
01:21:31.960 --> 01:21:36.920
you know, with forensics, and
how what fire did to a building to

904
01:21:39.000 --> 01:21:44.319
pretty much nail down the app about
that time is when Jerusalem was completely burned

905
01:21:45.680 --> 01:21:49.119
and destroyed. It's really pretty fascinating, especially if you're into fire science as

906
01:21:49.159 --> 01:21:53.560
I am. So anyway, we
can put the link in the show notes

907
01:21:53.600 --> 01:21:58.159
for sure. And now it's time
for the Dad jokes of the week.

908
01:21:58.520 --> 01:22:00.920
I have been posting for a couple
of weeks, sins I've been on vacation,

909
01:22:00.159 --> 01:22:04.399
but I think I can dig up
a few that are worthy of being

910
01:22:04.479 --> 01:22:11.920
quoted here. So, in the
spirit of Christmas, did anybody hear about

911
01:22:12.039 --> 01:22:15.800
Rudolph's riot on the roller coaster when
he went to the amusement park? You

912
01:22:15.880 --> 01:22:24.119
can say he held on for dear
life. Now, I am a I

913
01:22:24.239 --> 01:22:29.520
think true pizza aficionadus would call me
a heretic and shoot me on site for

914
01:22:29.600 --> 01:22:32.760
saying this that I do like pineapple
and pizza. The pine and swine.

915
01:22:33.600 --> 01:22:39.840
Pine and swine aka Canadian bacon and
pineapple is for me the best pizza.

916
01:22:40.720 --> 01:22:45.359
So the other day I was cooking
some but I actually burned it. I

917
01:22:45.439 --> 01:22:48.840
found out it was you know,
it's called the Hawaiian pizza, you know,

918
01:22:49.000 --> 01:22:53.079
as one of the names. I
prefer pine and swine. But in

919
01:22:53.159 --> 01:22:56.560
the spirit of Hawaiian pizza, I
should have cooked it at aloha temperature.

920
01:22:59.399 --> 01:23:06.359
Right. I love the drones.
And then finally, apologies to pets fans,

921
01:23:06.399 --> 01:23:10.199
but I love this one. When
I saw it. Does anybody know

922
01:23:10.319 --> 01:23:18.000
why there are no cats on Mars? Because curiosity killed them? All right?

923
01:23:18.199 --> 01:23:23.880
Curiosity is the was on Mars.
You know, there's curiosity with the

924
01:23:23.920 --> 01:23:28.359
other one, oh, Discovery,
I think, yeah, something was at

925
01:23:28.399 --> 01:23:32.560
the space shuttle. Yeah that was
a space shuttle anyway. Anyway, those

926
01:23:32.560 --> 01:23:36.119
are the dad jokes of the week. All right, Dan, what are

927
01:23:36.159 --> 01:23:45.680
your picks? Okay, so I've
got to my first pick is and despite

928
01:23:45.840 --> 01:23:49.840
your frequent recommendations, Chuck, we've
not really I've not really been into board

929
01:23:49.920 --> 01:23:57.640
games that much. But now,
as as a birthday present our kids bought

930
01:23:57.800 --> 01:24:01.800
us settlers of Katan. Is that
how you guys pronounce it? Uh?

931
01:24:01.960 --> 01:24:05.239
And and we've been playing it like, uh, you know, in the

932
01:24:05.319 --> 01:24:12.920
family and it's been lots of fun. I've yet to win, but uh,

933
01:24:13.520 --> 01:24:16.880
I'm trying. Uh and uh it's
very enjoyable. Uh. And it's

934
01:24:16.920 --> 01:24:21.439
a good game. I really like
it. So so yeah, we will

935
01:24:21.479 --> 01:24:26.680
see how long we're able to persist. Uh. We play it like once

936
01:24:26.720 --> 01:24:31.359
a week something like that. We
have a game night. And so that's

937
01:24:31.479 --> 01:24:35.239
that would be my first pick.
My second is, you know, as

938
01:24:35.520 --> 01:24:40.119
as everybody in the world knows,
there's a war going on here, and

939
01:24:40.399 --> 01:24:45.680
everybody seems to be picking sides.
And what I've what I've noticed is that

940
01:24:45.880 --> 01:24:53.119
a lot of people don't really have
the context. They they don't know the

941
01:24:53.319 --> 01:25:00.199
history. Now it's it's you don't
have to know the history to have an

942
01:25:00.239 --> 01:25:04.680
opinion. You can certainly have opinions
about things that are happening, you know,

943
01:25:04.880 --> 01:25:10.439
at present, without you know,
thinking about what happened fifty one hundred

944
01:25:10.520 --> 01:25:17.079
years ago. But I do think
that having more contexts usually is helpful.

945
01:25:17.760 --> 01:25:25.439
And in what I would like to
pick is this documentary Israeli documentary. So

946
01:25:25.600 --> 01:25:29.000
I can't you know, say about
it that it's objective, it's from the

947
01:25:29.520 --> 01:25:32.800
Israeli perspective, but it does try
to be even handed. I have to

948
01:25:32.880 --> 01:25:39.880
say. It's a documentary that came
out in the eighties called Pillar of Fire.

949
01:25:40.479 --> 01:25:46.119
It starts when Zionism started in the
like eighteen seventies and goes all the

950
01:25:46.199 --> 01:25:55.000
way to the founding of Israel and
a bit after that. And there's an

951
01:25:55.079 --> 01:25:59.920
English version that you can find on
YouTube. By the way, one big

952
01:26:00.119 --> 01:26:03.560
advantage of the fact that it was
done in the eighties is that they could

953
01:26:03.960 --> 01:26:09.479
still interview people who were there or
you know, even as kids. You

954
01:26:09.520 --> 01:26:14.760
know people or have you know,
deceased since then. And what's really great

955
01:26:14.840 --> 01:26:19.840
about this series is that they were
able to uncover a lot of original,

956
01:26:20.479 --> 01:26:26.840
uh, you know, films from
from the various periods. So it's it's

957
01:26:26.920 --> 01:26:31.000
really great in that regard, uh
And it was, you know, it's

958
01:26:31.119 --> 01:26:36.119
really good. I highly recommend it. So again I can't say that it's

959
01:26:36.399 --> 01:26:43.079
like objective or you know, you
won't get as much of the error perspective

960
01:26:43.079 --> 01:26:45.760
as you would get of the Jewish
perspective. But still again I think,

961
01:26:45.960 --> 01:26:51.640
you know, they do try to
present all the facts, and it's it's

962
01:26:51.760 --> 01:26:58.399
highly recommended for anybody who's really interested. So I link a link to the

963
01:26:58.560 --> 01:27:01.960
first a link to the search in
YouTube that will find it. You will

964
01:27:02.000 --> 01:27:08.279
see like episodes two and three there. I don't know if all the episodes

965
01:27:08.319 --> 01:27:12.479
are on YouTube, but I think
at least the first four or five are

966
01:27:12.560 --> 01:27:20.079
there. So it's as I said, I highly recommend that. And those

967
01:27:20.119 --> 01:27:26.199
would be my picks for today.
Awesome. I'll jump in here with a

968
01:27:26.279 --> 01:27:30.920
few of mine. Let me get
that in the comments so people can find

969
01:27:30.960 --> 01:27:35.680
it on the YouTube video. All
right, So the first one is I

970
01:27:35.880 --> 01:27:41.479
am excited to be going to another
board game convention. This is my first

971
01:27:41.560 --> 01:27:45.319
time at this one. If you
all remember Joe Eames used to be on

972
01:27:45.399 --> 01:27:49.560
the show, he and his wife
would often go to this one. It's

973
01:27:49.600 --> 01:27:55.560
called Salt Con and it's here in
Utah. It's up in Davis County,

974
01:27:56.000 --> 01:28:00.319
so it's like an hour a little
more than an hour from here at the

975
01:28:00.399 --> 01:28:04.279
convention center up there, and uh
yeah, it's four days. It goes

976
01:28:04.319 --> 01:28:10.399
Thursday through Sunday, and it's the
same deal as most of the other ones.

977
01:28:10.479 --> 01:28:12.479
Right, You just go and you
play a bunch of board games,

978
01:28:13.000 --> 01:28:15.800
A couple of my friends are going, so we're all gonna I think we'll

979
01:28:15.840 --> 01:28:19.279
hang out some of the time and
then just go find fun games the rest

980
01:28:19.319 --> 01:28:23.319
of the time, you know,
maybe without each other, but it'll be

981
01:28:23.399 --> 01:28:26.039
fun. I'm really really looking forward
to it. So I'm gonna pick that

982
01:28:27.159 --> 01:28:30.800
as one of the board game picks
that I have, and then I really

983
01:28:30.840 --> 01:28:33.920
do feel like I ought to pick
a board game my So we played this

984
01:28:34.039 --> 01:28:36.239
with my kids last night. I
know I've picked it here before. It's

985
01:28:36.239 --> 01:28:44.840
called Mysterium, and effectively, you've
got this ghost who's trying to give clues

986
01:28:44.920 --> 01:28:53.279
to a set of psychics regarding the
murders that have happened in this house.

987
01:28:53.479 --> 01:28:58.720
And then if the psychics all solve
the murderers, each solve their own murder,

988
01:28:59.039 --> 01:29:03.880
you know, the murder that's assigned
to them. Then then the ghost,

989
01:29:04.319 --> 01:29:09.239
which is just another player, gives
the final clue, which is a

990
01:29:09.359 --> 01:29:14.960
clue to the their own murder.
Right, so one of the murders of

991
01:29:15.359 --> 01:29:18.279
the murders that the ghost is getting
clues to is their own murder. And

992
01:29:18.920 --> 01:29:23.359
anyway, it's been a lot of
fun to play. It says play times

993
01:29:23.359 --> 01:29:29.239
about forty two minutes. I think
we've played. Every time we've played it

994
01:29:29.239 --> 01:29:31.359
has been an hour, maybe a
little longer. It has a board game

995
01:29:31.439 --> 01:29:38.520
weight of one point nine, so, you know, it's kind of a

996
01:29:38.600 --> 01:29:45.600
party game, casual gamer level game. And yeah, anyway, the clues

997
01:29:45.600 --> 01:29:48.119
are basically cards that have just random
pictures on it, so you're trying to

998
01:29:48.560 --> 01:29:53.159
the ghost is trying to pass these
clues over to the psychics, and then

999
01:29:53.159 --> 01:29:57.640
the psychics have to figure out what
in the picture would lead them to pick

1000
01:29:57.680 --> 01:30:01.600
the right culprit, the right location, or the right murder weapon. And

1001
01:30:02.439 --> 01:30:05.000
yeah, I've been the ghost a
couple of times, and I've you know,

1002
01:30:05.079 --> 01:30:08.560
I've played as the psychic, you
know, one of the psychics a

1003
01:30:08.600 --> 01:30:13.279
bunch of times. And it's tricky
because a lot of times what you wind

1004
01:30:13.399 --> 01:30:15.079
up doing is you wind up getting
a card or passing your card. It

1005
01:30:15.199 --> 01:30:20.760
has one or two elements in the
card that indicate the thing that you're trying

1006
01:30:20.840 --> 01:30:24.520
to get them to pick up on. But it's got a whole bunch of

1007
01:30:24.560 --> 01:30:27.239
other stuff going on, right,
They're all kind of random, weird,

1008
01:30:28.119 --> 01:30:30.239
you know cards. So anyway,
it is fun. It's a lot of

1009
01:30:30.319 --> 01:30:35.880
fun. A few other things I'm
just kind of giving people some context for

1010
01:30:36.800 --> 01:30:41.600
where we're going with Top End devs
Now, I want to preface this just

1011
01:30:41.680 --> 01:30:45.640
by saying I had kind of a
major family event happened right before Christmas,

1012
01:30:47.800 --> 01:30:50.920
and so I have been dealing with
the fallout of that and helping my mom

1013
01:30:51.039 --> 01:30:56.279
figure out some of the fallout from
that. And I was going to have

1014
01:30:56.359 --> 01:30:58.920
all this stuff ready by the beginning
of the year, and so I'm playing

1015
01:30:58.920 --> 01:31:00.960
a little bit of catch up.
But by the time this comes out,

1016
01:31:00.479 --> 01:31:04.359
you should be able to sign up. You can get there the premium podcast

1017
01:31:04.479 --> 01:31:10.399
episodes that don't have the ads in
them for each of our shows. But

1018
01:31:11.079 --> 01:31:15.159
the other thing that I'm doing is
every month I'm gonna have a producer call,

1019
01:31:15.279 --> 01:31:17.359
And so if you're if you buy
the premium membership, you're a producer

1020
01:31:17.840 --> 01:31:20.000
and you can get on the call
and you can talk to us about,

1021
01:31:20.039 --> 01:31:24.319
Hey, you haven't done a show
on this, or hey, I think

1022
01:31:24.359 --> 01:31:27.199
it'd be really great if you talk
to this person. Right, So,

1023
01:31:27.399 --> 01:31:30.680
maybe there's something we didn't cover with
Mishiko hevery, or maybe we should get

1024
01:31:30.960 --> 01:31:35.479
Adi Smani back on, or you
know, maybe you know there's some thing

1025
01:31:35.640 --> 01:31:40.239
that you know is inspired by one
of Dan's polls, right, so you

1026
01:31:40.279 --> 01:31:43.479
can get on the call and you
can tell me, I'm gonna invite these

1027
01:31:43.520 --> 01:31:45.199
guys, but I don't know what
their schedules all look like, so I

1028
01:31:45.439 --> 01:31:48.920
can't guarantee anything that way, but
you know, then then we'll get those

1029
01:31:48.920 --> 01:31:53.119
scheduled and so you can kind of
have a voice in what we talk about

1030
01:31:53.159 --> 01:31:58.159
on the show. The other thing
I'm putting together is I'm putting together videos

1031
01:31:59.279 --> 01:32:02.960
for be JavaScript and React, and
those are going to come out every week.

1032
01:32:03.159 --> 01:32:06.760
And what I'm doing is I'm just
building apps, and then we'll talk

1033
01:32:06.800 --> 01:32:11.960
about some of the ideas or ins
and outs of any libraries or techniques or

1034
01:32:11.960 --> 01:32:15.199
anything that I used to build them. So you know, the React ones

1035
01:32:15.239 --> 01:32:17.359
are obviously going to be React.
If it's not React and it's JavaScript,

1036
01:32:18.079 --> 01:32:23.319
I think I'm going to build a
discord bot in JavaScript for the JavaScript one,

1037
01:32:24.720 --> 01:32:29.079
and then for the Ruby one,
I've got a library I want to

1038
01:32:29.119 --> 01:32:30.760
modify. There are a couple of
apps I want to build, and I

1039
01:32:30.800 --> 01:32:32.840
may or may not build them in
rails, so that kind of gives you

1040
01:32:32.880 --> 01:32:38.920
an idea. And then finally,
if you're looking for content from other experts

1041
01:32:38.960 --> 01:32:42.720
that you can participate in more of
kind of a I don't want to say

1042
01:32:42.760 --> 01:32:44.880
webinar, but it's kind of a
webinar, but it's also going to have

1043
01:32:45.000 --> 01:32:47.640
a very strong Q and A element
to it. Then you can go check

1044
01:32:47.680 --> 01:32:54.000
out JavaScript Geniuses. I'm doing that
for JavaScript and React as well, but

1045
01:32:54.119 --> 01:32:57.039
you can get the JavaScript Geniuses and
you can just show up every week and

1046
01:32:57.159 --> 01:33:00.600
we'll either do a Q and A
or we'll have an expert on or you

1047
01:33:00.640 --> 01:33:03.319
know, something like that. So
it's kind of like your JavaScript meetup,

1048
01:33:03.399 --> 01:33:09.439
except it'll be online and we're gonna
make sure we have networking events so you

1049
01:33:09.520 --> 01:33:12.560
can get to know each other because
I feel like that's a critical part of

1050
01:33:12.960 --> 01:33:15.600
having a successful career these days.
So anyway, putting all that together,

1051
01:33:17.800 --> 01:33:23.600
if you go to JavaScript jabber dot
com Slash Premium, you can see where

1052
01:33:23.640 --> 01:33:29.479
to get onto the premium podcast.
The other one is called JavaScript what is

1053
01:33:29.520 --> 01:33:32.520
it JavaScript Clips? I think is
what I called it, JavaScript Clips,

1054
01:33:32.720 --> 01:33:35.640
and then JavaScript Geniuses and I have
the domain, so if you go to

1055
01:33:35.640 --> 01:33:41.039
the domains, it'll take sign up
pages. So anyway, that's that's what

1056
01:33:41.119 --> 01:33:45.680
I got for picks. Yeah,
I don't think there's anything else, so

1057
01:33:45.720 --> 01:33:49.159
we'll go ahead and wrap it up
until next time folks max out

