WEBVTT

1
00:00:05.100 --> 00:00:11.800
<00:00:05.100>It <00:00:06.500>okay.

2
00:00:09.800 --> 00:00:13.100
<00:00:09.800>Hi <00:00:11.200>and

3
00:00:12.100 --> 00:00:16.200
<00:00:12.100>welcome <00:00:12.333>to <00:00:12.566>my <00:00:12.799>talk <00:00:13.033>about <00:00:13.266>well <00:00:13.500>parts

4
00:00:15.200 --> 00:00:17.200
<00:00:15.200>of <00:00:15.666>typescript. <00:00:16.133>Let's <00:00:16.599>say

5
00:00:19.000 --> 00:00:19.200
so

6
00:00:21.300 --> 00:00:22.000
<00:00:21.300>This <00:00:21.615>right <00:00:21.930>here.

7
00:00:23.200 --> 00:00:24.600
<00:00:23.200>Is <00:00:23.515>the <00:00:23.830>JavaScript <00:00:24.145>variable <00:00:24.460>right?

8
00:00:25.400 --> 00:00:28.000
<00:00:25.400>There's <00:00:25.540>a <00:00:25.680>thing <00:00:25.820>on <00:00:25.959>the <00:00:26.099>right <00:00:26.240>with <00:00:26.380>the <00:00:26.520>name <00:00:26.659>on <00:00:26.799>the

9
00:00:28.100 --> 00:00:32.400
<00:00:28.100>left. <00:00:28.240>And <00:00:28.380>that's <00:00:28.520>basically <00:00:28.660>all <00:00:28.800>that <00:00:28.940>is <00:00:29.080>to <00:00:29.220>it <00:00:29.360>now. <00:00:29.500>Technically

10
00:00:31.400 --> 00:00:32.700
speaking.

11
00:00:33.800 --> 00:00:36.500
<00:00:33.800>This <00:00:34.000>here <00:00:34.199>is <00:00:34.400>also <00:00:34.599>a <00:00:34.800>JavaScript <00:00:35.000>barrier <00:00:35.199>right

12
00:00:36.500 --> 00:00:39.100
<00:00:36.500>thing <00:00:36.655>on <00:00:36.811>the <00:00:36.966>right <00:00:37.122>name <00:00:37.277>on <00:00:37.433>the <00:00:37.588>left, <00:00:37.744>you <00:00:37.900>know

13
00:00:39.100 --> 00:00:39.700
<00:00:39.100>the <00:00:39.640>drill.

14
00:00:40.100 --> 00:00:43.500
<00:00:40.100>But <00:00:40.275>although <00:00:40.450>bar <00:00:40.625>is <00:00:40.800>technically <00:00:40.975>a <00:00:41.150>JavaScript <00:00:41.325>variable. <00:00:41.500>We

15
00:00:43.500 --> 00:00:46.500
<00:00:43.500>use <00:00:43.640>it <00:00:43.780>in <00:00:43.920>a <00:00:44.060>very <00:00:44.200>different <00:00:44.340>way. <00:00:44.480>We <00:00:44.620>don't <00:00:44.760>write <00:00:44.900>bar

16
00:00:46.500 --> 00:00:49.500
<00:00:46.500>to <00:00:46.616>our <00:00:46.733>database <00:00:46.850>or <00:00:46.966>send <00:00:47.083>it <00:00:47.200>via <00:00:47.316>Json <00:00:47.433>to <00:00:47.550>I <00:00:47.666>don't <00:00:47.783>know <00:00:47.900>somewhere

17
00:00:49.500 --> 00:00:50.300
<00:00:49.500>but <00:00:50.220>we

18
00:00:50.900 --> 00:00:53.900
<00:00:50.900>use <00:00:51.074>bar <00:00:51.250>is <00:00:51.425>sort <00:00:51.600>of <00:00:51.775>a <00:00:51.949>value <00:00:52.125>Factory <00:00:52.300>instead

19
00:00:53.900 --> 00:00:55.100
<00:00:53.900>of <00:00:54.170>as <00:00:54.440>a <00:00:54.710>value <00:00:54.980>itself.

20
00:00:56.100 --> 00:00:56.900
<00:00:56.100>It's <00:00:56.820>function.

21
00:00:58.400 --> 00:01:01.100
<00:00:58.400>Okay, <00:00:58.600>but <00:00:58.800>this <00:00:59.000>is <00:00:59.199>typescript. <00:00:59.400>So <00:00:59.600>we <00:00:59.800>need

22
00:01:01.100 --> 00:01:01.800
<00:01:01.100>to <00:01:01.310>have <00:01:01.519>some <00:01:01.730>types.

23
00:01:03.300 --> 00:01:06.500
<00:01:03.300>Now, <00:01:03.440>I <00:01:03.580>don't <00:01:03.720>know <00:01:03.860>about <00:01:04.000>you, <00:01:04.140>but <00:01:04.280>doesn't <00:01:04.420>this <00:01:04.560>look <00:01:04.700>kind

24
00:01:06.500 --> 00:01:07.500
<00:01:06.500>of <00:01:06.800>like <00:01:07.100>a <00:01:07.400>variable?

25
00:01:08.200 --> 00:01:10.500
<00:01:08.200>You <00:01:08.355>know <00:01:08.511>thing <00:01:08.666>on <00:01:08.822>the <00:01:08.977>right <00:01:09.133>name <00:01:09.288>on <00:01:09.444>the <00:01:09.600>left.

26
00:01:12.100 --> 00:01:15.500
<00:01:12.100>And <00:01:12.227>if <00:01:12.354>this <00:01:12.481>is <00:01:12.609>kind <00:01:12.736>of <00:01:12.863>like <00:01:12.990>a <00:01:13.118>variable <00:01:13.245>and <00:01:13.372>bar <00:01:13.500>is

27
00:01:15.500 --> 00:01:19.000
<00:01:15.500>technically <00:01:15.640>a <00:01:15.780>variable <00:01:15.920>but <00:01:16.060>semantically <00:01:16.200>a <00:01:16.340>very <00:01:16.480>different <00:01:16.620>thing. <00:01:16.760>What <00:01:16.900>do

28
00:01:18.100 --> 00:01:20.000
<00:01:18.100>you <00:01:18.566>think? <00:01:19.033>This <00:01:19.500>is?

29
00:01:22.800 --> 00:01:23.000
Okay.

30
00:01:24.300 --> 00:01:24.700
<00:01:24.300>Let's <00:01:24.660>see.

31
00:01:25.700 --> 00:01:25.900
Hi.

32
00:01:26.700 --> 00:01:29.400
<00:01:26.700>I'm <00:01:26.900>not <00:01:27.100>a <00:01:27.300>developer. <00:01:27.500>I <00:01:27.700>just <00:01:27.900>talk <00:01:28.100>about

33
00:01:29.400 --> 00:01:32.400
<00:01:29.400>code. <00:01:29.680>I'm <00:01:29.960>as <00:01:30.240>you <00:01:30.520>are <00:01:30.800>a

34
00:01:32.400 --> 00:01:35.600
<00:01:32.400>trainer <00:01:32.527>for <00:01:32.654>that <00:01:32.781>Technologies <00:01:32.909>and <00:01:33.036>you <00:01:33.163>can <00:01:33.290>click <00:01:33.418>on <00:01:33.545>this <00:01:33.672>blue <00:01:33.800>stuff

35
00:01:35.600 --> 00:01:38.300
<00:01:35.600>where <00:01:35.727>you <00:01:35.854>can't <00:01:35.981>right <00:01:36.109>now, <00:01:36.236>but <00:01:36.363>you <00:01:36.490>will <00:01:36.618>be <00:01:36.745>able <00:01:36.872>to <00:01:37.000>click

36
00:01:38.300 --> 00:01:40.600
<00:01:38.300>on <00:01:38.455>the <00:01:38.611>blue <00:01:38.766>stuff <00:01:38.922>in <00:01:39.077>the <00:01:39.233>future <00:01:39.388>to <00:01:39.544>you <00:01:39.700>know.

37
00:01:41.600 --> 00:01:43.400
<00:01:41.600>Take <00:01:41.833>a <00:01:42.066>look <00:01:42.300>at <00:01:42.533>my <00:01:42.766>activities <00:01:43.000>online.

38
00:01:44.400 --> 00:01:47.400
<00:01:44.400>But <00:01:44.575>today <00:01:44.750>it's <00:01:44.925>not <00:01:45.100>the <00:01:45.275>day <00:01:45.450>to <00:01:45.625>click <00:01:45.800>on

39
00:01:47.400 --> 00:01:50.700
<00:01:47.400>stuff. <00:01:47.555>But <00:01:47.711>today's <00:01:47.866>the <00:01:48.022>day <00:01:48.177>to <00:01:48.333>talk <00:01:48.488>about <00:01:48.644>how <00:01:48.800>we

40
00:01:50.700 --> 00:01:53.900
<00:01:50.700>can <00:01:50.933>program <00:01:51.166>with <00:01:51.400>nothing <00:01:51.633>but <00:01:51.866>type <00:01:52.100>annotations

41
00:01:53.900 --> 00:01:56.700
<00:01:53.900>my <00:01:54.133>entire <00:01:54.366>premise <00:01:54.600>is <00:01:54.833>basically <00:01:55.066>let's <00:01:55.300>treat

42
00:01:56.700 --> 00:01:59.300
<00:01:56.700>typescript <00:01:56.980>type <00:01:57.260>annotations <00:01:57.540>as <00:01:57.820>if <00:01:58.100>they

43
00:01:59.300 --> 00:02:02.800
<00:01:59.300>themselves <00:01:59.500>were <00:01:59.700>an <00:01:59.899>entire <00:02:00.100>programming <00:02:00.300>language <00:02:00.500>and <00:02:00.700>let's

44
00:02:02.800 --> 00:02:03.400
<00:02:02.800>see <00:02:03.070>what <00:02:03.340>happens.

45
00:02:04.400 --> 00:02:07.000
<00:02:04.400>We <00:02:04.527>are <00:02:04.654>going <00:02:04.781>to <00:02:04.909>do <00:02:05.036>this <00:02:05.163>in <00:02:05.290>three <00:02:05.418>parts <00:02:05.545>first. <00:02:05.672>We <00:02:05.800>are

46
00:02:07.200 --> 00:02:10.300
<00:02:07.200>going <00:02:07.340>to <00:02:07.480>look <00:02:07.620>at <00:02:07.760>what <00:02:07.900>the <00:02:08.039>hell <00:02:08.180>I'm <00:02:08.320>going <00:02:08.460>on <00:02:08.600>about

47
00:02:10.300 --> 00:02:13.300
<00:02:10.300>then <00:02:10.533>we <00:02:10.766>talk <00:02:11.000>about <00:02:11.233>why <00:02:11.466>we <00:02:11.700>would

48
00:02:13.300 --> 00:02:16.200
<00:02:13.300>want <00:02:13.533>to <00:02:13.766>treat <00:02:14.000>typescript <00:02:14.233>type <00:02:14.466>annotations <00:02:14.700>as

49
00:02:16.200 --> 00:02:19.600
<00:02:16.200>a <00:02:16.316>programming <00:02:16.433>language. <00:02:16.549>And <00:02:16.666>finally <00:02:16.783>we <00:02:16.899>are <00:02:17.016>going <00:02:17.133>to <00:02:17.250>see <00:02:17.366>what <00:02:17.483>this <00:02:17.600>can

50
00:02:19.600 --> 00:02:22.300
<00:02:19.600>bring <00:02:19.799>to <00:02:20.000>our <00:02:20.200>projects <00:02:20.400>what <00:02:20.600>we <00:02:20.799>can <00:02:21.000>take

51
00:02:22.300 --> 00:02:23.500
<00:02:22.300>away <00:02:22.570>in <00:02:22.840>terms <00:02:23.110>of <00:02:23.380>benefits.

52
00:02:24.200 --> 00:02:27.000
<00:02:24.200>And <00:02:24.355>in <00:02:24.511>the <00:02:24.666>end <00:02:24.822>they <00:02:24.977>are <00:02:25.133>softly <00:02:25.288>a <00:02:25.444>bunch <00:02:25.600>of

53
00:02:27.200 --> 00:02:30.200
<00:02:27.200>time <00:02:27.375>for <00:02:27.549>your <00:02:27.725>questions. <00:02:27.899>Maybe <00:02:28.075>not <00:02:28.250>for <00:02:28.424>all <00:02:28.600>questions.

54
00:02:30.200 --> 00:02:31.100
<00:02:30.200>But <00:02:30.402>at <00:02:30.605>least <00:02:30.807>for <00:02:31.010>some

55
00:02:32.000 --> 00:02:32.300
okay.

56
00:02:33.100 --> 00:02:37.400
<00:02:33.100>First <00:02:33.275>topic <00:02:33.450>or <00:02:33.625>what <00:02:33.799>is <00:02:33.975>going <00:02:34.150>on? <00:02:34.325>Well, <00:02:34.500>and

57
00:02:36.400 --> 00:02:39.300
<00:02:36.400>there's <00:02:36.866>an <00:02:37.333>issue <00:02:37.800>on

58
00:02:39.300 --> 00:02:42.100
<00:02:39.300>the <00:02:39.475>tracks <00:02:39.650>typescript <00:02:39.825>backtrack <00:02:40.000>which <00:02:40.175>goes <00:02:40.350>on <00:02:40.525>and <00:02:40.700>on

59
00:02:42.100 --> 00:02:45.400
<00:02:42.100>about <00:02:42.227>the <00:02:42.354>question <00:02:42.481>whether <00:02:42.609>or <00:02:42.736>not <00:02:42.863>touch <00:02:42.990>scripts <00:02:43.118>type <00:02:43.245>system <00:02:43.372>itself <00:02:43.500>is

60
00:02:45.400 --> 00:02:48.300
<00:02:45.400>during <00:02:45.540>complete <00:02:45.680>and <00:02:45.820>as <00:02:45.960>you <00:02:46.100>can <00:02:46.240>see <00:02:46.380>the <00:02:46.520>issue <00:02:46.660>has <00:02:46.800>not

61
00:02:48.300 --> 00:02:49.000
<00:02:48.300>been <00:02:48.930>closed.

62
00:02:49.600 --> 00:02:52.900
<00:02:49.600>Sort <00:02:49.950>of <00:02:50.299>the <00:02:50.650>issue <00:02:51.000>hasn't

63
00:02:52.900 --> 00:02:53.400
<00:02:52.900>halted <00:02:53.350>yet.

64
00:02:54.800 --> 00:02:56.500
<00:02:54.800>Do <00:02:55.080>you <00:02:55.360>get <00:02:55.640>it, <00:02:55.920>right? <00:02:56.200>Okay.

65
00:02:58.100 --> 00:03:01.300
<00:02:58.100>So <00:02:58.333>and <00:02:58.566>this <00:02:58.799>debate <00:02:59.033>is <00:02:59.266>five <00:02:59.500>years

66
00:03:01.300 --> 00:03:04.200
<00:03:01.300>old <00:03:01.427>at <00:03:01.554>this <00:03:01.681>point <00:03:01.809>and <00:03:01.936>as <00:03:02.063>you <00:03:02.190>can <00:03:02.318>see <00:03:02.445>it <00:03:02.572>hasn't <00:03:02.700>been

67
00:03:04.200 --> 00:03:08.400
<00:03:04.200>closed <00:03:04.339>yet. <00:03:04.480>But <00:03:04.619>this <00:03:04.760>at <00:03:04.899>least <00:03:05.040>is <00:03:05.179>an <00:03:05.320>indicator <00:03:05.459>that <00:03:05.600>there

68
00:03:07.400 --> 00:03:10.300
<00:03:07.400>might <00:03:07.633>be <00:03:07.866>something <00:03:08.100>there <00:03:08.333>that <00:03:08.566>there <00:03:08.800>might

69
00:03:10.300 --> 00:03:13.300
<00:03:10.300>be <00:03:10.475>something <00:03:10.650>about <00:03:10.825>typescript <00:03:11.000>type <00:03:11.175>annotations <00:03:11.350>that <00:03:11.525>at <00:03:11.700>least

70
00:03:13.300 --> 00:03:16.300
<00:03:13.300>makes <00:03:13.500>it <00:03:13.700>reasonable <00:03:13.900>to <00:03:14.100>try <00:03:14.300>to <00:03:14.500>treat <00:03:14.700>them

71
00:03:16.300 --> 00:03:19.600
<00:03:16.300>as <00:03:16.440>a <00:03:16.580>programming <00:03:16.720>language <00:03:16.860>and <00:03:17.000>essentially <00:03:17.140>see <00:03:17.280>what <00:03:17.420>happens <00:03:17.560>and <00:03:17.700>this

72
00:03:19.600 --> 00:03:22.300
<00:03:19.600>is <00:03:19.739>what <00:03:19.880>we're <00:03:20.019>going <00:03:20.160>to <00:03:20.299>do <00:03:20.440>now. <00:03:20.579>Okay, <00:03:20.720>let's <00:03:20.859>learn <00:03:21.000>about

73
00:03:22.300 --> 00:03:25.400
<00:03:22.300>this <00:03:22.455>syntax <00:03:22.611>that <00:03:22.766>we <00:03:22.922>have <00:03:23.077>in <00:03:23.233>this <00:03:23.388>new <00:03:23.544>strange <00:03:23.700>programming

74
00:03:25.400 --> 00:03:28.200
<00:03:25.400>language <00:03:25.575>a <00:03:25.750>variable <00:03:25.925>in <00:03:26.100>JavaScript. <00:03:26.275>We've <00:03:26.450>already <00:03:26.625>seen <00:03:26.800>how

75
00:03:28.200 --> 00:03:31.800
<00:03:28.200>this <00:03:28.399>maps <00:03:28.600>to <00:03:28.799>type <00:03:29.000>alias <00:03:29.200>in <00:03:29.399>typescript <00:03:29.600>and

76
00:03:31.800 --> 00:03:34.200
<00:03:31.800>function <00:03:31.955>in <00:03:32.111>JavaScript. <00:03:32.266>We <00:03:32.422>have <00:03:32.577>seen <00:03:32.733>how <00:03:32.888>this <00:03:33.044>match <00:03:33.200>to

77
00:03:34.200 --> 00:03:37.300
<00:03:34.200>a <00:03:34.355>generic <00:03:34.511>type <00:03:34.666>or <00:03:34.822>a <00:03:34.977>type <00:03:35.133>function <00:03:35.288>as <00:03:35.444>I <00:03:35.600>like

78
00:03:37.300 --> 00:03:37.800
<00:03:37.300>to <00:03:37.525>call <00:03:37.750>it.

79
00:03:38.300 --> 00:03:38.700
now

80
00:03:39.600 --> 00:03:42.700
<00:03:39.600>a <00:03:39.799>function <00:03:40.000>call <00:03:40.200>is <00:03:40.400>obvious. <00:03:40.600>It's <00:03:40.799>basically <00:03:41.000>supplying

81
00:03:42.700 --> 00:03:45.300
<00:03:42.700>a <00:03:42.875>type <00:03:43.049>to <00:03:43.225>a <00:03:43.399>generic <00:03:43.575>type <00:03:43.750>basically <00:03:43.924>passing <00:03:44.100>a

82
00:03:45.300 --> 00:03:48.600
<00:03:45.300>type <00:03:45.475>pyramid <00:03:45.650>parameter <00:03:45.825>to <00:03:46.000>our <00:03:46.175>type <00:03:46.350>function <00:03:46.525>and <00:03:46.700>then

83
00:03:48.600 --> 00:03:51.200
<00:03:48.600>we <00:03:48.833>have <00:03:49.066>new <00:03:49.299>stuff <00:03:49.533>like <00:03:49.766>an <00:03:50.000>object

