1
00:00:00,090 --> 00:00:05,470
>> Kyle Simpson: Now, I've shared with
you this highly scientific graph, okay.

2
00:00:05,470 --> 00:00:10,216
This plots out very specific scientific
data of my journey of learning how

3
00:00:10,216 --> 00:00:14,283
to incorporate declarative
techniques into my programming.

4
00:00:14,283 --> 00:00:22,220
And my ascertation of what impact that
had on the readability of my code, okay?

5
00:00:22,220 --> 00:00:24,120
You notice that at the beginning,

6
00:00:24,120 --> 00:00:28,920
there's kind of an initial wind
that you start using something.

7
00:00:28,920 --> 00:00:33,030
Like somebody teaches you something
like math, for filter or reduce, or

8
00:00:33,030 --> 00:00:36,610
everybody's favorite 4H, which by the way
is not functional programming, sorry.

9
00:00:38,170 --> 00:00:41,070
But somebody teaches stuff like that and
you throw it in the code, and

10
00:00:41,070 --> 00:00:43,220
now you feel like,
my codes, way better now.

11
00:00:43,220 --> 00:00:46,483
So you started to get these early wins,
this is exactly how it went for

12
00:00:46,483 --> 00:00:48,579
me as I started to
understand these things.

13
00:00:48,579 --> 00:00:51,502
And for me,
the journey was I'm writing a book so

14
00:00:51,502 --> 00:00:54,939
I just mapped out a whole book
of all these to do comments.

15
00:00:54,939 --> 00:00:58,013
Giant sections with nothing but
to do in them, I gotta go learn this,

16
00:00:58,013 --> 00:00:59,025
I gotta go learn this.

17
00:00:59,025 --> 00:01:00,733
And I would learn it and then try it and

18
00:01:00,733 --> 00:01:04,650
some countdown like, it's a little
easier to understand now, I get it.

19
00:01:04,650 --> 00:01:05,860
So you get some early wins and

20
00:01:05,860 --> 00:01:07,730
you start to feel like you're
building some momentum.

21
00:01:09,160 --> 00:01:13,060
I'm only sharing this journey because
some of you may go on a similar journey.

22
00:01:15,070 --> 00:01:17,620
Most everybody that I've talked
to you has been on this journey.

23
00:01:17,620 --> 00:01:19,635
Okay, that you get these early wins, but

24
00:01:19,635 --> 00:01:23,090
then stuff starts to get a little more
complex, you get a little bit more

25
00:01:23,090 --> 00:01:26,270
sophisticated about the stuff
that you're bringing together.

26
00:01:28,090 --> 00:01:28,640
And eventually,

27
00:01:28,640 --> 00:01:32,720
you get to a point where the winds
are starting to taper off a little bit.

28
00:01:33,840 --> 00:01:35,720
You're still using functional techniques.

29
00:01:35,720 --> 00:01:38,550
It's not like you've given up on them,
but you're not seeing,

30
00:01:38,550 --> 00:01:42,500
when you incorporate a new technique,
as big of a difference in the readability.

31
00:01:42,500 --> 00:01:46,180
Things are slowing down, you're
reaching the top of that first curve.

32
00:01:47,740 --> 00:01:51,873
Then you throw a few more
things in to the mix, and

33
00:01:51,873 --> 00:01:56,900
uh-oh, one time you look at some code and
you're like, what does that do?

34
00:01:58,370 --> 00:02:02,780
And you look at what it used to be,
and you have this thought, and

35
00:02:02,780 --> 00:02:06,840
it was better before,
it was more readable before.

36
00:02:08,610 --> 00:02:11,385
And some of you I can see your smiling
because you've been on this curve,

37
00:02:11,385 --> 00:02:13,630
you've already know exactly
what i'm talking about.

38
00:02:13,630 --> 00:02:14,887
Maybe it wasn't functional programming,

39
00:02:14,887 --> 00:02:19,550
it maybe something else but
you see this curve it happens, okay?

40
00:02:19,550 --> 00:02:22,950
And it's gonna happen in your
journey on functional programming,

41
00:02:22,950 --> 00:02:23,570
I'm almost certain.