84
00:03:51.200 --> 00:03:54.800
<00:03:51.200>in <00:03:51.339>JavaScript. <00:03:51.480>How <00:03:51.619>do <00:03:51.760>we <00:03:51.899>model <00:03:52.040>an <00:03:52.179>object <00:03:52.320>in <00:03:52.459>not <00:03:52.600>JavaScript

85
00:03:54.800 --> 00:03:57.500
<00:03:54.800>but <00:03:54.975>typescript <00:03:55.150>types. <00:03:55.325>Well, <00:03:55.500>we <00:03:55.675>just <00:03:55.850>use <00:03:56.025>an <00:03:56.200>object

86
00:03:57.500 --> 00:04:00.800
<00:03:57.500>type <00:03:57.675>basically <00:03:57.850>the <00:03:58.025>same <00:03:58.200>thing <00:03:58.375>a <00:03:58.550>couple <00:03:58.725>of <00:03:58.900>keys

87
00:04:00.800 --> 00:04:01.700
<00:04:00.800>and <00:04:01.205>values, <00:04:01.609>okay.

88
00:04:02.800 --> 00:04:05.300
<00:04:02.800>How <00:04:03.000>do <00:04:03.200>we <00:04:03.400>access <00:04:03.600>members <00:04:03.800>inside <00:04:04.000>an <00:04:04.200>object

89
00:04:05.300 --> 00:04:08.800
<00:04:05.300>in <00:04:05.427>JavaScript? <00:04:05.554>We <00:04:05.681>just <00:04:05.809>go <00:04:05.936>some <00:04:06.063>object <00:04:06.190>dot <00:04:06.318>some <00:04:06.445>name <00:04:06.572>in <00:04:06.700>typescript.

90
00:04:09.500 --> 00:04:12.600
<00:04:09.500>it <00:04:09.616>looks <00:04:09.733>kind <00:04:09.850>of <00:04:09.966>similar <00:04:10.083>not <00:04:10.200>quite <00:04:10.316>the <00:04:10.433>same, <00:04:10.550>but <00:04:10.666>we <00:04:10.783>can <00:04:10.900>index

91
00:04:12.600 --> 00:04:15.300
<00:04:12.600>objects <00:04:12.950>by <00:04:13.299>supplying <00:04:13.650>something <00:04:14.000>like

92
00:04:17.300 --> 00:04:19.600
<00:04:17.300>a <00:04:17.766>string <00:04:18.233>literal <00:04:18.700>type

93
00:04:20.700 --> 00:04:23.800
<00:04:20.700>Okay, <00:04:20.933>and <00:04:21.166>finally, <00:04:21.399>there's <00:04:21.633>lists <00:04:21.866>in <00:04:22.099>JavaScript

94
00:04:23.800 --> 00:04:26.500
<00:04:23.800>arrays <00:04:24.033>to <00:04:24.266>be <00:04:24.500>specific. <00:04:24.733>Okay, <00:04:24.966>how <00:04:25.200>do

95
00:04:26.500 --> 00:04:26.700
we

96
00:04:27.200 --> 00:04:27.400
<00:04:27.200>Get <00:04:27.289>a <00:04:27.380>list.

97
00:04:28.400 --> 00:04:28.500
<00:04:28.400>at <00:04:28.445>script <00:04:28.490>well

98
00:04:30.100 --> 00:04:30.800
<00:04:30.100>error <00:04:30.415>type <00:04:30.730>in

99
00:04:32.900 --> 00:04:34.000
<00:04:32.900>Java <00:04:33.147>that's <00:04:33.395>much <00:04:33.642>more <00:04:33.890>interesting.

100
00:04:34.600 --> 00:04:34.800
basically

101
00:04:36.200 --> 00:04:39.100
<00:04:36.200>All <00:04:36.375>types <00:04:36.550>are <00:04:36.724>lists <00:04:36.900>essentially <00:04:37.075>and <00:04:37.250>hear <00:04:37.425>me <00:04:37.599>out.

102
00:04:39.800 --> 00:04:42.500
<00:04:39.800>A <00:04:39.975>is <00:04:40.150>a <00:04:40.325>type <00:04:40.500>Alias <00:04:40.675>to <00:04:40.850>a <00:04:41.025>single <00:04:41.200>type

103
00:04:42.500 --> 00:04:45.500
<00:04:42.500>literal <00:04:42.675>a <00:04:42.850>string <00:04:43.025>literal <00:04:43.200>in <00:04:43.375>this <00:04:43.550>case <00:04:43.725>fool. <00:04:43.900>And

104
00:04:45.500 --> 00:04:48.000
<00:04:45.500>this <00:04:45.655>is <00:04:45.811>a <00:04:45.966>record <00:04:46.122>type <00:04:46.277>just <00:04:46.433>an <00:04:46.588>object <00:04:46.744>keys <00:04:46.900>and

105
00:04:48.300 --> 00:04:49.100
<00:04:48.300>values <00:04:48.480>and <00:04:48.660>what <00:04:48.840>have <00:04:49.020>you

106
00:04:49.800 --> 00:04:52.700
<00:04:49.800>and <00:04:49.975>now <00:04:50.150>we <00:04:50.325>can <00:04:50.500>obviously <00:04:50.675>go <00:04:50.850>and <00:04:51.025>Index <00:04:51.200>this

107
00:04:52.700 --> 00:04:55.200
<00:04:52.700>record <00:04:52.875>using <00:04:53.050>our <00:04:53.224>type <00:04:53.400>Alias <00:04:53.575>a <00:04:53.750>and <00:04:53.925>we <00:04:54.099>get

108
00:04:55.200 --> 00:04:58.600
<00:04:55.200>back <00:04:55.307>number. <00:04:55.415>Why <00:04:55.523>do <00:04:55.630>we <00:04:55.738>get <00:04:55.846>back <00:04:55.953>number? <00:04:56.061>Well <00:04:56.169>in <00:04:56.276>this <00:04:56.384>record, <00:04:56.492>there's <00:04:56.599>a

109
00:04:58.600 --> 00:05:01.600
<00:04:58.600>name <00:04:58.700>called <00:04:58.800>who <00:04:58.900>which <00:04:59.000>contains <00:04:59.100>the <00:04:59.200>number <00:04:59.300>and <00:04:59.400>this <00:04:59.500>is <00:04:59.600>what <00:04:59.700>we <00:04:59.800>get <00:04:59.900>when <00:05:00.000>we

110
00:05:01.600 --> 00:05:03.600
<00:05:01.600>index <00:05:01.833>my <00:05:02.066>record <00:05:02.300>by <00:05:02.533>a <00:05:02.766>makes <00:05:03.000>sense.

111
00:05:04.700 --> 00:05:07.600
<00:05:04.700>But <00:05:04.933>something <00:05:05.166>like <00:05:05.400>type <00:05:05.633>A <00:05:05.866>doesn't <00:05:06.099>really

112
00:05:07.600 --> 00:05:10.500
<00:05:07.600>need <00:05:07.727>to <00:05:07.854>be <00:05:07.981>just <00:05:08.109>literal <00:05:08.236>type. <00:05:08.363>It <00:05:08.490>can <00:05:08.618>also <00:05:08.745>be <00:05:08.872>a <00:05:09.000>bunch

113
00:05:10.500 --> 00:05:13.100
<00:05:10.500>of <00:05:10.700>literal <00:05:10.900>types. <00:05:11.100>It <00:05:11.300>can <00:05:11.500>be <00:05:11.700>a <00:05:11.900>union

114
00:05:13.800 --> 00:05:16.000
<00:05:13.800>in <00:05:14.000>this <00:05:14.200>case <00:05:14.400>two <00:05:14.600>strings <00:05:14.800>full <00:05:15.000>and <00:05:15.200>Power

115
00:05:18.400 --> 00:05:20.900
<00:05:18.400>What <00:05:18.527>do <00:05:18.654>you <00:05:18.781>think <00:05:18.909>or <00:05:19.036>what? <00:05:19.163>Do <00:05:19.290>you <00:05:19.418>know? <00:05:19.545>What <00:05:19.672>happens <00:05:19.799>here?

116
00:05:21.600 --> 00:05:24.500
<00:05:21.600>We <00:05:21.775>index <00:05:21.950>my <00:05:22.125>record <00:05:22.300>by <00:05:22.475>b <00:05:22.650>b <00:05:22.825>containing <00:05:23.000>the

117
00:05:24.500 --> 00:05:27.500
<00:05:24.500>union <00:05:24.640>and <00:05:24.780>what <00:05:24.920>we <00:05:25.060>get <00:05:25.200>out <00:05:25.340>of <00:05:25.480>this <00:05:25.620>operation <00:05:25.760>is <00:05:25.900>a

118
00:05:27.500 --> 00:05:30.400
<00:05:27.500>union <00:05:27.733>of <00:05:27.966>various <00:05:28.200>essentially <00:05:28.433>all <00:05:28.666>the <00:05:28.900>types

119
00:05:30.400 --> 00:05:31.900
<00:05:30.400>on <00:05:30.592>the <00:05:30.785>right <00:05:30.978>hand <00:05:31.171>side <00:05:31.364>of <00:05:31.557>the <00:05:31.750>record.

120
00:05:33.100 --> 00:05:36.800
<00:05:33.100>What <00:05:33.255>this <00:05:33.411>means <00:05:33.566>in <00:05:33.722>essence <00:05:33.877>is <00:05:34.033>that <00:05:34.188>typescript <00:05:34.344>at <00:05:34.500>least

121
00:05:36.800 --> 00:05:39.500
<00:05:36.800>the <00:05:37.000>type <00:05:37.200>annotations <00:05:37.400>are <00:05:37.600>sort <00:05:37.800>of <00:05:38.000>list <00:05:38.200>based

122
00:05:39.500 --> 00:05:42.700
<00:05:39.500>programming <00:05:39.640>language. <00:05:39.780>You <00:05:39.920>don't <00:05:40.060>have <00:05:40.200>things <00:05:40.340>that <00:05:40.480>are <00:05:40.620>not <00:05:40.760>lists. <00:05:40.900>Everything

123
00:05:42.700 --> 00:05:45.700
<00:05:42.700>is <00:05:42.855>a <00:05:43.011>list. <00:05:43.166>You <00:05:43.322>just <00:05:43.477>usually <00:05:43.633>don't <00:05:43.788>notice <00:05:43.944>because <00:05:44.099>usually

124
00:05:45.700 --> 00:05:46.500
<00:05:45.700>your <00:05:45.940>types <00:05:46.180>are <00:05:46.420>just

125
00:05:47.300 --> 00:05:48.300
<00:05:47.300>list <00:05:47.600>of <00:05:47.900>one <00:05:48.200>member

126
00:05:49.900 --> 00:05:52.300
<00:05:49.900>Hey, <00:05:50.075>and <00:05:50.250>that's <00:05:50.424>interesting <00:05:50.599>all <00:05:50.775>types <00:05:50.950>are <00:05:51.125>sets <00:05:51.299>of

127
00:05:52.300 --> 00:05:55.900
<00:05:52.300>types <00:05:52.475>essentially <00:05:52.650>and <00:05:52.825>if <00:05:53.000>you <00:05:53.175>perform <00:05:53.350>any <00:05:53.525>operation <00:05:53.700>using

128
00:05:55.900 --> 00:05:58.600
<00:05:55.900>a <00:05:56.027>set <00:05:56.154>of <00:05:56.281>types <00:05:56.409>as <00:05:56.536>an <00:05:56.663>input, <00:05:56.790>you <00:05:56.918>get <00:05:57.045>back <00:05:57.172>a <00:05:57.299>set

129
00:05:58.600 --> 00:06:01.500
<00:05:58.600>of <00:05:58.716>types <00:05:58.833>if <00:05:58.950>the <00:05:59.066>output <00:05:59.183>so <00:05:59.300>we <00:05:59.416>don't <00:05:59.533>really <00:05:59.650>need <00:05:59.766>to <00:05:59.883>concern <00:06:00.000>ourselves

130
00:06:01.500 --> 00:06:04.500
<00:06:01.500>with <00:06:01.655>stuff <00:06:01.811>like <00:06:01.966>loops <00:06:02.122>and <00:06:02.277>so <00:06:02.433>on <00:06:02.588>because <00:06:02.744>why <00:06:02.900>wouldn't

131
00:06:04.500 --> 00:06:07.200
<00:06:04.500>we <00:06:04.600>need <00:06:04.700>to <00:06:04.800>why <00:06:04.900>wouldn't <00:06:05.000>you <00:06:05.100>that? <00:06:05.200>Why <00:06:05.300>would <00:06:05.400>we <00:06:05.500>need <00:06:05.600>Loops? <00:06:05.700>We <00:06:05.800>already <00:06:05.900>have

132
00:06:07.200 --> 00:06:08.700
<00:06:07.200>everything <00:06:07.875>in <00:06:08.550>lists.

133
00:06:09.300 --> 00:06:12.200
<00:06:09.300>Okay, <00:06:09.580>that's <00:06:09.860>nice <00:06:10.140>but <00:06:10.420>a <00:06:10.700>list.

134
00:06:12.900 --> 00:06:15.100
<00:06:12.900>As <00:06:13.099>far <00:06:13.299>as <00:06:13.500>we've <00:06:13.700>seen <00:06:13.900>it <00:06:14.099>till <00:06:14.299>now

135
00:06:15.100 --> 00:06:18.800
<00:06:15.100>is <00:06:15.207>always <00:06:15.315>a <00:06:15.423>list <00:06:15.530>with <00:06:15.638>something <00:06:15.746>in <00:06:15.853>this. <00:06:15.961>How <00:06:16.069>do <00:06:16.176>we <00:06:16.284>represent? <00:06:16.392>Nothing? <00:06:16.500>Well

136
00:06:18.800 --> 00:06:21.400
<00:06:18.800>in <00:06:19.000>JavaScript <00:06:19.200>we <00:06:19.400>have <00:06:19.600>not <00:06:19.800>and <00:06:20.000>we <00:06:20.200>also

137
00:06:21.400 --> 00:06:24.300
<00:06:21.400>have <00:06:21.555>undefined <00:06:21.711>which <00:06:21.866>is <00:06:22.022>by <00:06:22.177>JavaScript <00:06:22.333>is <00:06:22.488>the <00:06:22.644>best <00:06:22.799>programming

138
00:06:24.300 --> 00:06:27.300
<00:06:24.300>language <00:06:24.455>ever <00:06:24.611>because <00:06:24.766>two <00:06:24.922>ways <00:06:25.077>to <00:06:25.233>declare <00:06:25.388>nothing <00:06:25.544>is <00:06:25.700>better

139
00:06:27.300 --> 00:06:30.500
<00:06:27.300>than <00:06:27.427>one <00:06:27.554>way <00:06:27.681>to <00:06:27.809>declare <00:06:27.936>nothing <00:06:28.063>like <00:06:28.190>all <00:06:28.318>the <00:06:28.445>other <00:06:28.572>programming <00:06:28.700>languages

140
00:06:30.500 --> 00:06:30.900
have

141
00:06:31.400 --> 00:06:34.300
<00:06:31.400>Now <00:06:31.555>typescript <00:06:31.711>also <00:06:31.866>is <00:06:32.022>not <00:06:32.177>the <00:06:32.333>best <00:06:32.488>programming <00:06:32.644>language <00:06:32.799>because

142
00:06:34.300 --> 00:06:37.800
<00:06:34.300>there's <00:06:34.427>only <00:06:34.554>one <00:06:34.681>way <00:06:34.809>to <00:06:34.936>declare <00:06:35.063>nothing <00:06:35.190>and <00:06:35.318>this <00:06:35.445>is <00:06:35.572>never <00:06:35.700>this

143
00:06:37.800 --> 00:06:40.300
<00:06:37.800>is <00:06:37.975>a <00:06:38.150>type <00:06:38.325>which <00:06:38.500>essentially <00:06:38.675>is <00:06:38.850>an <00:06:39.025>empty <00:06:39.200>set.

144
00:06:40.300 --> 00:06:43.500
<00:06:40.300>It's <00:06:40.500>literally <00:06:40.700>nothing <00:06:40.900>there <00:06:41.100>can <00:06:41.300>be <00:06:41.500>no <00:06:41.700>value

145
00:06:43.500 --> 00:06:46.700
<00:06:43.500>that <00:06:43.850>ever <00:06:44.200>since <00:06:44.550>matches <00:06:44.900>never

146
00:06:46.700 --> 00:06:49.600
<00:06:46.700>because <00:06:46.875>you <00:06:47.050>know <00:06:47.224>never <00:06:47.400>doesn't <00:06:47.575>contain <00:06:47.750>anything. <00:06:47.925>It's <00:06:48.099>essentially

147
00:06:49.600 --> 00:06:50.700
<00:06:49.600>Nile <00:06:50.095>for <00:06:50.590>typescript.

148
00:06:51.300 --> 00:06:54.500
<00:06:51.300>And <00:06:51.455>then <00:06:51.611>that's <00:06:51.766>also <00:06:51.922>conditionals <00:06:52.077>if <00:06:52.233>and <00:06:52.388>else <00:06:52.544>but <00:06:52.700>we

149
00:06:54.500 --> 00:06:57.500
<00:06:54.500>don't <00:06:54.780>really <00:06:55.060>have <00:06:55.340>structured <00:06:55.620>programming <00:06:55.900>in

150
00:06:57.500 --> 00:07:00.800
<00:06:57.500>typescript <00:06:57.700>type <00:06:57.900>annotations, <00:06:58.100>but <00:06:58.300>we <00:06:58.500>have <00:06:58.700>conditionals <00:06:58.900>like

151
00:07:00.800 --> 00:07:01.000
this.

152
00:07:01.900 --> 00:07:04.900
<00:07:01.900>Extends <00:07:02.099>in <00:07:02.299>this <00:07:02.500>case <00:07:02.700>is <00:07:02.900>not <00:07:03.099>your <00:07:03.299>class.

153
00:07:04.900 --> 00:07:07.200
<00:07:04.900>Ax10b <00:07:05.599>ax10b <00:07:06.299>is

154
00:07:07.200 --> 00:07:10.500
<00:07:07.200>a <00:07:07.375>condition <00:07:07.550>and <00:07:07.724>this <00:07:07.900>condition <00:07:08.075>basically <00:07:08.250>asks, <00:07:08.425>if <00:07:08.599>a

155
00:07:10.500 --> 00:07:13.600
<00:07:10.500>is <00:07:10.627>assignable <00:07:10.754>to <00:07:10.881>B <00:07:11.009>with <00:07:11.136>A <00:07:11.263>and <00:07:11.390>B <00:07:11.518>both <00:07:11.645>being <00:07:11.772>types, <00:07:11.900>and

156
00:07:13.600 --> 00:07:16.400
<00:07:13.600>this <00:07:13.727>is <00:07:13.854>what <00:07:13.981>you <00:07:14.109>can <00:07:14.236>use <00:07:14.363>for <00:07:14.490>your <00:07:14.618>basic <00:07:14.745>control <00:07:14.872>flow <00:07:15.000>logic.

157
00:07:16.400 --> 00:07:19.400
<00:07:16.400>So <00:07:16.555>we <00:07:16.711>have <00:07:16.866>nothing <00:07:17.022>we <00:07:17.177>have <00:07:17.333>lists. <00:07:17.488>We <00:07:17.644>have <00:07:17.799>conditions.

158
00:07:20.100 --> 00:07:23.700
<00:07:20.100>Let's <00:07:20.255>build <00:07:20.411>our <00:07:20.566>first <00:07:20.722>serious <00:07:20.877>type <00:07:21.033>program. <00:07:21.188>Shall <00:07:21.344>we? <00:07:21.500>Well,

159
00:07:23.700 --> 00:07:26.300
<00:07:23.700>it's <00:07:23.855>not <00:07:24.011>going <00:07:24.166>to <00:07:24.322>be <00:07:24.477>that <00:07:24.633>serious, <00:07:24.788>but <00:07:24.944>it's <00:07:25.099>going

160
00:07:26.300 --> 00:07:30.000
<00:07:26.300>to <00:07:26.427>be <00:07:26.554>illustrative <00:07:26.681>of <00:07:26.809>the <00:07:26.936>vibe <00:07:27.063>that <00:07:27.190>I'm <00:07:27.318>going <00:07:27.445>for. <00:07:27.572>Okay, <00:07:27.700>let's

161
00:07:29.200 --> 00:07:32.600
<00:07:29.200>say <00:07:29.355>we <00:07:29.511>have <00:07:29.666>some <00:07:29.822>sort <00:07:29.977>of <00:07:30.133>input <00:07:30.288>type <00:07:30.444>a <00:07:30.599>list

162
00:07:32.600 --> 00:07:35.500
<00:07:32.600>of <00:07:32.800>tracks <00:07:33.000>a <00:07:33.200>union <00:07:33.400>of <00:07:33.600>types <00:07:33.800>essentially <00:07:34.000>and

163
00:07:35.500 --> 00:07:38.600
<00:07:35.500>our <00:07:35.733>goal <00:07:35.966>is <00:07:36.200>to <00:07:36.433>remove <00:07:36.666>null <00:07:36.900>from

164
00:07:38.600 --> 00:07:41.300
<00:07:38.600>this <00:07:38.833>set <00:07:39.066>essentially <00:07:39.300>performing <00:07:39.533>a <00:07:39.766>filtering <00:07:40.000>operation.

165
00:07:41.300 --> 00:07:44.600
<00:07:41.300>How <00:07:41.475>can <00:07:41.650>we <00:07:41.825>go <00:07:42.000>about <00:07:42.175>this? <00:07:42.350>Well <00:07:42.525>filtering <00:07:42.700>implies

166
00:07:44.600 --> 00:07:48.400
<00:07:44.600>a <00:07:44.755>function. <00:07:44.911>So <00:07:45.066>we <00:07:45.222>write <00:07:45.377>a <00:07:45.533>function <00:07:45.688>you <00:07:45.844>just <00:07:46.000>a

167
00:07:47.400 --> 00:07:50.700
<00:07:47.400>few <00:07:47.575>minutes <00:07:47.750>ago <00:07:47.924>would <00:07:48.099>have <00:07:48.275>said <00:07:48.450>this <00:07:48.625>that <00:07:48.799>type

168
00:07:50.700 --> 00:07:53.300
<00:07:50.700>no <00:07:50.827>would <00:07:50.954>be <00:07:51.081>a <00:07:51.209>type, <00:07:51.336>but <00:07:51.463>we <00:07:51.590>know <00:07:51.718>better <00:07:51.845>than <00:07:51.972>this <00:07:52.099>that's

169
00:07:53.300 --> 00:07:56.100
<00:07:53.300>not <00:07:53.427>a <00:07:53.554>type. <00:07:53.681>That's <00:07:53.809>a <00:07:53.936>function. <00:07:54.063>It <00:07:54.190>just <00:07:54.318>says <00:07:54.445>typically <00:07:54.572>in <00:07:54.700>front

170
00:07:56.100 --> 00:08:00.100
<00:07:56.100>of <00:07:56.227>it, <00:07:56.354>but <00:07:56.481>we <00:07:56.609>don't <00:07:56.736>care <00:07:56.863>and <00:07:56.990>then <00:07:57.118>we <00:07:57.245>filter <00:07:57.372>type <00:07:57.500>argument

171
00:07:59.100 --> 00:08:02.500
<00:07:59.100>T <00:07:59.380>and <00:07:59.660>by <00:07:59.940>essentially <00:08:00.220>asking <00:08:00.500>if

172
00:08:02.500 --> 00:08:05.300
<00:08:02.500>it <00:08:02.675>is <00:08:02.850>assignable <00:08:03.025>to <00:08:03.200>naiah <00:08:03.375>if <00:08:03.550>it's <00:08:03.725>assignable <00:08:03.900>tunnel,

173
00:08:05.300 --> 00:08:08.500
<00:08:05.300>we <00:08:05.427>turn <00:08:05.554>it <00:08:05.681>into <00:08:05.809>never <00:08:05.936>and <00:08:06.063>if <00:08:06.190>it's <00:08:06.318>not <00:08:06.445>assignable <00:08:06.572>and <00:08:06.700>we

174
00:08:08.500 --> 00:08:11.300
<00:08:08.500>keep <00:08:08.675>it <00:08:08.850>St. <00:08:09.025>The <00:08:09.200>output <00:08:09.375>in <00:08:09.550>this <00:08:09.725>case <00:08:09.900>is

175
00:08:11.300 --> 00:08:14.500
<00:08:11.300>as <00:08:11.533>follows. <00:08:11.766>We <00:08:12.000>call <00:08:12.233>no <00:08:12.466>null <00:08:12.700>to

176
00:08:14.500 --> 00:08:17.200
<00:08:14.500>passing <00:08:14.675>the <00:08:14.850>input <00:08:15.025>type <00:08:15.200>into <00:08:15.375>it <00:08:15.550>and <00:08:15.725>we <00:08:15.900>get

177
00:08:17.200 --> 00:08:19.500
<00:08:17.200>back <00:08:17.550>just <00:08:17.900>string <00:08:18.250>and <00:08:18.599>now

178
00:08:20.400 --> 00:08:22.400
<00:08:20.400>League <00:08:20.599>goes <00:08:20.799>away. <00:08:21.000>How <00:08:21.200>does <00:08:21.400>this <00:08:21.599>happen? <00:08:21.799>Well,

179
00:08:23.200 --> 00:08:26.200
<00:08:23.200>We <00:08:23.375>pass <00:08:23.550>in <00:08:23.724>this <00:08:23.900>Union <00:08:24.075>remember <00:08:24.250>that <00:08:24.425>if <00:08:24.599>we

180
00:08:26.200 --> 00:08:29.300
<00:08:26.200>input <00:08:26.355>a <00:08:26.511>bunch <00:08:26.666>of <00:08:26.822>types <00:08:26.977>in <00:08:27.133>form <00:08:27.288>of <00:08:27.444>a <00:08:27.599>union

181
00:08:29.300 --> 00:08:32.100
<00:08:29.300>essentially <00:08:29.440>if <00:08:29.580>we <00:08:29.720>pass <00:08:29.860>a <00:08:30.000>list <00:08:30.140>we <00:08:30.280>get <00:08:30.420>back <00:08:30.560>a <00:08:30.700>list

182
00:08:32.100 --> 00:08:36.100
<00:08:32.100>and <00:08:32.216>this <00:08:32.333>list <00:08:32.450>in <00:08:32.566>this <00:08:32.683>case <00:08:32.800>comes <00:08:32.916>to <00:08:33.033>be <00:08:33.150>by <00:08:33.266>first <00:08:33.383>taking <00:08:33.500>string

183
00:08:35.100 --> 00:08:37.400
<00:08:35.100>passing <00:08:35.450>it <00:08:35.800>through <00:08:36.150>the <00:08:36.500>conditional.

184
00:08:38.300 --> 00:08:41.700
<00:08:38.299>Noticing <00:08:38.474>that <00:08:38.650>string <00:08:38.824>is <00:08:39.000>in <00:08:39.174>fact <00:08:39.349>not <00:08:39.525>assignable <00:08:39.699>to

185
00:08:41.700 --> 00:08:44.700
<00:08:41.700>numb <00:08:41.900>now. <00:08:42.100>So <00:08:42.300>we <00:08:42.500>keep <00:08:42.700>string <00:08:42.900>but <00:08:43.100>null

186
00:08:44.700 --> 00:08:47.000
<00:08:44.700>is <00:08:44.900>assignable <00:08:45.100>to <00:08:45.300>null. <00:08:45.500>So <00:08:45.700>it <00:08:45.900>maps <00:08:46.100>to

187
00:08:47.200 --> 00:08:50.700
<00:08:47.200>never <00:08:47.340>never <00:08:47.480>is <00:08:47.620>the <00:08:47.760>empty <00:08:47.900>set. <00:08:48.040>So <00:08:48.180>never <00:08:48.320>doesn't <00:08:48.460>add <00:08:48.600>anything

188
00:08:50.700 --> 00:08:53.600
<00:08:50.700>to <00:08:50.875>the <00:08:51.050>output <00:08:51.225>the <00:08:51.400>output <00:08:51.575>is <00:08:51.750>essentially <00:08:51.925>string <00:08:52.100>plus

189
00:08:53.600 --> 00:08:56.100
<00:08:53.600>never <00:08:53.800>which <00:08:54.000>is <00:08:54.200>string <00:08:54.400>bam <00:08:54.600>our <00:08:54.800>first <00:08:55.000>program.

190
00:08:56.900 --> 00:08:59.300
<00:08:56.900>Looks <00:08:57.074>like <00:08:57.250>a <00:08:57.425>type, <00:08:57.600>but <00:08:57.775>it's <00:08:57.949>actually <00:08:58.125>a <00:08:58.300>function.

191
00:08:59.300 --> 00:09:02.300
<00:08:59.300>It's <00:08:59.455>a <00:08:59.611>filtering <00:08:59.766>function <00:08:59.922>and <00:09:00.077>I <00:09:00.233>could <00:09:00.388>go <00:09:00.544>on <00:09:00.699>and

192
00:09:02.300 --> 00:09:05.300
<00:09:02.300>on <00:09:02.407>about <00:09:02.515>this <00:09:02.623>with <00:09:02.730>you <00:09:02.838>know, <00:09:02.946>it's <00:09:03.053>a <00:09:03.161>function <00:09:03.269>we <00:09:03.376>can <00:09:03.484>do <00:09:03.592>recursion <00:09:03.699>and

193
00:09:05.300 --> 00:09:06.500
<00:09:05.300>stuff, <00:09:05.516>but <00:09:05.732>I'm <00:09:05.948>not <00:09:06.164>going <00:09:06.380>to

194
00:09:07.800 --> 00:09:09.700
<00:09:07.800>because <00:09:08.079>I <00:09:08.359>think <00:09:08.640>the <00:09:08.920>key <00:09:09.199>takeaway.

195
00:09:11.200 --> 00:09:14.700
<00:09:11.200>Has <00:09:11.400>been <00:09:11.600>is <00:09:11.800>obvious <00:09:12.000>by <00:09:12.200>now. <00:09:12.400>We <00:09:12.600>can

196
00:09:14.700 --> 00:09:17.200
<00:09:14.700>treat <00:09:14.933>type <00:09:15.166>annotations <00:09:15.400>as <00:09:15.633>a <00:09:15.866>programming <00:09:16.100>language

197
00:09:17.200 --> 00:09:20.500
<00:09:17.200>as <00:09:17.400>a <00:09:17.600>functional <00:09:17.800>programming <00:09:18.000>language <00:09:18.200>that <00:09:18.400>set-based <00:09:18.600>and

198
00:09:20.500 --> 00:09:23.100
<00:09:20.500>that <00:09:20.733>basically <00:09:20.966>can <00:09:21.200>do <00:09:21.433>anything <00:09:21.666>we <00:09:21.900>want.

199
00:09:24.300 --> 00:09:27.400
<00:09:24.300>Okay, <00:09:24.533>that's <00:09:24.766>nice, <00:09:25.000>but <00:09:25.233>one <00:09:25.466>quite <00:09:25.699>important

200
00:09:27.400 --> 00:09:28.300
<00:09:27.400>question <00:09:28.209>remains.

201
00:09:30.000 --> 00:09:30.500
Why?

202
00:09:32.400 --> 00:09:35.700
<00:09:32.400>Why <00:09:32.516>would <00:09:32.633>we <00:09:32.750>want <00:09:32.866>to <00:09:32.983>do <00:09:33.100>this? <00:09:33.216>I <00:09:33.333>mean, <00:09:33.449>it's <00:09:33.566>fun, <00:09:33.683>but <00:09:33.800>this

203
00:09:35.700 --> 00:09:36.400
<00:09:35.700>can <00:09:35.910>be <00:09:36.120>the <00:09:36.329>reason.

204
00:09:37.300 --> 00:09:40.400
<00:09:37.300>I <00:09:37.474>have <00:09:37.650>a <00:09:37.824>slightly <00:09:38.000>better <00:09:38.175>reason <00:09:38.349>than <00:09:38.525>just <00:09:38.699>it's

205
00:09:40.400 --> 00:09:40.600
fun.

206
00:09:42.300 --> 00:09:45.000
<00:09:42.300>I <00:09:42.439>would <00:09:42.579>like <00:09:42.719>to <00:09:42.859>extend <00:09:43.000>this <00:09:43.140>question <00:09:43.280>to <00:09:43.420>why <00:09:43.560>do <00:09:43.699>we

207
00:09:45.300 --> 00:09:48.400
<00:09:45.300>even <00:09:45.455>use <00:09:45.611>any <00:09:45.766>higher <00:09:45.922>level <00:09:46.077>programming <00:09:46.233>language <00:09:46.388>at <00:09:46.544>all? <00:09:46.699>And

208
00:09:48.400 --> 00:09:51.400
<00:09:48.400>I'm <00:09:48.600>not <00:09:48.800>making <00:09:49.000>a <00:09:49.199>joke <00:09:49.400>here. <00:09:49.600>I'm <00:09:49.800>being

209
00:09:51.400 --> 00:09:52.400
<00:09:51.400>serious. <00:09:51.850>I <00:09:52.300>mean

210
00:09:53.100 --> 00:09:56.100
<00:09:53.100>Of <00:09:53.255>course, <00:09:53.411>we <00:09:53.566>could <00:09:53.722>in <00:09:53.877>theory <00:09:54.033>write <00:09:54.188>code <00:09:54.344>like <00:09:54.500>this

211
00:09:56.100 --> 00:09:59.500
<00:09:56.100>like <00:09:56.275>The <00:09:56.450>Honorable <00:09:56.625>ancestors <00:09:56.800>used <00:09:56.975>to <00:09:57.150>do <00:09:57.325>but <00:09:57.500>I

212
00:09:59.500 --> 00:10:00.100
<00:09:59.500>don't <00:09:59.635>want <00:09:59.770>to <00:09:59.905>do <00:10:00.040>this.

213
00:10:00.500 --> 00:10:02.800
<00:10:00.500>I <00:10:00.655>want <00:10:00.811>to <00:10:00.966>write <00:10:01.122>my <00:10:01.277>code <00:10:01.433>like <00:10:01.588>something <00:10:01.744>like <00:10:01.900>this.

214
00:10:03.900 --> 00:10:05.200
<00:10:03.900>Makes <00:10:04.134>much <00:10:04.368>more <00:10:04.602>sense <00:10:04.836>to <00:10:05.070>me.

215
00:10:05.900 --> 00:10:07.000
<00:10:05.900>and <00:10:06.230>I <00:10:06.560>think <00:10:06.890>that's

216
00:10:08.300 --> 00:10:11.700
<00:10:08.300>consensus <00:10:08.500>in <00:10:08.699>this <00:10:08.900>room. <00:10:09.099>I <00:10:09.300>hope <00:10:09.500>consensus <00:10:09.699>and

217
00:10:11.700 --> 00:10:14.500
<00:10:11.700>that <00:10:11.855>building <00:10:12.011>things <00:10:12.166>on <00:10:12.322>top <00:10:12.477>of <00:10:12.633>other <00:10:12.788>things <00:10:12.944>is <00:10:13.100>generally

218
00:10:14.500 --> 00:10:17.400
<00:10:14.500>good. <00:10:14.700>It's <00:10:14.900>better <00:10:15.100>than <00:10:15.300>just <00:10:15.500>writing <00:10:15.700>stuff <00:10:15.900>down

219
00:10:17.400 --> 00:10:20.900
<00:10:17.400>because <00:10:17.540>the <00:10:17.680>things <00:10:17.819>that <00:10:17.959>we <00:10:18.100>build <00:10:18.240>on <00:10:18.380>top <00:10:18.520>of <00:10:18.660>classes <00:10:18.800>and

220
00:10:20.900 --> 00:10:24.100
<00:10:20.900>functions <00:10:21.133>and <00:10:21.366>modules <00:10:21.600>help <00:10:21.833>us <00:10:22.066>to <00:10:22.300>essentially

221
00:10:23.100 --> 00:10:26.200
<00:10:23.100>talk <00:10:23.333>about <00:10:23.566>our <00:10:23.800>program <00:10:24.033>in <00:10:24.266>terms <00:10:24.500>of

222
00:10:26.200 --> 00:10:29.100
<00:10:26.200>business <00:10:26.375>logic. <00:10:26.550>We <00:10:26.725>have <00:10:26.900>a <00:10:27.075>car <00:10:27.250>that <00:10:27.425>represents <00:10:27.600>something

223
00:10:29.100 --> 00:10:32.400
<00:10:29.100>we <00:10:29.240>have <00:10:29.380>a <00:10:29.520>function <00:10:29.660>that <00:10:29.800>does <00:10:29.940>something <00:10:30.080>we <00:10:30.220>have <00:10:30.360>higher <00:10:30.500>level

224
00:10:32.400 --> 00:10:35.600
<00:10:32.400>constructs <00:10:32.527>and <00:10:32.654>if <00:10:32.781>we <00:10:32.909>stitch <00:10:33.036>these <00:10:33.163>higher <00:10:33.290>level <00:10:33.418>constructs <00:10:33.545>together, <00:10:33.672>we <00:10:33.800>get

225
00:10:35.600 --> 00:10:38.500
<00:10:35.600>back <00:10:35.800>a <00:10:36.000>program <00:10:36.200>that <00:10:36.400>we <00:10:36.600>can <00:10:36.800>reason <00:10:37.000>about

226
00:10:39.500 --> 00:10:42.000
<00:10:39.500>So <00:10:39.733>this <00:10:39.966>is <00:10:40.200>you <00:10:40.433>know <00:10:40.666>basic <00:10:40.900>programming.

227
00:10:43.500 --> 00:10:46.200
<00:10:43.500>If <00:10:43.733>we <00:10:43.966>draw <00:10:44.200>a <00:10:44.433>nice <00:10:44.666>little <00:10:44.900>chart

228
00:10:46.200 --> 00:10:49.500
<00:10:46.200>with <00:10:46.355>how <00:10:46.511>we <00:10:46.666>would <00:10:46.822>write <00:10:46.977>a <00:10:47.133>program <00:10:47.288>you <00:10:47.444>have <00:10:47.600>some

229
00:10:49.500 --> 00:10:52.500
<00:10:49.500>class <00:10:49.616>you <00:10:49.733>have <00:10:49.850>some <00:10:49.966>other <00:10:50.083>class <00:10:50.200>that <00:10:50.316>extends <00:10:50.433>from <00:10:50.550>the <00:10:50.666>Base <00:10:50.783>Class <00:10:50.900>A

230
00:10:52.500 --> 00:10:55.500
<00:10:52.500>bunch <00:10:52.640>of <00:10:52.780>functions <00:10:52.920>that <00:10:53.060>call <00:10:53.200>other <00:10:53.340>functions <00:10:53.480>and <00:10:53.620>everything <00:10:53.760>comes <00:10:53.900>together

231
00:10:55.500 --> 00:10:58.800
<00:10:55.500>in <00:10:55.780>class <00:10:56.060>B, <00:10:56.340>then <00:10:56.620>this <00:10:56.900>is

232
00:10:58.800 --> 00:11:01.500
<00:10:58.800>essentially <00:10:59.033>describes <00:10:59.266>our <00:10:59.500>business <00:10:59.733>logic <00:10:59.966>and <00:11:00.199>this

233
00:11:01.500 --> 00:11:04.200
<00:11:01.500>is <00:11:01.627>usually <00:11:01.754>where <00:11:01.881>it <00:11:02.009>starts. <00:11:02.136>We <00:11:02.263>have <00:11:02.390>a <00:11:02.518>bunch <00:11:02.645>of <00:11:02.772>functions <00:11:02.900>and