42
00:02:25,400 --> 00:02:30,921
And I'm sharing it with you because I'm
trying to not solve that problem for

43
00:02:30,921 --> 00:02:33,866
you, but make you aware of this effect.

44
00:02:33,866 --> 00:02:36,835
And encourage you and
challenge you not to give up,

45
00:02:36,835 --> 00:02:41,117
because you keep plunging along and
you keep trying new things like I did,

46
00:02:41,117 --> 00:02:45,860
and eventually you get to some point
like that dotted line that's there.

47
00:02:45,860 --> 00:02:49,392
That's about the point where you wanna
give up because, now the code is worse

48
00:02:49,392 --> 00:02:52,779
than it was before you ever started
trying to incorporate this new thing.

49
00:02:52,779 --> 00:02:54,671
Whether it's a new framework, or

50
00:02:54,671 --> 00:02:58,262
whether it's this whole new
paradigm functional programming,

51
00:02:58,262 --> 00:03:02,980
same thing happens, you reach this point
of questioning, why did I even start this?

52
00:03:04,920 --> 00:03:08,270
This existential crisis,
why am I even, am I even a programmer?

53
00:03:09,660 --> 00:03:10,160
What is this?

54
00:03:11,370 --> 00:03:15,200
Well all go through that, and
that's where many developers give up.

55
00:03:16,780 --> 00:03:19,177
And it's where I almost gave up.

56
00:03:19,177 --> 00:03:22,410
It was about chapter two and
a half of my book.

57
00:03:24,230 --> 00:03:29,200
And I was like, wow,
this is really much worse than I thought.

58
00:03:29,200 --> 00:03:31,394
It's much more complicated than I thought.

59
00:03:31,394 --> 00:03:34,406
It's gonna take a lot more time for me to
learn and get comfortable with this stuff.

60
00:03:34,406 --> 00:03:37,310
This isn't gonna be like,
I'm done in a few months and then I,

61
00:03:37,310 --> 00:03:40,280
I get my membership card in the mail,
now I can say I'm functional programmer.

62
00:03:40,280 --> 00:03:43,036
That's not how this is gonna be,
there's gonna be like decades.

63
00:03:43,036 --> 00:03:46,179
Years and decades of me trying
to change the way that I think,

64
00:03:46,179 --> 00:03:48,410
to think and solve problems differently.

65
00:03:51,560 --> 00:03:53,640
But at the same time,
I still got a ship code.

66
00:03:53,640 --> 00:03:57,760
I would imagine most of you, if not all of
you are in the business of being paid to

67
00:03:57,760 --> 00:04:01,720
ship code, I gotta ship code.

68
00:04:01,720 --> 00:04:04,270
Even though I'm a teacher, I got to ship
code because I gotta write libraries and

69
00:04:04,270 --> 00:04:06,000
help support all this stuff I teach.

70
00:04:06,000 --> 00:04:10,560
I have to still ship code, every once
in a while I work on a side project

71
00:04:10,560 --> 00:04:14,930
where I have to ship code,
so it's not good enough.

72
00:04:14,930 --> 00:04:18,950
For me to sit in an ivory tower and
think big thoughts about what

73
00:04:18,950 --> 00:04:22,825
programming could be,
if I can't put that into practice.

74
00:04:22,825 --> 00:04:25,224
It's useless, it's a waste of time.

75
00:04:25,224 --> 00:04:28,190
And I would imagine many of
you are in the same boat.

76
00:04:28,190 --> 00:04:32,310
So you're gonna get to that point where
you're headed towards the pit of despair,

77
00:04:32,310 --> 00:04:37,024
as they call it, I love that,
the pit of despair.

78
00:04:37,024 --> 00:04:39,470
You're gonna be headed towards
the pit of despair and

79
00:04:39,470 --> 00:04:42,330
you're gonna be saying, nope back up.

80
00:04:42,330 --> 00:04:45,030
Go back to what I was doing before,
and I was there.

81
00:04:46,210 --> 00:04:49,940
And what I'm gonna encourage you
to do is keep pushing through,

82
00:04:49,940 --> 00:04:52,130
because I kept pushing through.