234
00:11:04.200 --> 00:11:07.400
<00:11:04.200>a <00:11:04.316>bunch <00:11:04.433>of <00:11:04.550>classes <00:11:04.666>a <00:11:04.783>bunch <00:11:04.900>of <00:11:05.016>Concepts <00:11:05.133>that <00:11:05.250>we <00:11:05.366>throw <00:11:05.483>together <00:11:05.600>and

235
00:11:07.400 --> 00:11:10.500
<00:11:07.400>get <00:11:07.527>back <00:11:07.654>a <00:11:07.781>sort <00:11:07.909>of <00:11:08.036>coil <00:11:08.163>graph <00:11:08.290>like <00:11:08.418>this <00:11:08.545>and <00:11:08.672>then <00:11:08.800>because

236
00:11:10.500 --> 00:11:13.100
<00:11:10.500>this <00:11:10.655>is <00:11:10.811>typescript, <00:11:10.966>we <00:11:11.122>add <00:11:11.277>a <00:11:11.433>bunch <00:11:11.588>of <00:11:11.744>times, <00:11:11.900>right?

237
00:11:13.700 --> 00:11:16.900
<00:11:13.700>45 <00:11:13.980>or <00:11:14.260>functions <00:11:14.540>that <00:11:14.820>signatures <00:11:15.100>basically

238
00:11:16.900 --> 00:11:18.400
<00:11:16.900>enforce <00:11:17.574>API <00:11:18.250>contracts

239
00:11:19.200 --> 00:11:20.600
<00:11:19.200>This <00:11:19.380>is <00:11:19.560>what <00:11:19.740>the <00:11:19.920>types <00:11:20.100>of <00:11:20.280>fall <00:11:20.460>right?

240
00:11:21.500 --> 00:11:25.000
<00:11:21.500>Okay, <00:11:21.733>so <00:11:21.966>we <00:11:22.200>have <00:11:22.433>the <00:11:22.666>API <00:11:22.900>contracts.

241
00:11:24.200 --> 00:11:27.300
<00:11:24.200>We <00:11:24.400>have <00:11:24.600>the <00:11:24.800>rules <00:11:25.000>that <00:11:25.200>are <00:11:25.400>enforced <00:11:25.600>by

242
00:11:27.300 --> 00:11:30.100
<00:11:27.300>the <00:11:27.500>functions. <00:11:27.699>Let's <00:11:27.900>take <00:11:28.099>this <00:11:28.300>whole <00:11:28.500>runtime <00:11:28.699>stuff

243
00:11:30.100 --> 00:11:32.500
<00:11:30.100>away <00:11:30.300>and <00:11:30.500>let's <00:11:30.700>talk <00:11:30.900>about <00:11:31.100>just <00:11:31.300>the <00:11:31.500>functions.

244
00:11:34.300 --> 00:11:37.500
<00:11:34.300>Why <00:11:34.500>are <00:11:34.699>signature <00:11:34.900>F <00:11:35.099>signature <00:11:35.300>g <00:11:35.500>and <00:11:35.699>type

245
00:11:37.500 --> 00:11:40.900
<00:11:37.500>A <00:11:37.850>our <00:11:38.200>basic <00:11:38.550>types <00:11:38.900>from

246
00:11:40.900 --> 00:11:43.600
<00:11:40.900>which <00:11:41.180>we <00:11:41.459>do <00:11:41.740>right <00:11:42.020>everything <00:11:42.300>else?

247
00:11:45.100 --> 00:11:48.500
<00:11:45.100>Why <00:11:45.240>do <00:11:45.380>they <00:11:45.520>exist <00:11:45.660>why <00:11:45.800>do <00:11:45.940>you <00:11:46.080>write <00:11:46.220>the <00:11:46.360>function <00:11:46.500>signature

248
00:11:48.500 --> 00:11:51.200
<00:11:48.500>for <00:11:48.655>your <00:11:48.811>most <00:11:48.966>basic <00:11:49.122>function <00:11:49.277>for <00:11:49.433>your <00:11:49.588>most <00:11:49.744>basic <00:11:49.900>class?

249
00:11:52.600 --> 00:11:56.100
<00:11:52.600>Is <00:11:52.755>it <00:11:52.911>just <00:11:53.066>because <00:11:53.222>you <00:11:53.377>want <00:11:53.533>to <00:11:53.688>make <00:11:53.844>the <00:11:54.000>compiler

250
00:11:55.100 --> 00:11:56.600
<00:11:55.100>stop <00:11:56.450>complaining?

251
00:11:58.300 --> 00:12:01.700
<00:11:58.300>Or <00:11:58.416>is <00:11:58.533>it <00:11:58.650>something <00:11:58.766>else <00:11:58.883>is <00:11:59.000>it <00:11:59.116>that <00:11:59.233>you <00:11:59.349>want <00:11:59.466>to <00:11:59.583>enforce <00:11:59.699>certain

252
00:12:01.700 --> 00:12:03.500
<00:12:01.700>rules <00:12:02.050>about <00:12:02.400>your <00:12:02.750>entire <00:12:03.100>program?

253
00:12:04.200 --> 00:12:07.700
<00:12:04.200>And <00:12:04.400>that's <00:12:04.600>should <00:12:04.800>be <00:12:05.000>in <00:12:05.200>an <00:12:05.400>ideal <00:12:05.600>situation.

254
00:12:07.700 --> 00:12:10.400
<00:12:07.700>What <00:12:07.855>you <00:12:08.011>want <00:12:08.166>to <00:12:08.322>do, <00:12:08.477>right <00:12:08.633>you <00:12:08.788>have <00:12:08.944>rules <00:12:09.100>about

255
00:12:10.400 --> 00:12:12.600
<00:12:10.400>your <00:12:10.574>business <00:12:10.750>logic <00:12:10.925>and <00:12:11.100>you <00:12:11.275>want <00:12:11.449>to <00:12:11.625>enforce <00:12:11.800>them?

256
00:12:13.200 --> 00:12:16.800
<00:12:13.200>Then <00:12:13.400>why <00:12:13.600>ladies <00:12:13.800>and <00:12:14.000>gentlemen <00:12:14.200>don't <00:12:14.400>we <00:12:14.600>write

257
00:12:16.800 --> 00:12:19.400
<00:12:16.800>a <00:12:16.939>bunch <00:12:17.079>of <00:12:17.219>types <00:12:17.359>that <00:12:17.500>are <00:12:17.640>not <00:12:17.780>really <00:12:17.920>typed <00:12:18.060>that <00:12:18.199>are

258
00:12:19.400 --> 00:12:22.800
<00:12:19.400>meant <00:12:19.555>to <00:12:19.711>be <00:12:19.866>used <00:12:20.022>together <00:12:20.177>with <00:12:20.333>runtime <00:12:20.488>objects, <00:12:20.644>but <00:12:20.800>there

259
00:12:22.800 --> 00:12:25.300
<00:12:22.800>are <00:12:23.079>fewer <00:12:23.359>rules <00:12:23.640>just <00:12:23.920>rules <00:12:24.199>about

260
00:12:25.300 --> 00:12:28.200
<00:12:25.300>our <00:12:25.474>business <00:12:25.650>logic <00:12:25.824>from <00:12:26.000>which <00:12:26.175>we <00:12:26.349>do <00:12:26.525>arrive <00:12:26.699>our

261
00:12:28.200 --> 00:12:28.800
<00:12:28.200>actual <00:12:28.740>types.

262
00:12:29.800 --> 00:12:32.700
<00:12:29.800>Note <00:12:30.033>that <00:12:30.266>rules <00:12:30.500>on <00:12:30.733>top <00:12:30.966>there <00:12:31.199>does

263
00:12:32.700 --> 00:12:35.700
<00:12:32.700>not <00:12:32.933>have <00:12:33.166>any <00:12:33.400>clear <00:12:33.633>area <00:12:33.866>inside <00:12:34.100>itself.

264
00:12:35.700 --> 00:12:38.500
<00:12:35.700>That's <00:12:35.933>because <00:12:36.166>there's <00:12:36.400>no <00:12:36.633>runtime <00:12:36.866>object <00:12:37.100>that

265
00:12:38.500 --> 00:12:42.700
<00:12:38.500>the <00:12:38.733>type <00:12:38.966>rules <00:12:39.200>will <00:12:39.433>ever <00:12:39.666>be <00:12:39.900>assigned

266
00:12:41.700 --> 00:12:42.800
to

267
00:12:43.400 --> 00:12:46.400
<00:12:43.400>It's <00:12:43.555>always <00:12:43.711>going <00:12:43.866>to <00:12:44.022>be <00:12:44.177>just <00:12:44.333>typescript <00:12:44.488>just <00:12:44.644>basic <00:12:44.800>rules

268
00:12:46.400 --> 00:12:50.000
<00:12:46.400>and <00:12:46.527>from <00:12:46.654>base <00:12:46.781>and <00:12:46.909>from <00:12:47.036>basic <00:12:47.163>rules. <00:12:47.290>We <00:12:47.418>can <00:12:47.545>be <00:12:47.672>derive <00:12:47.800>types

269
00:12:49.200 --> 00:12:52.300
<00:12:49.200>for <00:12:49.355>our <00:12:49.511>Everyday <00:12:49.666>Use <00:12:49.822>and <00:12:49.977>this <00:12:50.133>is <00:12:50.288>what <00:12:50.444>we're <00:12:50.600>going

270
00:12:52.300 --> 00:12:53.800
<00:12:52.300>to <00:12:52.637>do <00:12:52.974>right <00:12:53.312>now. <00:12:53.650>So.

271
00:12:54.500 --> 00:12:57.800
<00:12:54.500>let's <00:12:54.733>take <00:12:54.966>a <00:12:55.200>program <00:12:55.433>problem <00:12:55.666>and <00:12:55.900>programming

272
00:12:57.800 --> 00:13:00.800
<00:12:57.800>and <00:12:58.033>try <00:12:58.266>to <00:12:58.500>extract <00:12:58.733>The <00:12:58.966>Core <00:12:59.199>Business

273
00:13:00.800 --> 00:13:03.000
<00:13:00.800>logic <00:13:01.079>rules <00:13:01.359>into <00:13:01.640>types <00:13:01.920>types <00:13:02.199>and

274
00:13:03.100 --> 00:13:06.000
<00:13:03.100>quotes <00:13:03.207>because <00:13:03.315>these <00:13:03.423>are <00:13:03.530>not <00:13:03.638>types <00:13:03.746>for <00:13:03.853>any <00:13:03.961>kind <00:13:04.069>of <00:13:04.176>object <00:13:04.284>any <00:13:04.392>kind <00:13:04.500>of

275
00:13:06.300 --> 00:13:08.000
<00:13:06.300>function, <00:13:06.533>but <00:13:06.766>there's <00:13:07.000>these <00:13:07.233>are <00:13:07.466>really <00:13:07.699>just

276
00:13:09.700 --> 00:13:12.500
<00:13:09.700>Basically <00:13:09.840>types <00:13:09.980>for <00:13:10.120>types <00:13:10.260>sort <00:13:10.400>of <00:13:10.540>kind <00:13:10.680>of <00:13:10.820>not <00:13:10.960>really <00:13:11.100>we're

277
00:13:12.500 --> 00:13:15.300
<00:13:12.500>going <00:13:12.675>to <00:13:12.850>see <00:13:13.025>how <00:13:13.200>this <00:13:13.375>all <00:13:13.550>works <00:13:13.725>and <00:13:13.900>then

278
00:13:15.300 --> 00:13:18.300
<00:13:15.300>for <00:13:15.427>our <00:13:15.554>real <00:13:15.681>types <00:13:15.809>that <00:13:15.936>we <00:13:16.063>want <00:13:16.190>to <00:13:16.318>use <00:13:16.445>in <00:13:16.572>our <00:13:16.699>everyday

279
00:13:18.300 --> 00:13:21.800
<00:13:18.300>programming <00:13:18.439>we <00:13:18.579>derive <00:13:18.719>them <00:13:18.859>from <00:13:19.000>the <00:13:19.140>roots. <00:13:19.280>We <00:13:19.420>just <00:13:19.560>don't <00:13:19.699>write

280
00:13:21.800 --> 00:13:24.700
<00:13:21.800>them <00:13:21.974>down, <00:13:22.150>but <00:13:22.324>we <00:13:22.500>arrive <00:13:22.675>them <00:13:22.849>from <00:13:23.025>if <00:13:23.199>not

281
00:13:24.700 --> 00:13:27.500
<00:13:24.700>first <00:13:24.875>principles, <00:13:25.050>then <00:13:25.225>at <00:13:25.400>least <00:13:25.575>our <00:13:25.750>own <00:13:25.925>first <00:13:26.100>principle

282
00:13:27.500 --> 00:13:30.500
<00:13:27.500>rules, <00:13:27.733>and <00:13:27.966>then <00:13:28.200>we <00:13:28.433>have <00:13:28.666>consistent <00:13:28.900>typing

283
00:13:30.500 --> 00:13:33.800
<00:13:30.500>and <00:13:30.966>generally <00:13:31.433>an <00:13:31.900>excuse

284
00:13:33.800 --> 00:13:35.900
<00:13:33.800>to <00:13:34.033>use <00:13:34.266>type <00:13:34.500>level <00:13:34.733>programming <00:13:34.966>in <00:13:35.199>typescript.

285
00:13:36.600 --> 00:13:38.100
<00:13:36.600>And <00:13:36.792>that's <00:13:36.985>what <00:13:37.178>we <00:13:37.371>are <00:13:37.564>here <00:13:37.757>for <00:13:37.950>right?

286
00:13:38.800 --> 00:13:41.500
<00:13:38.800>Now <00:13:39.033>this <00:13:39.266>may <00:13:39.500>sound <00:13:39.733>complicated, <00:13:39.966>but <00:13:40.199>it

287
00:13:41.500 --> 00:13:42.400
<00:13:41.500>doesn't <00:13:41.702>have <00:13:41.905>to <00:13:42.107>be <00:13:42.310>complicated.

288
00:13:43.900 --> 00:13:46.000
<00:13:43.900>Talking <00:13:44.100>about <00:13:44.300>complicated <00:13:44.500>and <00:13:44.699>let <00:13:44.900>me <00:13:45.100>tell <00:13:45.300>you

289
00:13:46.300 --> 00:13:50.000
<00:13:46.300>a <00:13:46.455>story <00:13:46.611>how <00:13:46.766>I <00:13:46.922>came <00:13:47.077>onto <00:13:47.233>this <00:13:47.388>path <00:13:47.544>of <00:13:47.699>type-based

290
00:13:49.000 --> 00:13:50.200
programming.

291
00:13:50.800 --> 00:13:51.400
<00:13:50.800>and <00:13:51.339>because

292
00:13:52.200 --> 00:13:55.500
<00:13:52.200>I <00:13:52.355>did <00:13:52.511>something <00:13:52.666>that <00:13:52.822>was <00:13:52.977>not <00:13:53.133>the <00:13:53.288>best <00:13:53.444>idea <00:13:53.600>ever.

293
00:13:56.500 --> 00:13:59.500
<00:13:56.500>Because <00:13:56.700>I <00:13:56.900>set <00:13:57.100>out <00:13:57.300>to <00:13:57.500>write <00:13:57.700>a <00:13:57.900>browser

294
00:13:59.500 --> 00:14:00.100
extension.

295
00:14:01.700 --> 00:14:04.500
<00:14:01.700>If <00:14:01.840>you <00:14:01.980>take <00:14:02.120>away <00:14:02.260>from <00:14:02.400>this <00:14:02.540>talk <00:14:02.680>only <00:14:02.820>one <00:14:02.960>thing <00:14:03.100>keep

296
00:14:04.500 --> 00:14:07.800
<00:14:04.500>away <00:14:04.733>from <00:14:04.966>writing <00:14:05.200>browser <00:14:05.433>extensions <00:14:05.666>doesn't <00:14:05.900>matter

297
00:14:07.800 --> 00:14:10.200
<00:14:07.800>if <00:14:07.974>it's <00:14:08.150>chrome <00:14:08.324>doesn't <00:14:08.500>matter <00:14:08.675>if <00:14:08.849>it's <00:14:09.025>Firefox. <00:14:09.199>It's

298
00:14:10.200 --> 00:14:12.700
<00:14:10.200>awful <00:14:10.433>and <00:14:10.666>the <00:14:10.900>documentation <00:14:11.133>is <00:14:11.366>not <00:14:11.600>existent.

299
00:14:13.700 --> 00:14:16.400
<00:14:13.700>Why <00:14:13.900>is <00:14:14.100>it <00:14:14.300>awful? <00:14:14.500>Well <00:14:14.700>the <00:14:14.900>browser <00:14:15.100>extension

300
00:14:16.400 --> 00:14:19.000
<00:14:16.400>in <00:14:16.574>today's <00:14:16.750>world <00:14:16.925>essentially <00:14:17.100>consists <00:14:17.275>of <00:14:17.449>a <00:14:17.625>bunch <00:14:17.800>of

301
00:14:19.600 --> 00:14:22.500
<00:14:19.600>websites <00:14:19.755>in <00:14:19.911>my <00:14:20.066>case. <00:14:20.222>The <00:14:20.377>browser <00:14:20.533>extension <00:14:20.688>was <00:14:20.844>an <00:14:21.000>extension

302
00:14:22.500 --> 00:14:25.700
<00:14:22.500>to <00:14:22.675>Chrome's <00:14:22.850>devtools <00:14:23.025>panel. <00:14:23.200>So <00:14:23.375>I <00:14:23.550>had <00:14:23.725>a <00:14:23.900>devtools

303
00:14:25.700 --> 00:14:28.300
<00:14:25.700>panel <00:14:25.900>and <00:14:26.100>an <00:14:26.300>objects <00:14:26.500>page <00:14:26.700>for <00:14:26.900>checking <00:14:27.100>a

304
00:14:28.300 --> 00:14:31.500
<00:14:28.300>bunch <00:14:28.439>of <00:14:28.579>boxes <00:14:28.719>a <00:14:28.859>Content <00:14:29.000>script <00:14:29.140>A <00:14:29.280>toolbar <00:14:29.420>button <00:14:29.560>and <00:14:29.699>much

305
00:14:31.500 --> 00:14:34.400
<00:14:31.500>more <00:14:31.675>stuff <00:14:31.850>and <00:14:32.025>all <00:14:32.200>of <00:14:32.375>these <00:14:32.550>websites <00:14:32.725>are <00:14:32.900>completely

306
00:14:34.400 --> 00:14:36.500
<00:14:34.400>isolated <00:14:34.633>from <00:14:34.866>each <00:14:35.100>other. <00:14:35.333>These <00:14:35.566>are <00:14:35.800>essentially

307
00:14:37.300 --> 00:14:40.600
<00:14:37.300>Microscopically <00:14:37.579>small <00:14:37.859>JavaScript <00:14:38.140>runtimes <00:14:38.420>that <00:14:38.699>need

308
00:14:40.600 --> 00:14:43.300
<00:14:40.600>to <00:14:40.775>talk <00:14:40.950>to <00:14:41.125>each <00:14:41.300>other <00:14:41.475>through <00:14:41.650>message <00:14:41.825>passing <00:14:42.000>through

309
00:14:43.300 --> 00:14:46.500
<00:14:43.300>post <00:14:43.500>message <00:14:43.699>essentially <00:14:43.900>and <00:14:44.099>not <00:14:44.300>directly <00:14:44.500>mind <00:14:44.699>you

310
00:14:46.500 --> 00:14:49.500
<00:14:46.500>everything <00:14:46.655>has <00:14:46.811>to <00:14:46.966>be <00:14:47.122>hundred <00:14:47.277>through <00:14:47.433>one <00:14:47.588>of <00:14:47.744>these <00:14:47.900>little

311
00:14:49.500 --> 00:14:52.200
<00:14:49.500>websites <00:14:49.780>this <00:14:50.060>proxy <00:14:50.340>background <00:14:50.620>script <00:14:50.900>thing

312
00:14:52.200 --> 00:14:55.900
<00:14:52.200>there. <00:14:52.327>That's <00:14:52.454>a <00:14:52.581>bunch <00:14:52.709>of <00:14:52.836>fun. <00:14:52.963>Especially <00:14:53.090>if <00:14:53.218>you <00:14:53.345>consider <00:14:53.472>that <00:14:53.600>browse

313
00:14:55.900 --> 00:14:57.300
<00:14:55.900>us <00:14:56.110>tend <00:14:56.319>to <00:14:56.530>have <00:14:56.740>more <00:14:56.949>than <00:14:57.160>one.

314
00:14:58.500 --> 00:15:01.500
<00:14:58.500>Tap <00:14:58.640>or <00:14:58.780>one <00:14:58.920>more <00:14:59.060>than <00:14:59.200>one <00:14:59.340>window <00:14:59.480>and <00:14:59.620>then <00:14:59.760>you <00:14:59.900>are

315
00:15:01.500 --> 00:15:04.300
<00:15:01.500>tiny <00:15:01.675>little <00:15:01.850>browser <00:15:02.025>extension <00:15:02.200>turns <00:15:02.375>into <00:15:02.550>a <00:15:02.725>monstrosity <00:15:02.900>of

316
00:15:04.300 --> 00:15:08.200
<00:15:04.300>a <00:15:04.439>distributed <00:15:04.579>system <00:15:04.719>and <00:15:04.859>you <00:15:05.000>go <00:15:05.140>crazy <00:15:05.280>about <00:15:05.420>it, <00:15:05.560>ah <00:15:05.699>typescript

317
00:15:07.200 --> 00:15:10.200
<00:15:07.200>to <00:15:07.375>the <00:15:07.550>rescue <00:15:07.725>where <00:15:07.900>typescript <00:15:08.075>doesn't <00:15:08.250>really <00:15:08.425>have <00:15:08.600>that

318
00:15:10.200 --> 00:15:13.900
<00:15:10.200>much <00:15:10.355>because <00:15:10.511>it's <00:15:10.666>our <00:15:10.822>distributed. <00:15:10.977>Every <00:15:11.133>little <00:15:11.288>website <00:15:11.444>is <00:15:11.600>its

319
00:15:13.900 --> 00:15:14.400
<00:15:13.900>own <00:15:14.125>little <00:15:14.350>thing.

320
00:15:15.100 --> 00:15:18.300
<00:15:15.100>So, <00:15:15.216>how <00:15:15.333>can <00:15:15.450>we <00:15:15.566>make <00:15:15.683>this <00:15:15.800>more <00:15:15.916>type <00:15:16.033>safe? <00:15:16.150>Well, <00:15:16.266>let's <00:15:16.383>figure <00:15:16.500>out

321
00:15:18.300 --> 00:15:19.000
<00:15:18.300>the <00:15:18.930>core.

322
00:15:20.500 --> 00:15:23.400
<00:15:20.500>Challenge <00:15:20.675>with <00:15:20.850>our <00:15:21.025>business <00:15:21.200>logic <00:15:21.375>here <00:15:21.550>and <00:15:21.725>the <00:15:21.900>quad

323
00:15:23.400 --> 00:15:26.800
<00:15:23.400>Challenge <00:15:23.600>and <00:15:23.800>well <00:15:24.000>surprise <00:15:24.199>you <00:15:24.400>is <00:15:24.600>message <00:15:24.800>passing.

324
00:15:26.800 --> 00:15:29.000
<00:15:26.800>So <00:15:27.079>let's <00:15:27.359>reason <00:15:27.640>about <00:15:27.920>message <00:15:28.199>passing.

325
00:15:29.800 --> 00:15:32.800
<00:15:29.800>First <00:15:30.000>and <00:15:30.199>first <00:15:30.400>let's <00:15:30.599>say <00:15:30.800>that <00:15:31.000>every <00:15:31.199>object

326
00:15:32.800 --> 00:15:36.100
<00:15:32.800>that <00:15:32.955>we <00:15:33.111>want <00:15:33.266>to <00:15:33.422>pass <00:15:33.577>around <00:15:33.733>has <00:15:33.888>to <00:15:34.044>look <00:15:34.199>something

327
00:15:35.100 --> 00:15:38.500
<00:15:35.100>like <00:15:35.300>this <00:15:35.500>be <00:15:35.700>an <00:15:35.900>object <00:15:36.100>with <00:15:36.300>a <00:15:36.500>field

328
00:15:38.500 --> 00:15:41.700
<00:15:38.500>kind <00:15:38.640>which <00:15:38.780>is <00:15:38.920>a <00:15:39.060>string <00:15:39.200>and <00:15:39.340>some <00:15:39.480>sort <00:15:39.620>of <00:15:39.760>payload <00:15:39.900>which

329
00:15:41.700 --> 00:15:42.900
<00:15:41.700>contains <00:15:41.970>some <00:15:42.240>sort <00:15:42.510>of <00:15:42.780>data.

330
00:15:44.200 --> 00:15:47.300
<00:15:44.200>And <00:15:44.327>this <00:15:44.454>is <00:15:44.581>what <00:15:44.709>we're <00:15:44.836>going <00:15:44.963>to <00:15:45.090>pass <00:15:45.218>around. <00:15:45.345>Okay, <00:15:45.472>that's <00:15:45.600>easy.

331
00:15:47.300 --> 00:15:49.800
<00:15:47.300>I <00:15:47.416>could <00:15:47.533>even <00:15:47.650>write <00:15:47.766>a <00:15:47.883>type <00:15:48.000>for <00:15:48.116>this, <00:15:48.233>but <00:15:48.349>I'm <00:15:48.466>not <00:15:48.583>going <00:15:48.699>to

332
00:15:51.900 --> 00:15:53.100
<00:15:51.900>let <00:15:52.260>me <00:15:52.620>first <00:15:52.980>just

333
00:15:53.900 --> 00:15:56.400
<00:15:53.900>Just <00:15:54.133>start <00:15:54.366>implementing <00:15:54.600>and <00:15:54.833>then <00:15:55.066>figuring <00:15:55.300>out

334
00:15:56.400 --> 00:15:59.700
<00:15:56.400>the <00:15:56.574>types <00:15:56.750>as <00:15:56.925>we <00:15:57.100>go. <00:15:57.275>Okay. <00:15:57.449>So <00:15:57.625>postmessage <00:15:57.800>is

335
00:15:59.700 --> 00:16:02.200
<00:15:59.700>garbage. <00:15:59.875>So <00:16:00.050>let's <00:16:00.225>try <00:16:00.400>to <00:16:00.575>wrap <00:16:00.750>our <00:16:00.925>object <00:16:01.100>around

336
00:16:02.200 --> 00:16:03.700
<00:16:02.200>it <00:16:02.537>a <00:16:02.875>nice <00:16:03.212>little <00:16:03.550>class.

337
00:16:04.300 --> 00:16:07.500
<00:16:04.300>And <00:16:04.474>then <00:16:04.650>let's <00:16:04.824>Implement <00:16:05.000>a <00:16:05.175>sent <00:16:05.349>method <00:16:05.525>like <00:16:05.699>this.

338
00:16:08.200 --> 00:16:11.600
<00:16:08.200>Now <00:16:08.433>this <00:16:08.666>sort <00:16:08.900>of <00:16:09.133>works <00:16:09.366>this <00:16:09.600>method

339
00:16:11.600 --> 00:16:14.400
<00:16:11.600>method <00:16:11.833>returns. <00:16:12.066>Nothing <00:16:12.300>takes <00:16:12.533>a <00:16:12.766>kind <00:16:13.000>which

340
00:16:14.400 --> 00:16:17.300
<00:16:14.400>is <00:16:14.540>the <00:16:14.680>kind <00:16:14.819>field <00:16:14.959>in <00:16:15.100>our <00:16:15.240>message <00:16:15.380>object <00:16:15.520>and <00:16:15.660>a <00:16:15.800>matching

341
00:16:17.300 --> 00:16:17.700
payload.

342
00:16:18.600 --> 00:16:21.600
<00:16:18.600>And <00:16:18.755>then <00:16:18.911>we <00:16:19.066>need <00:16:19.222>to <00:16:19.377>receive <00:16:19.533>messages <00:16:19.688>using <00:16:19.844>this <00:16:20.000>on

343
00:16:21.600 --> 00:16:24.800
<00:16:21.600>method <00:16:21.833>takes <00:16:22.066>a <00:16:22.300>string <00:16:22.533>kind <00:16:22.766>and <00:16:23.000>takes

344
00:16:24.800 --> 00:16:27.600
<00:16:24.800>an <00:16:25.033>event <00:16:25.266>handler <00:16:25.500>that <00:16:25.733>essentially <00:16:25.966>takes <00:16:26.199>the

345
00:16:27.600 --> 00:16:30.300
<00:16:27.600>takes <00:16:27.755>the <00:16:27.911>payloads <00:16:28.066>and <00:16:28.222>delivers <00:16:28.377>them <00:16:28.533>back <00:16:28.688>to <00:16:28.844>whoever <00:16:29.000>called

346
00:16:30.300 --> 00:16:30.600
on.

347
00:16:31.500 --> 00:16:34.200
<00:16:31.500>Looks <00:16:31.733>kind <00:16:31.966>of <00:16:32.200>reasonable <00:16:32.433>right? <00:16:32.666>I <00:16:32.900>mean

348
00:16:34.200 --> 00:16:36.000
<00:16:34.200>it's <00:16:35.600>strings.

349
00:16:36.600 --> 00:16:39.300
<00:16:36.600>on <00:16:36.800>the <00:16:37.000>kind <00:16:37.200>field <00:16:37.400>and <00:16:37.600>it's <00:16:37.800>payloads <00:16:38.000>that

350
00:16:40.800 --> 00:16:43.100
<00:16:40.800>could <00:16:41.079>be <00:16:41.359>anything <00:16:41.640>but <00:16:41.920>could <00:16:42.199>they

351
00:16:43.100 --> 00:16:43.900
<00:16:43.100>really <00:16:43.460>be <00:16:43.819>anything?

352
00:16:44.900 --> 00:16:46.400
<00:16:44.900>I <00:16:45.125>mean, <00:16:45.350>what's <00:16:45.574>the <00:16:45.800>correct <00:16:46.025>type <00:16:46.250>here?

353
00:16:47.100 --> 00:16:47.400
Well

354
00:16:48.600 --> 00:16:51.600
<00:16:48.600>Probably <00:16:48.800>there's <00:16:49.000>a <00:16:49.200>finite <00:16:49.400>number <00:16:49.600>of <00:16:49.800>messages <00:16:50.000>of

355
00:16:51.600 --> 00:16:54.500
<00:16:51.600>message <00:16:51.880>types <00:16:52.160>of <00:16:52.440>message <00:16:52.720>kinds <00:16:53.000>that

356
00:16:54.500 --> 00:16:55.600
<00:16:54.500>you <00:16:54.698>want <00:16:54.896>to <00:16:55.094>send <00:16:55.292>around, <00:16:55.490>right?

357
00:16:56.700 --> 00:16:59.300
<00:16:56.700>Then <00:16:56.933>we <00:16:57.166>should <00:16:57.400>probably <00:16:57.633>write <00:16:57.866>this <00:16:58.100>down

358
00:16:59.300 --> 00:17:02.200
<00:16:59.300>somewhere <00:16:59.474>and <00:16:59.650>not <00:16:59.824>just <00:17:00.000>in <00:17:00.175>some <00:17:00.349>documentation <00:17:00.525>that <00:17:00.699>no

359
00:17:02.200 --> 00:17:02.700
<00:17:02.200>one's <00:17:02.350>going <00:17:02.500>to <00:17:02.650>read.

360
00:17:03.500 --> 00:17:04.400
<00:17:03.500>Let's <00:17:03.770>write <00:17:04.040>a <00:17:04.310>type.

361
00:17:06.300 --> 00:17:09.600
<00:17:06.300>This <00:17:06.427>is <00:17:06.554>not <00:17:06.681>a <00:17:06.809>type <00:17:06.936>that <00:17:07.063>will <00:17:07.190>ever <00:17:07.318>have <00:17:07.445>a <00:17:07.572>corresponding <00:17:07.700>runtime

362
00:17:09.600 --> 00:17:12.500
<00:17:09.599>object. <00:17:09.833>This <00:17:10.066>is <00:17:10.300>just <00:17:10.533>rules. <00:17:10.766>It's <00:17:11.000>essentially

363
00:17:12.500 --> 00:17:15.500
<00:17:12.500>how <00:17:12.780>kinds <00:17:13.060>relate <00:17:13.339>to <00:17:13.619>payloads <00:17:13.900>how

364
00:17:15.500 --> 00:17:18.500
<00:17:15.500>the <00:17:15.627>left <00:17:15.754>hand <00:17:15.881>side <00:17:16.009>and <00:17:16.136>the <00:17:16.263>right <00:17:16.390>hand <00:17:16.518>side <00:17:16.645>play <00:17:16.772>together. <00:17:16.900>No,

365
00:17:18.500 --> 00:17:21.300
<00:17:18.500>this <00:17:18.700>is <00:17:18.900>obviously <00:17:19.099>a <00:17:19.300>kind <00:17:19.500>of <00:17:19.700>short <00:17:19.900>and

366
00:17:21.300 --> 00:17:24.400
<00:17:21.300>simple <00:17:21.474>example <00:17:21.649>the <00:17:21.825>reality <00:17:22.000>for <00:17:22.175>my <00:17:22.349>browser <00:17:22.524>extension <00:17:22.700>was

367
00:17:24.400 --> 00:17:27.500
<00:17:24.400>much <00:17:24.575>much <00:17:24.750>much <00:17:24.925>much <00:17:25.100>much <00:17:25.275>more <00:17:25.450>complicated, <00:17:25.625>but <00:17:25.800>you

368
00:17:27.500 --> 00:17:30.700
<00:17:27.500>get <00:17:27.675>the <00:17:27.849>idea. <00:17:28.025>These <00:17:28.200>are <00:17:28.375>the <00:17:28.550>rules <00:17:28.725>and <00:17:28.900>we

369
00:17:30.700 --> 00:17:33.600
<00:17:30.700>can <00:17:30.933>use <00:17:31.166>the <00:17:31.400>rules <00:17:31.633>to <00:17:31.866>derive <00:17:32.100>the

370
00:17:33.600 --> 00:17:36.600
<00:17:33.600>signature <00:17:33.879>for <00:17:34.159>our <00:17:34.439>sent <00:17:34.719>method. <00:17:35.000>Okay,

371
00:17:36.600 --> 00:17:39.400
<00:17:36.600>let's <00:17:36.800>go <00:17:37.000>and <00:17:37.199>do <00:17:37.399>this <00:17:37.600>first <00:17:37.800>let's <00:17:38.000>make

372
00:17:39.400 --> 00:17:42.100
<00:17:39.400>this <00:17:39.575>message <00:17:39.750>for <00:17:39.925>generic <00:17:40.100>because <00:17:40.275>you <00:17:40.450>know, <00:17:40.625>why <00:17:40.800>not?

373
00:17:42.900 --> 00:17:45.500
<00:17:42.900>And <00:17:43.055>this <00:17:43.211>should <00:17:43.366>work <00:17:43.522>with <00:17:43.677>any <00:17:43.833>type <00:17:43.988>of <00:17:44.144>payload <00:17:44.300>map

374
00:17:45.500 --> 00:17:49.100
<00:17:45.500>and <00:17:45.616>not <00:17:45.733>just <00:17:45.850>with <00:17:45.966>the <00:17:46.083>payload <00:17:46.200>map. <00:17:46.316>That's <00:17:46.433>right <00:17:46.550>above <00:17:46.666>the <00:17:46.783>class. <00:17:46.900>Okay

375
00:17:48.100 --> 00:17:51.500
<00:17:48.100>looks <00:17:48.449>good. <00:17:48.800>But <00:17:49.149>P <00:17:49.500>could

376
00:17:51.500 --> 00:17:54.100
<00:17:51.500>now <00:17:51.616>be <00:17:51.733>anything <00:17:51.850>P <00:17:51.966>could <00:17:52.083>be <00:17:52.200>a <00:17:52.316>number <00:17:52.433>could <00:17:52.550>be <00:17:52.666>a <00:17:52.783>string. <00:17:52.900>We

377
00:17:54.100 --> 00:17:57.500
<00:17:54.100>we <00:17:54.274>don't <00:17:54.449>want <00:17:54.625>this <00:17:54.800>but <00:17:54.975>let's <00:17:55.149>constrain <00:17:55.324>P2 <00:17:55.500>a

378
00:17:57.500 --> 00:18:00.800
<00:17:57.500>record <00:17:57.675>type. <00:17:57.850>Let's <00:17:58.025>constrain <00:17:58.200>P <00:17:58.375>to <00:17:58.550>something <00:17:58.725>that <00:17:58.900>is

379
00:18:00.800 --> 00:18:03.900
<00:18:00.800>assignable <00:18:01.000>to <00:18:01.200>any <00:18:01.399>object <00:18:01.600>that <00:18:01.800>has <00:18:02.000>strings <00:18:02.200>on

380
00:18:03.900 --> 00:18:06.100
<00:18:03.900>the <00:18:04.055>left <00:18:04.211>hand <00:18:04.366>side <00:18:04.522>and <00:18:04.677>could <00:18:04.833>have <00:18:04.988>whatever <00:18:05.144>on <00:18:05.300>the

381
00:18:06.100 --> 00:18:06.600
<00:18:06.100>right <00:18:06.324>hand <00:18:06.550>side.

382
00:18:07.200 --> 00:18:10.700
<00:18:07.200>Whatever <00:18:07.307>on <00:18:07.415>the <00:18:07.523>right <00:18:07.630>hand <00:18:07.738>side <00:18:07.846>doesn't <00:18:07.953>mean <00:18:08.061>it's <00:18:08.169>any <00:18:08.276>it <00:18:08.384>must <00:18:08.492>be <00:18:08.600>assignable

383
00:18:10.700 --> 00:18:13.400
<00:18:10.700>to <00:18:10.840>any <00:18:10.980>so <00:18:11.120>it <00:18:11.260>could <00:18:11.400>be <00:18:11.540>anything <00:18:11.680>but <00:18:11.820>it's <00:18:11.960>not <00:18:12.100>strictly

384
00:18:13.400 --> 00:18:14.400
<00:18:13.400>any <00:18:13.850>by <00:18:14.300>itself.

385
00:18:15.100 --> 00:18:18.600
<00:18:15.100>Okay. <00:18:15.274>Now <00:18:15.449>the <00:18:15.625>interesting <00:18:15.800>bit <00:18:15.975>is <00:18:16.149>that <00:18:16.324>P <00:18:16.500>is

386
00:18:18.600 --> 00:18:21.100
<00:18:18.600>now <00:18:18.774>a <00:18:18.949>type <00:18:19.125>parameter <00:18:19.300>a <00:18:19.475>type <00:18:19.649>that <00:18:19.824>we <00:18:20.000>can

387
00:18:21.100 --> 00:18:23.600
<00:18:21.100>use <00:18:21.255>and <00:18:21.411>send <00:18:21.566>and <00:18:21.722>we <00:18:21.877>can <00:18:22.033>use <00:18:22.188>it <00:18:22.344>for <00:18:22.500>this.

388
00:18:25.400 --> 00:18:27.500
<00:18:25.400>This <00:18:25.633>looks <00:18:25.866>freaky. <00:18:26.100>What's <00:18:26.333>going <00:18:26.566>on? <00:18:26.800>Well.