83
00:04:52,130 --> 00:04:55,670
I kept saying,
maybe it was from some naivete on my part,

84
00:04:55,670 --> 00:04:58,030
but I kept saying,
one of these days I'm gonna get it.

85
00:04:58,030 --> 00:05:00,150
Maybe I'm just a little thick
headed on this stuff, but

86
00:05:00,150 --> 00:05:03,020
I'm gonna get it, it's gonna start
to click and I kept pushing.

87
00:05:03,020 --> 00:05:06,844
And I kept trying to add new things
onto it, and create new knowledge and

88
00:05:06,844 --> 00:05:09,867
new experiences and
try it on a different piece of code.

89
00:05:09,867 --> 00:05:13,210
And at some point,
the bottom of the curve arrived.

90
00:05:13,210 --> 00:05:17,404
And one day, I looked at a piece
of code that was using a curried

91
00:05:17,404 --> 00:05:20,760
composition or whatever.

92
00:05:20,760 --> 00:05:24,030
And it clicked for me,
that just that one line, not everything.

93
00:05:24,030 --> 00:05:26,690
It's not like you wake up one day and
it all works, but

94
00:05:26,690 --> 00:05:29,439
just that one line actually
made more sense to me.

95
00:05:30,690 --> 00:05:33,780
And a week later, another line
of code made more sense to me.

96
00:05:33,780 --> 00:05:37,270
And a week later, and a month later,
and six months later.

97
00:05:38,460 --> 00:05:41,981
I'm three years into this journey of, I
wanna learn about functional programming.

98
00:05:41,981 --> 00:05:46,799
Book's been out a year and a half, I spent
a year and a half writing the book, so

99
00:05:46,799 --> 00:05:48,778
I've been at this three years.

100
00:05:48,778 --> 00:05:52,780
I'm not the end of the curve, but
it's on a good trend, that's what I'd say.

101
00:05:54,200 --> 00:05:55,730
So it's worth it to keep pushing,

102
00:05:57,500 --> 00:06:00,180
it's worth it to encourage your
co-workers to keep pushing at it.

103
00:06:01,590 --> 00:06:03,090
The ultimate pragmatist as well,

104
00:06:03,090 --> 00:06:05,550
it doesn't really matter
what the code looks like.

105
00:06:05,550 --> 00:06:09,050
Just as long as it ships because
that's what I get my paycheck, and

106
00:06:09,050 --> 00:06:12,730
I am sensitive to the idea of this
pragmatism, this whole courses based

107
00:06:12,730 --> 00:06:17,560
on the idea, that we still have to
ship working executable Java Script.

108
00:06:19,570 --> 00:06:23,850
It's not good enough that it just looks
nice, but it doesn't actually work.

109
00:06:25,310 --> 00:06:27,900
It has to actually work,
it has to do something useful for me,

110
00:06:27,900 --> 00:06:30,210
and it has to be maintainable.

111
00:06:30,210 --> 00:06:31,230
I gotta be able to go back and

112
00:06:31,230 --> 00:06:34,620
understand what the hack I was doing,
otherwise what was the point?

113
00:06:35,860 --> 00:06:39,620
So this look at functional
programming that we're diving into,

114
00:06:39,620 --> 00:06:44,100
is born out of this idea of,
let's not take the theoretical top down.

115
00:06:44,100 --> 00:06:46,850
Let's take the practical and
pragmatic bottom up approach.

116
00:06:48,010 --> 00:06:50,150
Let's start with what we know how to do,
and

117
00:06:50,150 --> 00:06:53,550
try to make it a little bit more
functional, one piece at a time.

118
00:06:56,010 --> 00:06:58,721
Let's look at this pile of
equipment on the ground, and

119
00:06:58,721 --> 00:07:00,983
let's just figure out
what a carabiner does.

120
00:07:00,983 --> 00:07:04,871
And then let's just figure out how to tie
a knot, and how to put some rope in, and

121
00:07:04,871 --> 00:07:08,040
how to take our first
step onto the cliff face.

122
00:07:08,040 --> 00:07:13,820
That's it, just one thing at a time, and
if you do and if you keep pushing through