389
00:18:28.700 --> 00:18:31.800
<00:18:28.700>key <00:18:28.933>off <00:18:29.166>is <00:18:29.400>an <00:18:29.633>operator <00:18:29.866>and <00:18:30.100>that

390
00:18:31.800 --> 00:18:34.400
<00:18:31.800>you <00:18:32.033>have <00:18:32.266>in <00:18:32.500>typescript <00:18:32.733>types <00:18:32.966>sort <00:18:33.200>of

391
00:18:34.400 --> 00:18:35.400
<00:18:34.400>like <00:18:34.850>type <00:18:35.300>of

392
00:18:36.300 --> 00:18:39.400
<00:18:36.300>but <00:18:36.427>not <00:18:36.554>kind <00:18:36.681>not <00:18:36.809>quite <00:18:36.936>I <00:18:37.063>mean <00:18:37.190>type <00:18:37.318>of <00:18:37.445>existence <00:18:37.572>JavaScript <00:18:37.700>but

393
00:18:39.400 --> 00:18:42.700
<00:18:39.400>there's <00:18:39.527>also <00:18:39.654>type <00:18:39.781>of <00:18:39.909>in <00:18:40.036>typescript <00:18:40.163>which <00:18:40.290>is <00:18:40.418>something <00:18:40.545>entirely <00:18:40.672>different <00:18:40.800>hence

394
00:18:42.700 --> 00:18:45.600
<00:18:42.700>this <00:18:42.900>exactly <00:18:43.100>identical <00:18:43.300>name. <00:18:43.500>No <00:18:43.700>no <00:18:43.900>key <00:18:44.100>of

395
00:18:45.600 --> 00:18:48.300
<00:18:45.600>works <00:18:45.755>like <00:18:45.911>this <00:18:46.066>key <00:18:46.222>off <00:18:46.377>as <00:18:46.533>an <00:18:46.688>operator <00:18:46.844>applied <00:18:47.000>to

396
00:18:48.300 --> 00:18:51.400
<00:18:48.300>an <00:18:48.427>object <00:18:48.554>type <00:18:48.681>and <00:18:48.809>P <00:18:48.936>is <00:18:49.063>an <00:18:49.190>object <00:18:49.318>type <00:18:49.445>because <00:18:49.572>we <00:18:49.700>have

397
00:18:51.400 --> 00:18:54.400
<00:18:51.400>constrained <00:18:51.540>it <00:18:51.680>to <00:18:51.820>be <00:18:51.960>an <00:18:52.100>object <00:18:52.240>type <00:18:52.380>and <00:18:52.520>he <00:18:52.660>off <00:18:52.800>returns

398
00:18:54.400 --> 00:18:58.100
<00:18:54.400>a <00:18:54.633>union <00:18:54.866>of <00:18:55.100>all <00:18:55.333>possible <00:18:55.566>keys <00:18:55.800>on

399
00:18:57.100 --> 00:19:00.300
<00:18:57.100>this <00:18:57.274>object <00:18:57.449>in <00:18:57.625>the <00:18:57.800>case <00:18:57.975>of <00:18:58.149>payload <00:18:58.324>map. <00:18:58.500>This

400
00:19:00.300 --> 00:19:02.600
<00:19:00.300>would <00:19:00.475>be <00:19:00.649>a <00:19:00.825>union <00:19:01.000>consisting <00:19:01.175>of <00:19:01.350>question <00:19:01.524>and <00:19:01.700>answer.

401
00:19:04.700 --> 00:19:08.400
<00:19:04.700>And <00:19:04.933>this <00:19:05.166>entire <00:19:05.400>constraint <00:19:05.633>here <00:19:05.866>essentially <00:19:06.100>forces

402
00:19:07.400 --> 00:19:10.900
<00:19:07.400>whoever <00:19:07.680>calls <00:19:07.960>sent <00:19:08.240>to <00:19:08.520>supply <00:19:08.800>4K

403
00:19:10.900 --> 00:19:13.400
<00:19:10.900>a <00:19:11.180>string. <00:19:11.460>That's <00:19:11.740>either <00:19:12.020>question <00:19:12.300>or

404
00:19:13.400 --> 00:19:16.800
<00:19:13.400>answer. <00:19:13.575>It's <00:19:13.750>not <00:19:13.925>written <00:19:14.100>like <00:19:14.275>this <00:19:14.450>because <00:19:14.625>the <00:19:14.800>strings

405
00:19:16.800 --> 00:19:19.400
<00:19:16.800>come <00:19:16.940>from <00:19:17.080>the <00:19:17.220>object <00:19:17.360>and <00:19:17.500>the <00:19:17.639>object <00:19:17.780>could <00:19:17.919>be <00:19:18.060>extended <00:19:18.200>at

406
00:19:19.400 --> 00:19:21.600
<00:19:19.400>any <00:19:19.575>time, <00:19:19.750>but <00:19:19.925>this <00:19:20.100>is <00:19:20.275>essentially <00:19:20.450>what <00:19:20.625>this <00:19:20.800>means.

407
00:19:23.100 --> 00:19:26.700
<00:19:23.100>And <00:19:23.240>this <00:19:23.379>is <00:19:23.520>quite <00:19:23.659>nice <00:19:23.800>because <00:19:23.939>now <00:19:24.080>whoever <00:19:24.219>called <00:19:24.360>scent <00:19:24.500>must

408
00:19:26.700 --> 00:19:29.500
<00:19:26.700>Supply <00:19:26.933>as <00:19:27.166>the <00:19:27.400>first <00:19:27.633>argument <00:19:27.866>question <00:19:28.100>or

409
00:19:29.500 --> 00:19:31.200
<00:19:29.500>answer <00:19:29.850>nothing <00:19:30.200>else <00:19:30.550>is <00:19:30.900>valid.

410
00:19:31.700 --> 00:19:34.900
<00:19:31.700>and <00:19:31.980>if <00:19:32.260>this <00:19:32.540>hypothetical <00:19:32.820>column <00:19:33.100>decides

411
00:19:34.900 --> 00:19:36.000
<00:19:34.900>to <00:19:35.147>use <00:19:35.395>question <00:19:35.642>or <00:19:35.890>answer

412
00:19:36.600 --> 00:19:39.300
<00:19:36.600>The <00:19:36.879>color <00:19:37.159>also <00:19:37.439>needs <00:19:37.719>to <00:19:38.000>supply

413
00:19:39.300 --> 00:19:42.700
<00:19:39.300>the <00:19:39.455>correct <00:19:39.611>payload, <00:19:39.766>right? <00:19:39.922>We <00:19:40.077>know <00:19:40.233>that <00:19:40.388>K <00:19:40.544>is <00:19:40.700>a

414
00:19:42.700 --> 00:19:45.300
<00:19:42.700>key <00:19:42.875>of <00:19:43.050>P <00:19:43.225>so <00:19:43.400>we <00:19:43.575>can <00:19:43.750>Index <00:19:43.925>P <00:19:44.100>by

415
00:19:45.300 --> 00:19:49.000
<00:19:45.300>K <00:19:45.455>and <00:19:45.611>get <00:19:45.766>back <00:19:45.922>the <00:19:46.077>correct <00:19:46.233>payload <00:19:46.388>for <00:19:46.544>this <00:19:46.700>specific.

416
00:19:51.100 --> 00:19:54.400
<00:19:51.100>Message <00:19:51.300>kind <00:19:51.500>so <00:19:51.699>there's <00:19:51.899>no <00:19:52.100>way <00:19:52.300>to <00:19:52.500>call

417
00:19:54.400 --> 00:19:57.500
<00:19:54.400>this <00:19:54.555>method <00:19:54.711>in <00:19:54.866>any <00:19:55.022>way <00:19:55.177>that <00:19:55.333>violet <00:19:55.488>or <00:19:55.644>protocol. <00:19:55.800>It's

418
00:19:57.500 --> 00:20:00.300
<00:19:57.500>impossible. <00:19:57.733>I <00:19:57.966>mean <00:19:58.200>that's <00:19:58.433>not <00:19:58.666>a <00:19:58.900>huge

419
00:20:00.300 --> 00:20:03.300
<00:20:00.300>feat. <00:20:00.416>You <00:20:00.533>could <00:20:00.649>just <00:20:00.766>you <00:20:00.883>know <00:20:01.000>overload <00:20:01.116>this <00:20:01.233>method <00:20:01.350>two <00:20:01.466>times, <00:20:01.583>but <00:20:01.700>this

420
00:20:03.300 --> 00:20:06.600
<00:20:03.300>is <00:20:03.455>much <00:20:03.611>nicer <00:20:03.766>because <00:20:03.922>it <00:20:04.077>refers <00:20:04.233>to <00:20:04.388>some <00:20:04.544>base <00:20:04.700>truth

421
00:20:06.600 --> 00:20:08.200
<00:20:06.600>that <00:20:06.879>we've <00:20:07.159>encoded <00:20:07.439>in <00:20:07.719>our <00:20:08.000>payload.

422
00:20:08.900 --> 00:20:11.500
<00:20:08.900>Okay, <00:20:09.133>let's <00:20:09.366>create <00:20:09.600>a <00:20:09.833>message <00:20:10.066>port <00:20:10.300>and

423
00:20:11.500 --> 00:20:14.700
<00:20:11.500>let's <00:20:11.655>let's <00:20:11.811>send <00:20:11.966>a <00:20:12.122>bunch <00:20:12.277>of <00:20:12.433>messages. <00:20:12.588>Okay <00:20:12.744>this <00:20:12.900>works

424
00:20:14.700 --> 00:20:17.800
<00:20:14.700>but <00:20:14.875>this <00:20:15.050>is <00:20:15.225>ugly. <00:20:15.400>I <00:20:15.575>mean, <00:20:15.750>there's <00:20:15.925>question <00:20:16.100>the

425
00:20:17.800 --> 00:20:20.400
<00:20:17.800>string <00:20:17.975>question <00:20:18.149>literally <00:20:18.325>two <00:20:18.500>times <00:20:18.675>in <00:20:18.850>the <00:20:19.024>call <00:20:19.200>Signature,

426
00:20:20.400 --> 00:20:23.300
<00:20:20.400>but <00:20:20.575>that's <00:20:20.750>what <00:20:20.925>necessary <00:20:21.100>because <00:20:21.275>type <00:20:21.450>inference. <00:20:21.625>This <00:20:21.800>is

427
00:20:23.300 --> 00:20:25.100
<00:20:23.300>just <00:20:23.580>a <00:20:23.860>safe <00:20:24.139>but <00:20:24.419>much <00:20:24.700>shorter.

428
00:20:26.300 --> 00:20:29.200
<00:20:26.300>So <00:20:26.427>whoever <00:20:26.554>uses <00:20:26.681>hand <00:20:26.809>doesn't <00:20:26.936>even <00:20:27.063>need <00:20:27.190>to <00:20:27.318>know <00:20:27.445>how <00:20:27.572>this <00:20:27.700>works.

429
00:20:29.200 --> 00:20:32.400
<00:20:29.200>So <00:20:29.375>question <00:20:29.550>and <00:20:29.725>who <00:20:29.900>works <00:20:30.075>answer <00:20:30.250>and <00:20:30.425>42 <00:20:30.600>Works.

430
00:20:32.400 --> 00:20:35.800
<00:20:32.400>Something <00:20:32.575>else <00:20:32.750>does <00:20:32.925>not <00:20:33.100>work. <00:20:33.275>We <00:20:33.450>cannot <00:20:33.625>combine <00:20:33.800>a

431
00:20:35.800 --> 00:20:38.200
<00:20:35.800>kind <00:20:35.955>and <00:20:36.111>the <00:20:36.266>payload <00:20:36.422>that <00:20:36.577>doesn't <00:20:36.733>work <00:20:36.888>together <00:20:37.044>and <00:20:37.200>we

432
00:20:38.200 --> 00:20:41.700
<00:20:38.200>cannot <00:20:38.307>just <00:20:38.415>make <00:20:38.523>up <00:20:38.630>another <00:20:38.738>message <00:20:38.846>type. <00:20:38.953>I <00:20:39.061>mean <00:20:39.169>you <00:20:39.276>can <00:20:39.384>always <00:20:39.492>cast <00:20:39.600>things

433
00:20:41.700 --> 00:20:43.900
<00:20:41.700>as <00:20:41.840>any <00:20:41.980>but <00:20:42.120>why <00:20:42.260>would <00:20:42.400>you <00:20:42.540>want <00:20:42.680>to <00:20:42.820>do <00:20:42.960>this, <00:20:43.100>right?

434
00:20:45.600 --> 00:20:48.300
<00:20:45.600>So <00:20:45.833>that's <00:20:46.066>that's <00:20:46.300>basically <00:20:46.533>it. <00:20:46.766>It's <00:20:47.000>the

435
00:20:48.300 --> 00:20:51.100
<00:20:48.300>same <00:20:48.455>as <00:20:48.611>this <00:20:48.766>but <00:20:48.922>without <00:20:49.077>overloading <00:20:49.233>the <00:20:49.388>function <00:20:49.544>two <00:20:49.700>million

436
00:20:51.100 --> 00:20:54.300
<00:20:51.100>times <00:20:51.274>because <00:20:51.449>if <00:20:51.625>you <00:20:51.800>write <00:20:51.975>a <00:20:52.149>browser <00:20:52.324>browser <00:20:52.500>extension,

437
00:20:54.300 --> 00:20:55.500
<00:20:54.300>and <00:20:54.570>may <00:20:54.840>I <00:20:55.110>remind <00:20:55.380>you

438
00:20:57.200 --> 00:21:00.700
<00:20:57.200>but <00:20:57.300>if <00:20:57.400>you <00:20:57.500>decide <00:20:57.600>to <00:20:57.700>write <00:20:57.800>a <00:20:57.900>browser <00:20:58.000>extension, <00:20:58.100>you <00:20:58.200>are <00:20:58.300>going <00:20:58.400>to <00:20:58.500>either <00:20:58.600>overload

439
00:21:00.700 --> 00:21:03.400
<00:21:00.700>send <00:21:00.875>2 <00:21:01.050>million <00:21:01.225>times <00:21:01.400>or <00:21:01.575>be <00:21:01.750>without <00:21:01.925>any <00:21:02.100>type

440
00:21:03.400 --> 00:21:06.100
<00:21:03.400>safety <00:21:03.575>or <00:21:03.750>do <00:21:03.925>exactly <00:21:04.100>what <00:21:04.275>I've <00:21:04.450>done <00:21:04.625>so <00:21:04.800>far.

441
00:21:07.100 --> 00:21:10.400
<00:21:07.100>So <00:21:07.240>and <00:21:07.379>this <00:21:07.520>is <00:21:07.659>essentially <00:21:07.800>it <00:21:07.939>I <00:21:08.080>mean <00:21:08.219>we <00:21:08.360>could <00:21:08.500>extend

442
00:21:10.400 --> 00:21:13.800
<00:21:10.400>the <00:21:10.555>same <00:21:10.711>kind <00:21:10.866>of <00:21:11.022>method <00:21:11.177>to <00:21:11.333>on <00:21:11.488>right <00:21:11.644>kind <00:21:11.800>is

443
00:21:13.800 --> 00:21:16.500
<00:21:13.800>a <00:21:13.927>string <00:21:14.054>and <00:21:14.181>Handler <00:21:14.309>is <00:21:14.436>a <00:21:14.563>function <00:21:14.690>that <00:21:14.818>takes <00:21:14.945>any <00:21:15.072>payload. <00:21:15.200>Well,

444
00:21:16.500 --> 00:21:19.200
<00:21:16.500>we <00:21:16.655>can't <00:21:16.811>have <00:21:16.966>that <00:21:17.122>right <00:21:17.277>and <00:21:17.433>we <00:21:17.588>can <00:21:17.744>basically <00:21:17.900>do

445
00:21:19.200 --> 00:21:22.300
<00:21:19.200>the <00:21:19.293>same <00:21:19.386>thing. <00:21:19.480>This <00:21:19.573>doesn't <00:21:19.666>work, <00:21:19.760>but <00:21:19.853>we <00:21:19.946>know <00:21:20.040>the <00:21:20.133>rules <00:21:20.226>and <00:21:20.320>we <00:21:20.413>know <00:21:20.506>how <00:21:20.600>to

446
00:21:22.300 --> 00:21:25.200
<00:21:22.300>access <00:21:22.500>the <00:21:22.700>rules. <00:21:22.899>This <00:21:23.100>is <00:21:23.300>literally <00:21:23.500>the <00:21:23.700>same

447
00:21:25.200 --> 00:21:25.400
thing.

448
00:21:28.300 --> 00:21:31.100
<00:21:28.300>I <00:21:28.427>mean, <00:21:28.554>there's <00:21:28.681>some <00:21:28.809>new <00:21:28.936>ones <00:21:29.063>with <00:21:29.190>with <00:21:29.318>function <00:21:29.445>variants <00:21:29.572>and <00:21:29.700>stuff.

449
00:21:31.100 --> 00:21:34.500
<00:21:31.100>But <00:21:31.240>in <00:21:31.379>essence <00:21:31.520>this <00:21:31.659>is <00:21:31.800>the <00:21:31.939>same <00:21:32.080>thing <00:21:32.219>and <00:21:32.360>enforces <00:21:32.500>the

450
00:21:34.500 --> 00:21:36.100
<00:21:34.500>same <00:21:34.780>Kinds <00:21:35.060>of <00:21:35.340>Kinds <00:21:35.620>of <00:21:35.900>invariants.

451
00:21:38.800 --> 00:21:41.500
<00:21:38.800>So <00:21:39.033>we <00:21:39.266>could <00:21:39.500>overload <00:21:39.733>all <00:21:39.966>functions <00:21:40.200>and

452
00:21:41.500 --> 00:21:44.700
<00:21:41.500>overload <00:21:41.655>them <00:21:41.811>some <00:21:41.966>more <00:21:42.122>and <00:21:42.277>keep <00:21:42.433>the <00:21:42.588>entire <00:21:42.744>shabang <00:21:42.900>in

453
00:21:44.700 --> 00:21:47.600
<00:21:44.700>sync <00:21:44.900>manually, <00:21:45.100>or <00:21:45.300>we <00:21:45.500>could <00:21:45.700>just <00:21:45.900>derive <00:21:46.100>our

454
00:21:47.600 --> 00:21:50.000
<00:21:47.600>business <00:21:47.774>logic <00:21:47.949>from <00:21:48.125>first <00:21:48.300>principles. <00:21:48.475>This <00:21:48.649>is <00:21:48.824>what <00:21:49.000>I

455
00:21:50.100 --> 00:21:53.200
<00:21:50.100>would <00:21:50.216>want <00:21:50.333>to <00:21:50.449>do <00:21:50.566>and <00:21:50.683>we <00:21:50.800>don't <00:21:50.916>need <00:21:51.033>to <00:21:51.149>stop <00:21:51.266>here. <00:21:51.383>I <00:21:51.500>mean,

456
00:21:53.200 --> 00:21:55.100
<00:21:53.200>I'm <00:21:53.433>going <00:21:53.666>to <00:21:53.900>have <00:21:54.133>to <00:21:54.366>stop <00:21:54.600>soon.

457
00:21:55.700 --> 00:21:58.600
<00:21:55.700>But <00:21:55.840>in <00:21:55.980>theory <00:21:56.120>we <00:21:56.260>could <00:21:56.400>go <00:21:56.540>on <00:21:56.680>and <00:21:56.820>on <00:21:56.960>so <00:21:57.100>I

458
00:21:58.600 --> 00:21:59.700
<00:21:58.600>will <00:21:59.095>find <00:21:59.590>it.

459
00:22:00.500 --> 00:22:03.300
<00:22:00.500>We <00:22:00.675>could <00:22:00.850>if <00:22:01.025>we <00:22:01.200>wanted <00:22:01.375>to <00:22:01.550>have <00:22:01.725>a <00:22:01.900>type