123
00:07:13,820 --> 00:07:19,430
and you keep trying that stuff in it,
I can not make that not a difficult climb.

124
00:07:20,510 --> 00:07:22,539
I don't have the magic to fix that,

125
00:07:22,539 --> 00:07:26,269
I can't make it not a difficult climb,
what I can make it for you.

126
00:07:26,269 --> 00:07:30,886
And this is my hope with the book and
the course, what I can make it for

127
00:07:30,886 --> 00:07:33,680
you is, that it's a manageable climb.

128
00:07:33,680 --> 00:07:38,330
Somebody can tell you how the equipment
works, so that you can start climbing.

129
00:07:38,330 --> 00:07:39,790
That's what we're trying to do here, okay?

130
00:07:41,510 --> 00:07:46,327
Now, there's a tension that
I wanna call out in this.

131
00:07:46,327 --> 00:07:48,970
There's a tension here because I and
you may have missed it.

132
00:07:48,970 --> 00:07:50,750
And that's why I wanna call it out.

133
00:07:50,750 --> 00:07:55,670
Because I said at one time, no,
no, you gotta keep pushing on it.

134
00:07:55,670 --> 00:07:59,080
You gotta keep trying it, and
even though it's more confusing.

135
00:07:59,080 --> 00:08:03,480
And then at the same time,
almost in the same sentence, I said, but

136
00:08:03,480 --> 00:08:05,439
you still got a ship code
that can be maintained.

137
00:08:06,500 --> 00:08:11,530
There's a tension here because, if you
only work with code that is familiar,

138
00:08:11,530 --> 00:08:12,970
and readable, and understandable.

139
00:08:14,030 --> 00:08:16,070
And anything you do
that's not readable and

140
00:08:16,070 --> 00:08:19,530
understandable, you just take the shortcut
out of, well I'm a pragmatist,

141
00:08:19,530 --> 00:08:20,800
I got to go back to what works.

142
00:08:22,170 --> 00:08:23,940
Then you're never gonna
advance along that curve.

143
00:08:25,620 --> 00:08:28,177
And at the same time,
if you advance along the curve and

144
00:08:28,177 --> 00:08:31,187
you never connect it back to
anything practical and pragmatic.

145
00:08:31,187 --> 00:08:32,763
You're going to lose the motivation and

146
00:08:32,763 --> 00:08:35,060
you're gonna bail out
at some point anyway.

147
00:08:35,060 --> 00:08:37,820
So there is a tension here,
and I can't fix the tension.

148
00:08:37,820 --> 00:08:40,690
I can simply call it out for
you and make you aware of and

149
00:08:40,690 --> 00:08:45,380
be prepared for, at every moment that you
take one of these concepts, like what

150
00:08:45,380 --> 00:08:48,860
we're gonna talk about in this course,
and you try to apply it to your code.

151
00:08:48,860 --> 00:08:53,030
It is going to happen, that it's more
confusing at that moment than it was

152
00:08:53,030 --> 00:08:55,450
before, because it's not yet familiar.

153
00:08:57,300 --> 00:09:02,070
So you're going to have to be comfortable
in that gray area where it's uncomfortable

154
00:09:02,070 --> 00:09:04,180
and feels less readable.

155
00:09:04,180 --> 00:09:07,890
And you're gonna have to try it not once,
not twice, ten times, a hundred times,

156
00:09:07,890 --> 00:09:10,560
a thousand times before that
thing becomes familiar.

157
00:09:12,070 --> 00:09:16,040
And at the same time,
you're gonna have to have an eye towards.

158
00:09:16,040 --> 00:09:20,185
If I wanna continue,
if I wanna sustain the journey,

159
00:09:20,185 --> 00:09:22,864
if I wanna make it up the mountain.

160
00:09:22,864 --> 00:09:25,561
It's simple when I got the chip code and

161
00:09:25,561 --> 00:09:30,626
I got to make a practical choice that at
this in my code and at this point in my

162
00:09:30,626 --> 00:09:36,540
journey of understanding I don't need that
thing, a four loop will do, you with me?

163
00:09:37,750 --> 00:09:42,170
That tension, it exists, you should be
aware of it, you should meet it face on.