460
00:22:03.300 --> 00:22:06.400
<00:22:03.300>for <00:22:03.427>the <00:22:03.554>messages <00:22:03.681>for <00:22:03.809>the <00:22:03.936>actual <00:22:04.063>messages <00:22:04.190>that <00:22:04.318>are <00:22:04.445>being <00:22:04.572>passed <00:22:04.700>around

461
00:22:06.400 --> 00:22:09.900
<00:22:06.400>we <00:22:06.540>could <00:22:06.680>you <00:22:06.820>know, <00:22:06.960>write <00:22:07.100>down <00:22:07.240>a <00:22:07.380>type <00:22:07.520>with <00:22:07.660>kind <00:22:07.800>string

462
00:22:09.900 --> 00:22:12.300
<00:22:09.900>and <00:22:10.250>payload <00:22:10.600>any <00:22:10.950>this <00:22:11.300>is

463
00:22:12.300 --> 00:22:15.300
<00:22:12.300>not <00:22:12.440>going <00:22:12.580>to <00:22:12.720>fly. <00:22:12.860>We <00:22:13.000>need <00:22:13.139>to <00:22:13.280>constrain <00:22:13.419>this <00:22:13.560>properly <00:22:13.700>and

464
00:22:15.300 --> 00:22:18.500
<00:22:15.300>we <00:22:15.427>can <00:22:15.554>do <00:22:15.681>this <00:22:15.809>using <00:22:15.936>the <00:22:16.063>same <00:22:16.190>principles <00:22:16.318>as <00:22:16.445>before <00:22:16.572>at <00:22:16.700>my

465
00:22:18.500 --> 00:22:21.400
<00:22:18.500>personal <00:22:18.655>favorite, <00:22:18.811>which <00:22:18.966>I'm <00:22:19.122>unfortunately <00:22:19.277>not <00:22:19.433>going <00:22:19.588>to <00:22:19.744>go <00:22:19.900>into

466
00:22:21.400 --> 00:22:24.200
<00:22:21.400>detail. <00:22:21.575>But <00:22:21.750>how <00:22:21.925>about <00:22:22.100>a <00:22:22.275>discriminated <00:22:22.450>Union <00:22:22.625>of <00:22:22.800>all

467
00:22:24.200 --> 00:22:27.300
<00:22:24.200>possible <00:22:24.355>messages <00:22:24.511>a <00:22:24.666>list <00:22:24.822>of <00:22:24.977>all <00:22:25.133>messages <00:22:25.288>that <00:22:25.444>could <00:22:25.600>possibly

468
00:22:27.300 --> 00:22:30.400
<00:22:27.300>be <00:22:27.440>a <00:22:27.580>list <00:22:27.720>but <00:22:27.860>a <00:22:28.000>union <00:22:28.139>type <00:22:28.280>I <00:22:28.419>mean <00:22:28.560>you <00:22:28.700>can

469
00:22:30.400 --> 00:22:33.300
<00:22:30.400>derive <00:22:30.540>this <00:22:30.680>this <00:22:30.820>looks <00:22:30.960>freaky. <00:22:31.100>I'm <00:22:31.240>not <00:22:31.380>going <00:22:31.520>to <00:22:31.660>go <00:22:31.800>into

470
00:22:33.300 --> 00:22:35.100
<00:22:33.300>this, <00:22:33.500>but <00:22:33.700>just <00:22:33.899>trust <00:22:34.100>me <00:22:34.300>that <00:22:34.500>it <00:22:34.700>works.

471
00:22:36.500 --> 00:22:39.300
<00:22:36.500>And <00:22:36.607>it <00:22:36.715>works <00:22:36.823>so <00:22:36.930>well <00:22:37.038>that <00:22:37.146>if <00:22:37.253>at <00:22:37.361>any <00:22:37.469>point <00:22:37.576>you <00:22:37.684>decide <00:22:37.792>you <00:22:37.900>need

472
00:22:39.300 --> 00:22:42.600
<00:22:39.300>another <00:22:39.440>message <00:22:39.580>type, <00:22:39.720>you <00:22:39.860>just <00:22:40.000>added <00:22:40.139>to <00:22:40.280>the <00:22:40.419>base <00:22:40.560>list <00:22:40.700>of

473
00:22:42.600 --> 00:22:45.200
<00:22:42.600>types <00:22:42.833>and <00:22:43.066>everything <00:22:43.300>else <00:22:43.533>will <00:22:43.766>follow <00:22:44.000>suit

474
00:22:45.200 --> 00:22:48.000
<00:22:45.200>because <00:22:45.400>everything <00:22:45.600>else <00:22:45.800>is <00:22:46.000>derived <00:22:46.200>from <00:22:46.400>first <00:22:46.600>principles.

475
00:22:49.100 --> 00:22:52.400
<00:22:49.100>I <00:22:49.300>mean <00:22:49.500>this <00:22:49.699>looks <00:22:49.899>complicated <00:22:50.100>and <00:22:50.300>it's <00:22:50.500>sort

476
00:22:52.400 --> 00:22:55.900
<00:22:52.400>of <00:22:52.540>is <00:22:52.680>but <00:22:52.820>it's <00:22:52.960>just <00:22:53.100>another <00:22:53.240>Syntax <00:22:53.380>for <00:22:53.520>functional <00:22:53.660>set-based <00:22:53.800>programming

477
00:22:55.900 --> 00:22:58.600
<00:22:55.900>language. <00:22:56.250>Not <00:22:56.600>that <00:22:56.950>strange <00:22:57.300>All

478
00:22:58.600 --> 00:22:59.200
<00:22:58.600>Things <00:22:59.140>Considered.

479
00:22:59.900 --> 00:23:00.100
so

480
00:23:01.500 --> 00:23:04.200
<00:23:01.500>where <00:23:01.655>we <00:23:01.811>end <00:23:01.966>up <00:23:02.122>in <00:23:02.277>comparison <00:23:02.433>to <00:23:02.588>where <00:23:02.744>we <00:23:02.900>started

481
00:23:04.200 --> 00:23:07.900
<00:23:04.200>where <00:23:04.375>we <00:23:04.550>started. <00:23:04.725>We <00:23:04.900>had <00:23:05.075>a <00:23:05.250>few <00:23:05.425>function <00:23:05.600>signatures

482
00:23:07.900 --> 00:23:10.800
<00:23:07.900>and <00:23:08.100>a <00:23:08.300>few <00:23:08.500>message <00:23:08.700>types <00:23:08.900>that <00:23:09.100>were <00:23:09.300>basically

483
00:23:10.800 --> 00:23:13.800
<00:23:10.800>just <00:23:11.033>written <00:23:11.266>down <00:23:11.500>essentially <00:23:11.733>in <00:23:11.966>this <00:23:12.200>assembler

484
00:23:13.800 --> 00:23:16.500
<00:23:13.800>kind <00:23:13.955>of <00:23:14.111>way <00:23:14.266>that <00:23:14.422>I <00:23:14.577>contrasted <00:23:14.733>with <00:23:14.888>a <00:23:15.044>proper <00:23:15.200>high-level

485
00:23:16.500 --> 00:23:19.100
<00:23:16.500>language, <00:23:16.700>but <00:23:16.900>if <00:23:17.100>we <00:23:17.300>can <00:23:17.500>and <00:23:17.700>this <00:23:17.900>is

486
00:23:19.100 --> 00:23:20.600
<00:23:19.100>not <00:23:19.324>always <00:23:19.550>possible, <00:23:19.774>but <00:23:20.000>if <00:23:20.225>we <00:23:20.449>can

487
00:23:21.900 --> 00:23:24.400
<00:23:21.900>Figure <00:23:22.100>out <00:23:22.300>what <00:23:22.500>the <00:23:22.700>Core <00:23:22.900>Business <00:23:23.100>rules <00:23:23.300>in

488
00:23:24.400 --> 00:23:27.600
<00:23:24.400>our <00:23:24.555>project <00:23:24.711>are <00:23:24.866>and <00:23:25.022>if <00:23:25.177>we <00:23:25.333>can <00:23:25.488>put <00:23:25.644>this <00:23:25.800>in

489
00:23:27.600 --> 00:23:30.300
<00:23:27.600>a <00:23:27.740>type <00:23:27.879>and <00:23:28.020>if <00:23:28.159>we <00:23:28.300>can <00:23:28.439>derive <00:23:28.580>all <00:23:28.719>other <00:23:28.860>types <00:23:29.000>from

490
00:23:30.300 --> 00:23:34.100
<00:23:30.300>there, <00:23:30.455>then <00:23:30.611>we <00:23:30.766>have <00:23:30.922>an <00:23:31.077>entirely <00:23:31.233>consistent <00:23:31.388>system <00:23:31.544>and <00:23:31.700>a

491
00:23:33.100 --> 00:23:36.500
<00:23:33.100>bunch <00:23:33.333>of <00:23:33.566>essentially <00:23:33.800>type-level <00:23:34.033>automation <00:23:34.266>without <00:23:34.500>doing

492
00:23:36.500 --> 00:23:37.800
<00:23:36.500>too <00:23:36.792>much <00:23:37.085>about <00:23:37.377>this. <00:23:37.670>So

493
00:23:39.100 --> 00:23:42.300
<00:23:39.100>If <00:23:39.193>you <00:23:39.286>have <00:23:39.379>a <00:23:39.473>bunch <00:23:39.566>of <00:23:39.659>types <00:23:39.753>in <00:23:39.846>your <00:23:39.939>projects <00:23:40.033>and <00:23:40.126>the <00:23:40.219>types <00:23:40.313>are <00:23:40.406>subject <00:23:40.500>to

494
00:23:42.300 --> 00:23:46.000
<00:23:42.300>the <00:23:42.440>same <00:23:42.580>sort <00:23:42.720>of <00:23:42.860>basic <00:23:43.000>rules <00:23:43.139>about <00:23:43.280>your <00:23:43.419>business <00:23:43.560>logic, <00:23:43.700>then

495
00:23:45.300 --> 00:23:48.900
<00:23:45.300>you <00:23:45.455>should <00:23:45.611>at <00:23:45.766>least <00:23:45.922>try <00:23:46.077>in <00:23:46.233>my <00:23:46.388>opinion <00:23:46.544>to <00:23:46.700>turn

496
00:23:48.900 --> 00:23:51.800
<00:23:48.900>the <00:23:49.133>business <00:23:49.366>logic <00:23:49.600>type <00:23:49.833>rules <00:23:50.066>into <00:23:50.300>actual

497
00:23:51.800 --> 00:23:54.300
<00:23:51.800>tribes <00:23:52.000>that <00:23:52.200>you <00:23:52.399>derive <00:23:52.600>your <00:23:52.800>everyday <00:23:53.000>types <00:23:53.200>from

498
00:23:54.300 --> 00:23:57.300
<00:23:54.300>at <00:23:54.427>least <00:23:54.554>at <00:23:54.681>least. <00:23:54.809>This <00:23:54.936>is <00:23:55.063>my <00:23:55.190>Approach <00:23:55.318>and <00:23:55.445>this <00:23:55.572>made <00:23:55.700>the

499
00:23:57.300 --> 00:24:00.000
<00:23:57.300>browser <00:23:57.500>extension <00:23:57.700>work <00:23:57.899>to <00:23:58.100>sell <00:23:58.300>extension <00:23:58.500>at <00:23:58.700>least.

500
00:24:01.000 --> 00:24:01.300
Okay.

501
00:24:02.100 --> 00:24:03.900
<00:24:02.100>That's <00:24:02.333>it <00:24:02.566>for <00:24:02.800>me. <00:24:03.033>So <00:24:03.266>our <00:24:03.500>conclusion.

502
00:24:04.500 --> 00:24:07.800
<00:24:04.500>We <00:24:04.733>can <00:24:04.966>treat <00:24:05.200>typescript <00:24:05.433>type <00:24:05.666>annotations <00:24:05.900>like

503
00:24:07.800 --> 00:24:10.500
<00:24:07.800>a <00:24:08.033>programming <00:24:08.266>language. <00:24:08.500>It's <00:24:08.733>a <00:24:08.966>strange <00:24:09.200>programming

504
00:24:10.500 --> 00:24:13.700
<00:24:10.500>language. <00:24:10.700>The <00:24:10.900>syntax <00:24:11.100>is <00:24:11.300>kind <00:24:11.500>of <00:24:11.700>weird <00:24:11.900>and

505
00:24:13.700 --> 00:24:16.900
<00:24:13.700>it's <00:24:13.933>set <00:24:14.166>based. <00:24:14.400>It's <00:24:14.633>it's <00:24:14.866>functional <00:24:15.100>you

506
00:24:16.900 --> 00:24:19.200
<00:24:16.900>need <00:24:17.075>to <00:24:17.250>do <00:24:17.425>recursion <00:24:17.600>and <00:24:17.775>stuff. <00:24:17.950>But <00:24:18.125>you <00:24:18.300>know,

507
00:24:19.200 --> 00:24:22.500
<00:24:19.200>it <00:24:19.327>works. <00:24:19.454>I <00:24:19.581>mean <00:24:19.709>the <00:24:19.836>strangest <00:24:19.963>thing <00:24:20.090>about <00:24:20.218>it <00:24:20.345>is <00:24:20.472>that <00:24:20.600>it

508
00:24:22.500 --> 00:24:25.200
<00:24:22.500>essentially <00:24:22.733>lives <00:24:22.966>together <00:24:23.200>with <00:24:23.433>JavaScript <00:24:23.666>in <00:24:23.900>your

509
00:24:25.200 --> 00:24:25.700
<00:24:25.200>project <00:24:25.650>and

510
00:24:26.500 --> 00:24:29.000
<00:24:26.500>hasn't <00:24:26.675>really <00:24:26.850>you <00:24:27.025>know, <00:24:27.200>notified <00:24:27.375>anyone <00:24:27.550>about <00:24:27.725>the <00:24:27.900>fact

511
00:24:29.200 --> 00:24:30.400
<00:24:29.200>that <00:24:29.354>it's <00:24:29.508>a <00:24:29.662>programming <00:24:29.817>language, <00:24:29.971>but <00:24:30.125>it <00:24:30.280>is

512
00:24:31.300 --> 00:24:34.900
<00:24:31.300>Why <00:24:31.407>would <00:24:31.515>you <00:24:31.623>want <00:24:31.730>to <00:24:31.838>do <00:24:31.946>this? <00:24:32.053>Right? <00:24:32.161>You <00:24:32.269>can <00:24:32.376>do <00:24:32.484>type <00:24:32.592>level <00:24:32.700>programming

513
00:24:34.900 --> 00:24:38.400
<00:24:34.900>for <00:24:35.075>your <00:24:35.250>core <00:24:35.425>business <00:24:35.600>logic <00:24:35.775>and <00:24:35.950>this <00:24:36.125>can <00:24:36.300>lead

514
00:24:37.400 --> 00:24:41.100
<00:24:37.400>your <00:24:37.750>project <00:24:38.100>into <00:24:38.450>basically <00:24:38.800>a

515
00:24:40.100 --> 00:24:43.600
<00:24:40.100>new <00:24:40.274>era <00:24:40.449>of <00:24:40.625>consistency. <00:24:40.800>If <00:24:40.975>you <00:24:41.149>can <00:24:41.324>boil <00:24:41.500>down

516
00:24:43.600 --> 00:24:46.500
<00:24:43.600>your <00:24:43.800>business <00:24:44.000>logic <00:24:44.199>car <00:24:44.399>tenants <00:24:44.600>into <00:24:44.800>basic <00:24:45.000>rules.

517
00:24:48.100 --> 00:24:49.200
<00:24:48.100>written <00:24:48.429>down <00:24:48.760>as <00:24:49.090>types

518
00:24:50.200 --> 00:24:53.900
<00:24:50.200>So <00:24:50.327>just <00:24:50.454>on <00:24:50.581>the <00:24:50.709>off <00:24:50.836>chance <00:24:50.963>that <00:24:51.090>you <00:24:51.218>have <00:24:51.345>any <00:24:51.472>questions <00:24:51.600>now,

519
00:24:53.900 --> 00:24:57.000
<00:24:53.900>it's <00:24:54.100>your <00:24:54.300>chance. <00:24:54.500>Thank <00:24:54.700>you <00:24:54.900>for <00:24:55.100>your <00:24:55.300>attendance

520
00:24:56.200 --> 00:24:58.800
<00:24:56.200>and <00:24:56.550>see <00:24:56.900>you <00:24:57.250>next <00:24:57.600>time.

521
00:25:07.700 --> 00:25:10.400
<00:25:07.700>Thank <00:25:07.875>you <00:25:08.050>so <00:25:08.225>much <00:25:08.400>for <00:25:08.575>your <00:25:08.750>talk. <00:25:08.925>We <00:25:09.100>do

522
00:25:10.400 --> 00:25:13.500
<00:25:10.400>have <00:25:10.527>a <00:25:10.654>number <00:25:10.781>of <00:25:10.909>questions <00:25:11.036>for <00:25:11.163>you, <00:25:11.290>which <00:25:11.418>is <00:25:11.545>not <00:25:11.672>surprising <00:25:11.800>considering

523
00:25:13.500 --> 00:25:16.700
<00:25:13.500>how <00:25:13.640>many <00:25:13.780>people <00:25:13.920>we <00:25:14.060>have <00:25:14.200>in <00:25:14.340>the <00:25:14.480>audience. <00:25:14.620>So <00:25:14.760>one <00:25:14.900>question

524
00:25:16.700 --> 00:25:19.600
<00:25:16.700>is <00:25:16.900>when <00:25:17.100>you <00:25:17.300>choose <00:25:17.500>for <00:25:17.700>example, <00:25:17.900>Java <00:25:18.100>or

525
00:25:19.600 --> 00:25:23.100
<00:25:19.600>even <00:25:19.755>C <00:25:19.911>over <00:25:20.066>assembly, <00:25:20.222>you <00:25:20.377>may <00:25:20.533>lose <00:25:20.688>some <00:25:20.844>performance. <00:25:21.000>So

526
00:25:22.100 --> 00:25:25.400
<00:25:22.100>is <00:25:22.255>there <00:25:22.411>any <00:25:22.566>loss <00:25:22.722>when <00:25:22.877>you <00:25:23.033>move <00:25:23.188>to <00:25:23.344>typescript <00:25:23.500>from

527
00:25:25.400 --> 00:25:28.800
<00:25:25.400>JavaScript <00:25:25.680>in <00:25:25.960>terms <00:25:26.240>of <00:25:26.520>performance <00:25:26.800>well

528
00:25:29.800 --> 00:25:32.500
<00:25:29.800>It's <00:25:30.033>definitely <00:25:30.266>not <00:25:30.500>a <00:25:30.733>loss <00:25:30.966>in <00:25:31.200>performance

529
00:25:32.500 --> 00:25:35.400
<00:25:32.500>at <00:25:32.700>runtime <00:25:32.900>because <00:25:33.100>typescript <00:25:33.300>types <00:25:33.500>don't <00:25:33.700>exist <00:25:33.900>at

530
00:25:35.400 --> 00:25:38.400
<00:25:35.400>runtime <00:25:35.633>and <00:25:35.866>at <00:25:36.100>compile <00:25:36.333>time. <00:25:36.566>I <00:25:36.800>don't

531
00:25:38.400 --> 00:25:41.000
<00:25:38.400>think <00:25:38.555>the <00:25:38.711>penalty <00:25:38.866>is <00:25:39.022>that <00:25:39.177>much. <00:25:39.333>I <00:25:39.488>mean <00:25:39.644>if <00:25:39.800>you

532
00:25:41.200 --> 00:25:44.300
<00:25:41.200>have <00:25:41.340>a <00:25:41.480>large <00:25:41.620>typescript <00:25:41.760>code <00:25:41.900>program <00:25:42.040>your <00:25:42.180>screwed <00:25:42.320>either <00:25:42.460>way <00:25:42.600>because

533
00:25:44.300 --> 00:25:47.500
<00:25:44.300>the <00:25:44.407>compiler <00:25:44.515>is <00:25:44.623>slow <00:25:44.730>and <00:25:44.838>it's <00:25:44.946>always <00:25:45.053>going <00:25:45.161>to <00:25:45.269>be <00:25:45.376>slow <00:25:45.484>and <00:25:45.592>this <00:25:45.700>probably

534
00:25:47.500 --> 00:25:50.200
<00:25:47.500>doesn't <00:25:47.700>add <00:25:47.900>much <00:25:48.100>and <00:25:48.300>I <00:25:48.500>might <00:25:48.700>add <00:25:48.900>that.

535
00:25:51.300 --> 00:25:55.000
<00:25:51.300>I <00:25:51.440>didn't <00:25:51.580>come <00:25:51.720>up <00:25:51.860>with <00:25:52.000>this. <00:25:52.139>This <00:25:52.280>is <00:25:52.419>in <00:25:52.560>typescripts <00:25:52.700>base

536
00:25:54.200 --> 00:25:57.100
<00:25:54.200>types <00:25:54.550>that <00:25:54.900>are <00:25:55.250>delivered <00:25:55.600>together

537
00:25:57.100 --> 00:26:00.300
<00:25:57.100>with <00:25:57.240>typescript <00:25:57.379>encoded <00:25:57.520>in <00:25:57.659>there. <00:25:57.800>I <00:25:57.939>mean, <00:25:58.080>if <00:25:58.219>you <00:25:58.360>for <00:25:58.500>example

538
00:26:00.300 --> 00:26:03.500
<00:26:00.300>do <00:26:00.455>front-end <00:26:00.611>programming <00:26:00.766>and <00:26:00.922>you <00:26:01.077>do <00:26:01.233>document <00:26:01.388>create <00:26:01.544>element <00:26:01.700>with

539
00:26:03.500 --> 00:26:06.300
<00:26:03.500>a <00:26:03.675>span <00:26:03.850>element <00:26:04.025>the <00:26:04.200>object <00:26:04.375>you <00:26:04.550>get <00:26:04.725>back <00:26:04.900>is

540
00:26:06.300 --> 00:26:09.600
<00:26:06.300>an <00:26:06.455>HTML <00:26:06.611>spend <00:26:06.766>element <00:26:06.922>and <00:26:07.077>not <00:26:07.233>just <00:26:07.388>any <00:26:07.544>spend <00:26:07.700>element

541
00:26:09.600 --> 00:26:12.100
<00:26:09.600>typescript <00:26:09.800>in <00:26:10.000>first <00:26:10.199>this <00:26:10.399>from <00:26:10.600>this <00:26:10.800>string <00:26:11.000>so

542
00:26:13.800 --> 00:26:16.400
<00:26:13.800>If <00:26:13.940>you <00:26:14.080>do <00:26:14.220>this <00:26:14.360>yourself <00:26:14.500>in <00:26:14.639>your <00:26:14.780>own <00:26:14.919>project, <00:26:15.060>maybe <00:26:15.200>it

543
00:26:16.400 --> 00:26:19.300
<00:26:16.400>slows <00:26:16.540>you <00:26:16.680>down. <00:26:16.820>But <00:26:16.960>if <00:26:17.100>this <00:26:17.240>sort <00:26:17.380>of <00:26:17.520>programming <00:26:17.660>does <00:26:17.800>slow

544
00:26:19.300 --> 00:26:21.300
<00:26:19.300>you <00:26:19.533>down <00:26:19.766>you're <00:26:20.000>not <00:26:20.233>the <00:26:20.466>main <00:26:20.700>culprit.

545
00:26:22.600 --> 00:26:25.500
<00:26:22.600>Thank <00:26:22.949>you. <00:26:23.300>One <00:26:23.649>often <00:26:24.000>uploaded

546
00:26:25.500 --> 00:26:28.800
<00:26:25.500>question <00:26:25.733>is <00:26:25.966>a <00:26:26.200>type <00:26:26.433>versus <00:26:26.666>interface <00:26:26.900>when

547
00:26:28.800 --> 00:26:31.500
<00:26:28.800>you <00:26:29.000>use <00:26:29.200>type <00:26:29.399>and <00:26:29.600>when <00:26:29.800>interface <00:26:30.000>when <00:26:30.200>do

548
00:26:31.500 --> 00:26:34.600
<00:26:31.500>I <00:26:31.640>use <00:26:31.780>type <00:26:31.920>versus <00:26:32.060>when <00:26:32.200>do <00:26:32.340>I <00:26:32.480>use <00:26:32.620>interface? <00:26:32.760>Well, <00:26:32.900>yes.

549
00:26:35.300 --> 00:26:38.400
<00:26:35.300>In <00:26:35.580>99.9% <00:26:35.860>no <00:26:36.139>difference <00:26:36.419>and <00:26:36.700>you

550
00:26:38.400 --> 00:26:41.300
<00:26:38.400>need <00:26:38.507>interfaces. <00:26:38.615>If <00:26:38.723>you <00:26:38.830>want <00:26:38.938>to <00:26:39.046>extend <00:26:39.153>the <00:26:39.261>global <00:26:39.369>object <00:26:39.476>like <00:26:39.584>window <00:26:39.692>you <00:26:39.800>can

551
00:26:41.300 --> 00:26:44.500
<00:26:41.300>use <00:26:41.500>declaration. <00:26:41.700>Margin. <00:26:41.899>Otherwise, <00:26:42.100>I <00:26:42.300>personally <00:26:42.500>use <00:26:42.700>type

552
00:26:44.500 --> 00:26:47.500
<00:26:44.500>because <00:26:44.640>type <00:26:44.780>is <00:26:44.920>less. <00:26:45.060>Let <00:26:45.200>us <00:26:45.340>then <00:26:45.480>interface, <00:26:45.620>but <00:26:45.760>that's <00:26:45.900>literally

553
00:26:47.500 --> 00:26:48.600
<00:26:47.500>the <00:26:47.995>entire <00:26:48.490>reason.

554
00:26:50.100 --> 00:26:53.400
<00:26:50.100>I <00:26:50.255>think <00:26:50.411>this <00:26:50.566>question <00:26:50.722>is <00:26:50.877>for <00:26:51.033>you <00:26:51.188>really <00:26:51.344>can <00:26:51.500>you

555
00:26:53.400 --> 00:26:55.900
<00:26:53.400>recommend <00:26:53.680>resources <00:26:53.960>to <00:26:54.240>learn <00:26:54.520>advanced <00:26:54.800>typescript?

556
00:26:56.700 --> 00:27:00.300
<00:26:56.700>A <00:26:56.875>resource <00:26:57.050>to <00:26:57.225>learn <00:26:57.400>Advanced <00:26:57.575>typescript. <00:26:57.750>Well <00:26:57.925>by <00:26:58.100>my

557
00:27:00.300 --> 00:27:03.300
<00:27:00.300>workshops <00:27:00.580>in <00:27:00.860>all <00:27:01.139>seriousness <00:27:01.419>the <00:27:01.700>best

558
00:27:03.300 --> 00:27:06.700
<00:27:03.300>way <00:27:03.407>to <00:27:03.515>learn <00:27:03.623>about <00:27:03.730>patterns <00:27:03.838>like <00:27:03.946>this <00:27:04.053>is <00:27:04.161>to <00:27:04.269>take <00:27:04.376>a <00:27:04.484>peek <00:27:04.592>into <00:27:04.700>the

559
00:27:06.700 --> 00:27:09.200
<00:27:06.700>types <00:27:06.933>that <00:27:07.166>come <00:27:07.400>with <00:27:07.633>typescript. <00:27:07.866>As <00:27:08.100>I

560
00:27:09.200 --> 00:27:12.100
<00:27:09.200>said <00:27:09.400>something <00:27:09.600>like <00:27:09.800>document <00:27:10.000>create <00:27:10.200>element <00:27:10.400>looks <00:27:10.600>like

561
00:27:12.100 --> 00:27:15.300
<00:27:12.100>a <00:27:12.227>totally <00:27:12.354>mundane <00:27:12.481>function, <00:27:12.609>but <00:27:12.736>the <00:27:12.863>types <00:27:12.990>attached <00:27:13.118>to <00:27:13.245>this <00:27:13.372>are <00:27:13.500>quite

562
00:27:15.300 --> 00:27:18.000
<00:27:15.300>interesting <00:27:15.427>or <00:27:15.554>take <00:27:15.681>a <00:27:15.809>look <00:27:15.936>at <00:27:16.063>react <00:27:16.190>where <00:27:16.318>the <00:27:16.445>same <00:27:16.572>sort <00:27:16.700>of

563
00:27:18.300 --> 00:27:21.400
<00:27:18.300>magic <00:27:18.475>is <00:27:18.649>happening. <00:27:18.825>It's <00:27:19.000>not <00:27:19.175>properly <00:27:19.350>documented <00:27:19.524>for <00:27:19.700>say

564
00:27:21.400 --> 00:27:24.300
<00:27:21.400>anywhere <00:27:21.866>but <00:27:22.333>digging <00:27:22.800>around

565
00:27:24.300 --> 00:27:26.600
<00:27:24.300>in <00:27:24.475>the <00:27:24.649>types. <00:27:24.825>This <00:27:25.000>is <00:27:25.175>where <00:27:25.350>the <00:27:25.524>magic <00:27:25.700>is.

566
00:27:27.500 --> 00:27:30.600
<00:27:27.500>How <00:27:27.850>would <00:27:28.200>you <00:27:28.550>beautify <00:27:28.900>the

567
00:27:30.600 --> 00:27:33.700
<00:27:30.600>types <00:27:30.755>for <00:27:30.911>send <00:27:31.066>and <00:27:31.222>on <00:27:31.377>to <00:27:31.533>make <00:27:31.688>them <00:27:31.844>understandable <00:27:32.000>at

568
00:27:33.700 --> 00:27:34.100
<00:27:33.700>a <00:27:34.060>glance?

569
00:27:35.000 --> 00:27:35.100
Oh.

570
00:27:35.800 --> 00:27:36.200
well

571
00:27:37.100 --> 00:27:40.100
<00:27:37.100>I <00:27:37.255>mean <00:27:37.411>this <00:27:37.566>this <00:27:37.722>presupposes <00:27:37.877>that <00:27:38.033>this <00:27:38.188>is <00:27:38.344>not <00:27:38.500>understandable.

572
00:27:42.400 --> 00:27:45.500
<00:27:42.400>I <00:27:42.540>don't <00:27:42.680>necessarily <00:27:42.820>agree <00:27:42.960>that <00:27:43.100>this <00:27:43.240>is <00:27:43.380>not <00:27:43.520>understandable. <00:27:43.660>This <00:27:43.800>is

573
00:27:45.500 --> 00:27:48.400
<00:27:45.500>a <00:27:45.700>very <00:27:45.900>tiny <00:27:46.100>programming <00:27:46.300>language <00:27:46.500>that <00:27:46.700>just <00:27:46.900>lives

574
00:27:48.400 --> 00:27:51.700
<00:27:48.400>inside <00:27:48.540>your <00:27:48.680>JavaScript. <00:27:48.820>This <00:27:48.960>is <00:27:49.100>something <00:27:49.240>that <00:27:49.380>you <00:27:49.520>can <00:27:49.660>either <00:27:49.800>decide

575
00:27:51.700 --> 00:27:54.000
<00:27:51.700>to <00:27:51.933>learn <00:27:52.166>or <00:27:52.400>you <00:27:52.633>don't <00:27:52.866>I <00:27:53.100>mean

576
00:27:54.200 --> 00:27:56.500
<00:27:54.200>many <00:27:54.375>happy <00:27:54.550>developers <00:27:54.725>go <00:27:54.900>through <00:27:55.075>life <00:27:55.250>without <00:27:55.425>understanding <00:27:55.600>CSS.

577
00:27:57.400 --> 00:28:00.400
<00:27:57.400>And <00:27:57.500>they <00:27:57.600>are <00:27:57.700>fine. <00:27:57.800>So <00:27:57.900>maybe <00:27:58.000>you <00:27:58.100>can <00:27:58.200>just <00:27:58.300>write <00:27:58.400>a <00:27:58.500>bunch <00:27:58.600>of <00:27:58.700>text <00:27:58.800>script

578
00:28:00.400 --> 00:28:03.800
<00:28:00.400>and <00:28:00.555>don't <00:28:00.711>understand <00:28:00.866>this <00:28:01.022>and <00:28:01.177>be <00:28:01.333>fine <00:28:01.488>and <00:28:01.644>you <00:28:01.800>probably

579
00:28:03.800 --> 00:28:07.200
<00:28:03.800>don't <00:28:03.975>need <00:28:04.149>to <00:28:04.325>touch <00:28:04.500>this <00:28:04.675>if <00:28:04.850>the <00:28:05.024>final <00:28:05.200>interfaces

580
00:28:06.200 --> 00:28:09.600
<00:28:06.200>that <00:28:06.375>you <00:28:06.550>come <00:28:06.725>in <00:28:06.900>contact <00:28:07.075>with <00:28:07.250>are <00:28:07.425>well <00:28:07.600>designed.

581
00:28:09.600 --> 00:28:12.600
<00:28:09.600>Let's <00:28:09.800>scroll <00:28:10.000>back <00:28:10.199>to <00:28:10.399>the <00:28:10.600>message <00:28:10.800>port <00:28:11.000>and

582
00:28:12.600 --> 00:28:15.200
<00:28:12.600>remember <00:28:12.879>that <00:28:13.159>the <00:28:13.439>message <00:28:13.719>part <00:28:14.000>has

583
00:28:15.200 --> 00:28:18.300
<00:28:15.200>been <00:28:15.375>designed <00:28:15.550>such <00:28:15.725>that <00:28:15.900>the <00:28:16.075>type <00:28:16.250>argument <00:28:16.425>for <00:28:16.600>on

584
00:28:18.300 --> 00:28:21.800
<00:28:18.300>which <00:28:18.649>is <00:28:19.000>called <00:28:19.350>K <00:28:19.700>in

585
00:28:21.800 --> 00:28:25.100
<00:28:21.800>this <00:28:21.975>case <00:28:22.149>never <00:28:22.325>needs <00:28:22.500>to <00:28:22.675>be <00:28:22.850>supplied <00:28:23.024>the <00:28:23.200>argument.

586
00:28:24.100 --> 00:28:27.400
<00:28:24.100>The <00:28:24.800>arrangement <00:28:25.500>of

587
00:28:27.400 --> 00:28:30.400
<00:28:27.400>arguments <00:28:27.600>incent <00:28:27.800>is <00:28:28.000>such <00:28:28.200>that <00:28:28.400>the <00:28:28.600>type <00:28:28.800>inference

588
00:28:30.400 --> 00:28:33.200
<00:28:30.400>can <00:28:30.527>do <00:28:30.654>the <00:28:30.781>heavy <00:28:30.909>lifting. <00:28:31.036>So <00:28:31.163>no <00:28:31.290>one <00:28:31.418>even <00:28:31.545>needs <00:28:31.672>to <00:28:31.800>understand

589
00:28:33.200 --> 00:28:33.700
this.

590
00:28:34.500 --> 00:28:37.500
<00:28:34.500>I <00:28:34.640>mean, <00:28:34.780>hey, <00:28:34.920>did <00:28:35.060>you <00:28:35.200>know <00:28:35.340>the <00:28:35.480>document <00:28:35.620>create <00:28:35.760>elements <00:28:35.900>does

591
00:28:37.500 --> 00:28:37.700
this?

592
00:28:38.700 --> 00:28:42.100
<00:28:38.700>You <00:28:38.855>didn't <00:28:39.011>care <00:28:39.166>until <00:28:39.322>five <00:28:39.477>minutes <00:28:39.633>ago. <00:28:39.788>So <00:28:39.944>probably <00:28:40.100>not

593
00:28:41.100 --> 00:28:44.200
<00:28:41.100>important <00:28:41.300>if <00:28:41.500>it's <00:28:41.699>important. <00:28:41.899>Well <00:28:42.100>run <00:28:42.300>the <00:28:42.500>stuff.

594
00:28:44.200 --> 00:28:44.900
<00:28:44.200>It's <00:28:44.410>not <00:28:44.620>that <00:28:44.830>hard.

595
00:28:47.300 --> 00:28:50.400
<00:28:47.300>Now <00:28:47.533>we <00:28:47.766>have <00:28:48.000>one <00:28:48.233>last <00:28:48.466>very <00:28:48.700>specific

596
00:28:50.400 --> 00:28:53.500
<00:28:50.400>question. <00:28:50.600>That <00:28:50.800>is <00:28:51.000>why <00:28:51.200>didn't <00:28:51.400>you <00:28:51.600>directly <00:28:51.800>bind

597
00:28:53.500 --> 00:28:56.700
<00:28:53.500>message <00:28:53.700>Port <00:28:53.900>payload <00:28:54.100>map, <00:28:54.300>isn't <00:28:54.500>it <00:28:54.700>offer <00:28:54.900>complicating

598
00:28:56.700 --> 00:28:59.400
<00:28:56.700>it? <00:28:56.980>Yes, <00:28:57.260>it <00:28:57.540>is. <00:28:57.820>This <00:28:58.100>is

599
00:28:59.400 --> 00:29:00.100
<00:28:59.400>a <00:28:59.715>very <00:29:00.030>good.

600
00:29:02.900 --> 00:29:05.600
<00:29:02.900>Questions <00:29:03.100>sort <00:29:03.300>of <00:29:03.500>and <00:29:03.700>this <00:29:03.900>is <00:29:04.100>over <00:29:04.300>complicated

601
00:29:05.600 --> 00:29:08.800
<00:29:05.600>with <00:29:05.833>a <00:29:06.066>p <00:29:06.300>up <00:29:06.533>there <00:29:06.766>and <00:29:07.000>this

602
00:29:08.800 --> 00:29:11.100
<00:29:08.800>is <00:29:08.955>the <00:29:09.111>same <00:29:09.266>conclusion. <00:29:09.422>I <00:29:09.577>came <00:29:09.733>to <00:29:09.888>on <00:29:10.044>the <00:29:10.200>train

603
00:29:11.100 --> 00:29:11.600
<00:29:11.100>ride <00:29:11.550>today.

604
00:29:12.300 --> 00:29:16.300
<00:29:12.300>But <00:29:12.382>I <00:29:12.464>was <00:29:12.547>too <00:29:12.629>much <00:29:12.711>of <00:29:12.794>a <00:29:12.876>chicken <00:29:12.958>to <00:29:13.041>change <00:29:13.123>it <00:29:13.205>in <00:29:13.288>the <00:29:13.370>last <00:29:13.452>minute. <00:29:13.535>So <00:29:13.617>yeah, <00:29:13.700>you

605
00:29:15.300 --> 00:29:18.400
<00:29:15.300>can <00:29:15.533>do <00:29:15.766>it <00:29:16.000>without <00:29:16.233>this <00:29:16.466>argument. <00:29:16.700>I

606
00:29:18.400 --> 00:29:19.500
<00:29:18.400>I <00:29:18.647>don't <00:29:18.895>I <00:29:19.142>don't <00:29:19.390>care.

607
00:29:20.700 --> 00:29:23.200
<00:29:20.700>Okay. <00:29:20.855>Thank <00:29:21.011>you. <00:29:21.166>Thank <00:29:21.322>you <00:29:21.477>so <00:29:21.633>much <00:29:21.788>for <00:29:21.944>being <00:29:22.100>here.

608
00:29:23.200 --> 00:29:23.700
<00:29:23.200>Thank <00:29:23.650>you.