spotifyovercastrssapple-podcasts

Deliberate Practice

We discuss deliberate practice and how it can help you hone your craft, and make you even better at using Opaque Types.
December 5, 2022
#71
  • Practice makes permanent
  • Flow book by Mihaly Csikszentmihalyi

Key Principles of Deliberate Practice

Transcript

[00:00:00]
Hello Jeroen.
[00:00:02]
Hello Dillon.
[00:00:03]
Do you know this phrase?
[00:00:05]
Practice makes...
[00:00:06]
Perfect?
[00:00:08]
Practice makes permanent.
[00:00:10]
Perfect practice makes perfect.
[00:00:11]
We should have practiced that one, huh?
[00:00:13]
Do you want to start over?
[00:00:17]
Or can we live with our faults, Dillon?
[00:00:21]
Faults are part of the process, Jeroen.
[00:00:23]
That's part of practicing.
[00:00:26]
So what are we talking about today?
[00:00:28]
Today we're going to talk about deliberate practice.
[00:00:32]
Deliberate practice?
[00:00:33]
Now I'm very confused.
[00:00:34]
Like, does it make things permanent?
[00:00:36]
Does it make things perfect?
[00:00:38]
Does it make anything, Dillon?
[00:00:40]
Does it make anything?
[00:00:41]
Yeah.
[00:00:42]
Well, yeah.
[00:00:43]
What is practice?
[00:00:44]
Like what does that word mean?
[00:00:46]
What is deliberate?
[00:00:47]
Yeah.
[00:00:48]
Are there...
[00:00:49]
These...
[00:00:50]
Both of these concepts are very near and dear to my heart.
[00:00:53]
And maybe I should preface this with, I don't know that we've talked about this on the podcast
[00:01:00]
before, but before computer science, I was studying music and piano performance.
[00:01:07]
And...
[00:01:08]
You have mentioned it, yes.
[00:01:10]
Okay.
[00:01:11]
Yeah.
[00:01:12]
So that informed a lot of how I approach coding.
[00:01:15]
And deliberate practice is like really studying classical performance is like a very good
[00:01:24]
way to learn about deliberate practice.
[00:01:26]
Because that's kind of all you do.
[00:01:28]
I thought you were going to say something like, well, the piano and programming is the
[00:01:32]
same.
[00:01:33]
Like you play on the keyboard.
[00:01:35]
That's also true.
[00:01:36]
That's also true.
[00:01:37]
Keyboards are a very important part of my life.
[00:01:38]
Yeah, absolutely.
[00:01:39]
Not the same one though.
[00:01:43]
Have you ever played piano on a Zerti keyboard?
[00:01:48]
You know, I may have actually tried that.
[00:01:51]
Really?
[00:01:52]
I'm not sure I'd recommend it though.
[00:01:55]
All right.
[00:01:56]
Dillon, what is deliberate practice?
[00:01:59]
Or do you want to start with practice?
[00:02:01]
I don't know how you want to introduce this.
[00:02:03]
Yeah.
[00:02:04]
So, well, let's think about the word practice for a second.
[00:02:07]
Because in a way, there are two senses of the word practice.
[00:02:12]
One sense is we think about, I'm going to sit down and practice my tennis serve.
[00:02:16]
I'm going to practice my scales.
[00:02:18]
I'm going to practice this song on the piano.
[00:02:21]
And then you might have a writing practice, or you might be a practicing coder.
[00:02:27]
You're a practitioner of programming.
[00:02:29]
Right?
[00:02:30]
So.
[00:02:31]
Right.
[00:02:32]
Yeah.
[00:02:33]
So the difference is when you're a practitioner, you're doing something.
[00:02:37]
And when you practice, you're training.
[00:02:39]
Right?
[00:02:40]
Right.
[00:02:41]
Right.
[00:02:42]
And so in a sense, I think that really gets at actually this concept that we were kind
[00:02:48]
of joking about earlier of practice makes permanent.
[00:02:51]
I think that's kind of what practicing is.
[00:02:55]
It's like making things permanent.
[00:02:57]
So in a certain sense, we're always practicing, meaning we're always enforcing habits.
[00:03:04]
We're always building habits.
[00:03:06]
Whether we're consciously trying to build habits or not, we always are.
[00:03:11]
So deliberate practice is when you are intentional about what habits you want to build.
[00:03:18]
And in addition to that, there are a couple of principles that help you better ingrain
[00:03:26]
habits.
[00:03:27]
For example, isolating things down into smaller pieces so you can really focus on them.
[00:03:34]
You know, I think we talked about this in our learning episode, which I definitely recommend
[00:03:39]
people go back and listen to if they haven't, about feedback loops and how feedback and
[00:03:44]
learning are kind of the same thing.
[00:03:46]
And so a lot of deliberate practice is thinking about, well, if you want to build a habit,
[00:03:53]
you should probably think about isolating down where you want to build that habit because
[00:03:57]
you're going to be more effective at building that habit.
[00:04:00]
Would you be in a way okay with renaming deliberate practice to deliberate habits?
[00:04:05]
Absolutely.
[00:04:06]
Yeah.
[00:04:07]
I mean, I love that idea.
[00:04:08]
To me, habits and practice are the same concept essentially.
[00:04:13]
Yeah, absolutely.
[00:04:14]
Deliberate habits is the intended results and deliberate practice is the means in a
[00:04:21]
way.
[00:04:22]
But okay, I didn't see it that way, but yeah, it makes a lot of sense.
[00:04:26]
Yeah.
[00:04:27]
So, you know, it's really interesting because with music, with classical performance, I'd
[00:04:32]
say like 90% of what you're doing is deliberate practice.
[00:04:37]
You know, you also have, of course, performances, rehearsals, things that are maybe more working
[00:04:46]
to achieve some result.
[00:04:48]
You need to decide on an interpretation with a group of musicians or you're in a concert
[00:04:54]
performing, but 90% of the time you're taking those goals that you have and then sitting
[00:05:00]
down and workshopping them and trying to isolate things to build those habits into your performing.
[00:05:09]
As programmers, as working programmers, it's not 90% of being a programmer.
[00:05:15]
No, no, 90% is reading the code and fixing bugs.
[00:05:20]
Right.
[00:05:21]
And it shouldn't be 90%, but I believe that it's a good idea for it to be more than 0%.
[00:05:29]
And I believe that for many programmers, it is 0%.
[00:05:33]
And I can say that like, it's really shaped me as a programmer.
[00:05:37]
By the way, you shouldn't feel bad if it's 0% because, I mean, Dillon, you wouldn't want
[00:05:42]
to make me feel bad, right?
[00:05:44]
No, I mean, if it's 0%, let's put it this way, you have an opportunity to do something
[00:05:53]
that might make you a better programmer.
[00:05:55]
If you're doing 0% deliberate practice and you're already achieving the things you want
[00:06:02]
to with your coding and your career, imagine if it was 1%, 2% of your time, what might
[00:06:09]
you be able to accomplish?
[00:06:10]
How might you be able to grow from that?
[00:06:12]
So I think it's an opportunity.
[00:06:13]
Yeah.
[00:06:14]
Well, the question is also like, do you get anything out of 1% of deliberate practice?
[00:06:20]
But maybe we should explain the difference between practice and deliberate practice and
[00:06:25]
get into that.
[00:06:26]
Yeah.
[00:06:27]
Well, so, okay.
[00:06:29]
So what I like to think about for deliberate practice, with practice, we're always practicing.
[00:06:36]
We're always doing, enforcing some habits, reinforcing, whether we're reinforcing habits
[00:06:42]
or trying to shape habits in a different way.
[00:06:45]
Well, yeah, but also like if you're just training for a marathon, right, or just running, and
[00:06:52]
if you just go running every week without much thought, you're practicing, you're training,
[00:07:01]
but you are not deliberately practicing, right?
[00:07:05]
I would put building muscle and endurance physically into a different category.
[00:07:14]
Because you move those muscles and something is happening that's making you stronger.
[00:07:21]
And the goal is not necessarily, I mean, partially, I'm sure for very high level runners, they
[00:07:27]
are thinking about their form.
[00:07:29]
For most of us, if we're going out on a jog, or even training for a marathon, we're probably
[00:07:34]
not thinking too much about form.
[00:07:36]
We're probably focused more on just pushing ourselves to do the run.
[00:07:41]
Yeah.
[00:07:42]
I'm guessing you could also train specific muscles more, like if you run faster, then
[00:07:49]
you're going to train some muscles more than others.
[00:07:51]
And if you run slower, then the opposite.
[00:07:55]
Right.
[00:07:56]
Yes.
[00:07:57]
So there can be an intentionality and goal behind it in a more intentional way or a less
[00:08:02]
intentional way, for sure.
[00:08:05]
But at the end of the day, a large part of it is building endurance and muscle, building
[00:08:10]
up some physical capacity.
[00:08:12]
But yeah, I think we're more focused on intellectual habits and skills that are not physical.
[00:08:20]
So this is the example I like to use.
[00:08:23]
So let's say that you have been entered into a race.
[00:08:29]
You're going to be...
[00:08:30]
A physical race?
[00:08:32]
Do you drive, Jeroen?
[00:08:34]
You live in Paris, so you don't have much reason to drive.
[00:08:38]
No, I don't.
[00:08:39]
I know how to drive.
[00:08:41]
I've got my license, but I don't have a car and I rarely drive.
[00:08:46]
I will.
[00:08:47]
I'll take it.
[00:08:48]
I'll take this.
[00:08:49]
Maybe, maybe my example is catered to American audiences or California audiences.
[00:08:54]
That is quite possible.
[00:08:55]
Where you don't have the subway.
[00:08:57]
Yeah.
[00:08:58]
Gotcha.
[00:08:59]
Yeah.
[00:09:00]
We use cars a lot in California.
[00:09:01]
Unfortunately, I wish we had better public transportation in Southern California, but
[00:09:06]
we don't.
[00:09:07]
But if you are enlisted in a race, you really don't want to make a fool of yourself in the
[00:09:12]
race.
[00:09:13]
You want to place well, and you're given a few months to prepare for the race.
[00:09:18]
Let's say you're a daily commuter.
[00:09:21]
You're stuck in traffic for three hours a day.
[00:09:24]
So every day you're practicing driving for three hours, right?
[00:09:29]
And so you have to decide, like, how well prepared are you going to feel for that race
[00:09:36]
in three months with three hours a day stuck in traffic?
[00:09:39]
Well, not much, I would say.
[00:09:41]
But why?
[00:09:42]
Because you're, you're spending three hours in a car.
[00:09:45]
Yeah, but you're spending three hours in, um, stuck in traffic.
[00:09:50]
So you're, you're, you're actually training more to stay still in your car than to actually
[00:09:58]
drive.
[00:09:59]
Okay.
[00:10:00]
Now, what if, what if you were doing a three hour commute on a clear highway?
[00:10:06]
How would, how prepared would you feel then?
[00:10:08]
A lot more, I think, because you would be able to drive the way you want.
[00:10:14]
And if you're sure that you won't get caught by the cops or something, then you can drive
[00:10:19]
as fast as you want and do as many dangerous tricks that you might want to try out.
[00:10:25]
Yeah.
[00:10:26]
What if you, what if you had access to the racetrack and drove around that for three
[00:10:31]
hours?
[00:10:32]
How would you feel then compared to driving on the freeway?
[00:10:34]
Well, that would feel even better because you would get to know the track.
[00:10:40]
You would get to know the things you, you would do what you would need to do during
[00:10:45]
the race.
[00:10:46]
Right?
[00:10:47]
So you, you would learn all the hooks and crannies of the race and you could notice,
[00:10:53]
Oh, well, some of them I'm having trouble with.
[00:10:56]
So you can focus on those.
[00:10:58]
Right.
[00:10:59]
And you would have to discover them during the race otherwise.
[00:11:02]
Right.
[00:11:03]
Yeah.
[00:11:04]
So that would definitely be helpful.
[00:11:05]
Would you be satisfied with only doing that for the three months leading up to the race?
[00:11:09]
Like if you really, really want to do well in this race, would that be the only thing
[00:11:14]
you would do or is there anything else you would add into your routine?
[00:11:17]
I would add in rest.
[00:11:19]
Yeah.
[00:11:20]
That's really quite nice.
[00:11:22]
Otherwise it sounds pretty good.
[00:11:25]
Okay.
[00:11:26]
In the sense that if I can choose how to drive on that track, then yeah.
[00:11:32]
Like, as I said, like if I want to focus on some corners, then, then I can focus on those
[00:11:38]
corners.
[00:11:39]
But if I need to do the whole track over and over again, without thinking about that more,
[00:11:45]
without being able to select what I want to do, then there's a lot of things that will
[00:11:50]
be very repetitive in a non-interesting way.
[00:11:55]
I would say.
[00:11:56]
Right.
[00:11:57]
Here's what I would be thinking about if I were faced with this choice.
[00:12:00]
I would be thinking, okay, like this is great.
[00:12:04]
I have access to this track and I definitely want to take advantage of that.
[00:12:08]
That's going to be very useful, but I'm not a race car driver.
[00:12:12]
I'm a driver in casual traffic and I have a set of skills and habits that I use driving
[00:12:21]
that helps me navigate through that, but it's not really going to equip me that well to
[00:12:25]
high performance racing.
[00:12:27]
So I might need to build a new set of habits.
[00:12:31]
And if I just go for three months, three hours a day driving around this racetrack, I might
[00:12:37]
be reinforcing some of those habits and get stuck in them and I might sort of plateau.
[00:12:43]
And so I would be thinking, how do I avoid plateauing?
[00:12:47]
And so what I would be thinking about to try to avoid that would be, well, what are the
[00:12:52]
skills I should be learning?
[00:12:54]
How do, first of all, I would probably come up with like a set of goals and try to understand
[00:12:59]
like what should I get better at to be a race car driver?
[00:13:02]
So okay, maybe I should get good at going around turns because maybe the way a race
[00:13:08]
car driver goes around turns is different than how I go around turns on the highway
[00:13:13]
or hopefully, hopefully, right?
[00:13:16]
And probably any passengers in my car are probably going to feel extremely uncomfortable
[00:13:21]
if I'm going around turns like a race car driver.
[00:13:24]
I don't think the local police officers would appreciate that.
[00:13:29]
And I might get more attention than I want to from that.
[00:13:32]
Remind me never to get into your car.
[00:13:39]
So that's one thing, like what are the skills and identify those.
[00:13:45]
And so then I could kind of come up with a set of goals, a set of habits I'd like to
[00:13:50]
build and just understand what are those techniques I want to learn.
[00:13:54]
But then I would be thinking about how can I isolate those things because going around
[00:13:59]
turns, if I just go around a bunch of turns, maybe that's not the most efficient way to
[00:14:04]
build those habits in.
[00:14:06]
Maybe I need to isolate that more.
[00:14:08]
So then I'd be thinking about isolating because if I'm just going around a turn, that might
[00:14:12]
be for one thing, it's a very long feedback loop.
[00:14:16]
Maybe it's a long racetrack and I have long stretches where there's not a turn.
[00:14:22]
I'm mixing these things that I'm practicing.
[00:14:25]
So my intention, I go in and I say, today I want to work on these turns.
[00:14:30]
But now I have to wait all this time going through the straightaway section before I
[00:14:35]
can practice a turn.
[00:14:36]
And then there are all these other things going on and my brain can't just focus on
[00:14:40]
building that habit.
[00:14:41]
So what I really want is a highly repeatable turn, turn, turn.
[00:14:47]
How would you do that?
[00:14:48]
Probably find access to a big parking lot space and get some traffic cones and practice
[00:14:56]
turning around those.
[00:14:57]
Set up the little thing, try not to knock over any cones.
[00:15:02]
Maybe I can get somebody to come with a stopwatch and time how long it takes me to get around
[00:15:07]
turns and make sure I'm improving.
[00:15:09]
So I'm setting up a feedback loop and I'm trying to drill in that thing in isolation.
[00:15:17]
So isolation is a key principle of deliberate practice.
[00:15:22]
And we lack isolation when we are practicing our craft in the wild.
[00:15:28]
And therefore, we want to take it out of the wild into a lab, into isolation, so we can
[00:15:35]
isolate it.
[00:15:36]
Yeah, it makes me think of Trackmania, that video game where you play a race car in weird
[00:15:43]
environments or weird tracks.
[00:15:47]
And one of the things you can do is you can just, with the press of a key, restart from
[00:15:51]
scratch.
[00:15:52]
Right.
[00:15:53]
Or from a, I guess you could change the map to train only this section that you're interested
[00:15:59]
in.
[00:16:00]
And yeah, you could practice some part of the track and repeat and repeat and repeat
[00:16:07]
it over and over again until you're satisfied with it.
[00:16:10]
They can have a very quick feedback loop because they can try it out a lot of times as well.
[00:16:16]
Exactly.
[00:16:17]
Yeah.
[00:16:18]
Yeah.
[00:16:19]
And tools are actually an important part of deliberate practice, I think, because it helps
[00:16:24]
you hone those feedback loops.
[00:16:27]
Like if you're practicing music, a metronome is a great tool for that because if you're
[00:16:32]
practicing scales and you want to play scales evenly, you can get feedback.
[00:16:39]
Am I playing that scale evenly?
[00:16:40]
And the metronome can help you do that.
[00:16:42]
And there are a number of ways that you can use that to slowly increase the speed that
[00:16:47]
you're playing.
[00:16:48]
And so tools are a very important part of that.
[00:16:50]
And the same is true for programmers wanting to do deliberate practice.
[00:16:55]
So we'll enter that side of programming a little bit later because we haven't talked
[00:17:02]
much about programming, but this is still a program podcast.
[00:17:05]
It is.
[00:17:06]
It is.
[00:17:07]
Yes.
[00:17:08]
It is not a race car driving podcast yet.
[00:17:11]
Maybe eventually we'll pivot.
[00:17:14]
Maybe.
[00:17:16]
I mean, my company sponsors Formula One.
[00:17:19]
So yeah.
[00:17:20]
Really?
[00:17:21]
Yeah.
[00:17:22]
And you can see CrowdStrike on some of the cars.
[00:17:27]
That's cool.
[00:17:28]
Wow.
[00:17:29]
A lot of big tech companies do that apparently.
[00:17:33]
Maybe this is a more realistic scenario than I realized.
[00:17:36]
Maybe.
[00:17:37]
Yeah.
[00:17:38]
I think another thing to think about in this deliberate practice is, so there's a book
[00:17:46]
called Flow by Jigset Mihaly.
[00:17:51]
I've heard people pronounce it that way, but Jigset Mihaly, Jigset Mihaly, something like
[00:17:57]
that.
[00:17:58]
Yeah.
[00:17:59]
It's a wonderful book.
[00:18:00]
It's called Flow.
[00:18:01]
Definitely recommend reading it.
[00:18:02]
But he has this concept that essentially there's a flow state, which often people talk about
[00:18:10]
losing track of time, getting into the flow of things, being in a Zen state where you're
[00:18:18]
extremely engaged with your work and really tuned into it and performing at a high level.
[00:18:24]
And he kind of talks about this flow state as, for one thing, he explores like, how do
[00:18:29]
you get into a flow state?
[00:18:31]
And for another thing, he has this idea that really flow states are when you're learning
[00:18:37]
and growing.
[00:18:38]
And so you should try to stay in that flow state as much as you can to be growing and
[00:18:44]
not plateauing.
[00:18:45]
Yes.
[00:18:46]
I have a meeting in five minutes, so nope.
[00:18:49]
Right.
[00:18:50]
I mean, we are practitioners.
[00:18:53]
We need to accomplish tasks and there's a fine balance, right?
[00:18:59]
But this idea of flow state, certainly when you are doing deliberate practice, I think
[00:19:05]
it's really good to think about flow state.
[00:19:06]
And one of the key principles of flow state from this book is the appropriate level of
[00:19:12]
challenge.
[00:19:13]
Right.
[00:19:14]
So I'm guessing if it's too easy, then you're going to start thinking about other things
[00:19:19]
because it doesn't require much focus.
[00:19:22]
And if it's too difficult for you, then you're just not going to succeed and you're not going
[00:19:27]
to learn much.
[00:19:28]
Right.
[00:19:29]
Exactly.
[00:19:30]
Yeah.
[00:19:31]
If you've never driven a car and somebody says, go around this racetrack, you're not
[00:19:35]
going to learn very much because it's not an appropriate level of challenge.
[00:19:40]
If you've never driven stick shift, that's probably more catered to American audiences
[00:19:45]
too.
[00:19:46]
But yeah, and you're trying to learn how to drive stick shift, then it might not be an
[00:19:52]
appropriate level of challenge to just dive into stick shift around the racetrack, trying
[00:19:56]
to go at a fast speed and do the tight turns.
[00:19:59]
So isolation can help you balance out to get that appropriate level of challenge.
[00:20:05]
So that's one of the tools at our disposal.
[00:20:08]
So like, you know, if you're practicing piano, like one way to isolate things is to say,
[00:20:15]
play hands separately.
[00:20:16]
You know, that's like a common technique.
[00:20:18]
So you have like some complicated passage, play just the left hand, then play just the
[00:20:23]
right hand.
[00:20:24]
You have, you know, another way to isolate is instead of playing the entire piece, just
[00:20:30]
play these four measures or just play this one measure or just play this set of notes.
[00:20:36]
Or you can create small exercises that are a simplified version of the thing you're trying
[00:20:42]
to learn to make it easier for yourself.
[00:20:44]
You can play every other note of a passage.
[00:20:46]
There are all these, like musicians get very creative with coming up with ways of isolating
[00:20:52]
the thing you're trying to work on to make it an appropriate level of challenge.
[00:20:56]
So you can keep sort of cranking up the gears to get to more and more difficult challenges
[00:21:03]
so you can continue growing.
[00:21:04]
But you're always trying to like stay on that edge of growth where you're challenging yourself
[00:21:09]
the appropriate amount to keep growing.
[00:21:11]
And you can also use like slowing down or speeding up the tempo.
[00:21:15]
These are all different techniques to isolate and to simplify.
[00:21:21]
And we can do that with code too.
[00:21:24]
But if you're doing that in a production code base, that might be challenging.
[00:21:28]
That might not be the best place to do that.
[00:21:30]
And also you have a deadline coming up and you know, some users are asking when this
[00:21:35]
feature is going to be out.
[00:21:38]
And you know, it's a Friday and you want to get this wrapped up before the weekend or
[00:21:45]
whatever, right?
[00:21:46]
Like those are all reasonable things.
[00:21:48]
Like you're working.
[00:21:51]
And that's why it's so important to take the time to do deliberate practice because we're
[00:21:56]
not necessarily going to be able to hone these things.
[00:21:59]
Also just like driving stick shift for the first time while going 200 miles per hour
[00:22:06]
around a racetrack with tight turns is going to be too much for somebody who's learning
[00:22:11]
stick shift.
[00:22:12]
If you're trying to get good at, now we get into the coding part.
[00:22:15]
If you're trying to get good at test driven development, guess what?
[00:22:19]
Doing a very difficult problem that you're trying to solve at work in a code base that
[00:22:25]
doesn't have any unit testing.
[00:22:28]
And you're trying to figure out the right way to get test coverage around that might
[00:22:33]
not be the best place to learn how to do unit testing.
[00:22:37]
Right?
[00:22:38]
So if you're expecting to get good at unit testing by just trying it out in the wild
[00:22:44]
in the context of a complex code base, maybe with legacy code and all these things, that's
[00:22:50]
a really hard way to try to learn that.
[00:22:53]
Yeah.
[00:22:54]
And you're also going to have cases like, Oh yeah, this case, like we actually don't
[00:22:59]
want to do this or, Oh, this is actually quite difficult because there's this hidden requirements.
[00:23:06]
Exactly.
[00:23:07]
Yeah, exactly.
[00:23:08]
So how do we do isolation as programmers for our deliberate practice?
[00:23:14]
Just like, you know, classical musicians are very good at isolating in their practice routines.
[00:23:21]
How can we, how can we do that as programmers?
[00:23:24]
Number one, do something where you're not under production pressure, where you are not
[00:23:29]
working in a production code base and you are not working under deadline pressure and
[00:23:34]
where, and in fact, where your goal is not to ship a feature.
[00:23:38]
That is a very good tool for learning because then your entire goal is learning and you
[00:23:44]
can completely focus on that and you can create the best artificial conditions for that.
[00:23:48]
It's like a little lab for learning.
[00:23:50]
Yeah.
[00:23:51]
I'm guessing if you can do this learning outside of work, then you're sure not to have any
[00:23:56]
pressure, but not everyone has the time or, or as the environment to do that.
[00:24:02]
And you need to learn at work.
[00:24:04]
Like otherwise you have probably bad place you work, you're working at.
[00:24:09]
But I mean, if you're learning on your own, then you're sure not to have any pressure
[00:24:14]
like that.
[00:24:15]
Yeah.
[00:24:16]
I mean, it, I think it depends on the individual.
[00:24:19]
I've certainly done a lot of deliberate practice on my own time in my career.
[00:24:24]
I've also done a lot of deliberate practice.
[00:24:26]
I mean, I've done a lot of coaching teams doing deliberate practice being paid to do
[00:24:32]
that.
[00:24:33]
You know, I've done more of that than I've done.
[00:24:37]
I've done more of trying to like get companies to make deliberate practice part of their
[00:24:43]
employees paid work time.
[00:24:46]
And I have feeling comfortable to like learn on company time myself as an employee, but
[00:24:53]
I'm kind of unique that way.
[00:24:55]
But you know, I, I strongly believe in, in the benefits of companies creating a culture
[00:25:02]
where people feel empowered to spend learning time on company hours because it benefits
[00:25:09]
the company.
[00:25:10]
It makes, it makes the team better at what they do and it, and it improves the code quality.
[00:25:15]
So it's like, there are very clear benefits to the company, but as you say, not, not everybody
[00:25:21]
is going to be in a company culture where they feel comfortable doing that.
[00:25:26]
So you know, if you, if you don't feel that you have the ability to help build that kind
[00:25:31]
of company culture, you might end up spending some of your own free time doing some deliberate
[00:25:36]
practice.
[00:25:37]
And if you're a student, then you're going to have to do it on your own time.
[00:25:40]
Yeah.
[00:25:41]
Yeah.
[00:25:42]
Right.
[00:25:43]
Because you don't have a company.
[00:25:44]
You might do it in the middle of a teacher's lecture, but that's not a good idea.
[00:25:50]
Yeah.
[00:25:51]
Stay focused on your, on your lesson.
[00:25:53]
All right.
[00:25:54]
And also if you're doing deliberate practice, try to avoid multitasking.
[00:25:58]
But yeah, so, so if you, if you do set aside the time in whatever context to do some deliberate
[00:26:05]
practice, you want to do some deliberate practice coding.
[00:26:08]
What does isolating things look like?
[00:26:10]
You want like, so first of all, I think an important piece is like starting with a goal.
[00:26:17]
So a key concept of deliberate practice is it's intentional.
[00:26:21]
There's a goal behind it.
[00:26:22]
It's not like it doesn't, doesn't particularly make sense to do like it's, it's not really
[00:26:29]
deliberate practice if there's not a clear intention.
[00:26:33]
So that's number one, start with a clear intention and you can get better over time aligning
[00:26:38]
that clear intention with a routine that is going to help you achieve that goal.
[00:26:46]
What kind of goal are we talking about?
[00:26:48]
Is it the goal of results or a goal of like a, I want to, like imagine we're trying to
[00:26:56]
type faster.
[00:26:57]
Can a goal be like, I want to be 20% faster or should it be, I should write 5,000 words
[00:27:03]
in this next hour?
[00:27:04]
Well, if I was trying to do deliberate practice for typing, which is, which I've done before
[00:27:09]
and it's, I think it's a good, good thing to do, even if you consider yourself to be
[00:27:13]
a proficient typist, but the types of things I've done are like, Hmm, am I pressing these
[00:27:20]
special characters in an efficient way?
[00:27:24]
Like is the finger I'm using the appropriate finger for that?
[00:27:29]
And like, is it curving over the other fingers in the right way?
[00:27:33]
And, and then I can just practice getting better at that and having a faster typing
[00:27:37]
speed that uses these characters.
[00:27:39]
And so I, so I would be less focused on, I want to be 20% faster.
[00:27:47]
I'd be more focused on like, what do I want to work on right now?
[00:27:50]
Maybe my goal is to be 20% faster overall, but that's like a more big picture strategic
[00:27:56]
goal.
[00:27:57]
But then when you sit down and you do deliberate practice, what are you going to do to get
[00:28:01]
20% faster?
[00:28:02]
Like getting 20% faster is a pretty broad goal.
[00:28:06]
And if you want like deliberate practice is all about like isolating.
[00:28:10]
So what are you going to isolate that is going to help you with that broad goal?
[00:28:14]
And so maybe there's an opportunity with the way you type special characters, maybe the
[00:28:19]
way that you're capitalizing using shift keys on either side could be improved.
[00:28:24]
Those are some things you can isolate that can help with that goal.
[00:28:26]
Yeah.
[00:28:27]
But then what is the goal for those training sessions?
[00:28:30]
Like should I be able to type those special keys 20% faster or should I do 5,000 of them?
[00:28:38]
Like what is the- I see.
[00:28:40]
I would say the goal, like if I was sitting down to do that, I would be like, my goal
[00:28:45]
right now is to, to improve the way I'm using the right, the correct shift key.
[00:28:51]
Okay.
[00:28:52]
It really is more of an intention more than a, at the end it's not a goal that you can
[00:28:57]
evaluate.
[00:28:58]
Right.
[00:28:59]
So I think it could be, but I think probably like more of a narrow thing than like a broad
[00:29:07]
strategic thing.
[00:29:08]
You can keep those strategic thing.
[00:29:09]
I want to be a 24% faster typist in mind, but I would say if I were working on that,
[00:29:15]
that would be too broad to be helpful.
[00:29:17]
But saying I want to work on how I'm using the shift keys would be specific enough to
[00:29:21]
be helpful or sitting down and saying like, I want to figure out the correct finger to
[00:29:27]
use for this thing is definitely like maybe an achievable thing that in a sitting down
[00:29:33]
in a session, I could figure out that thing.
[00:29:35]
So, so like in the context of coding, for example, like maybe, so first of all, with
[00:29:42]
a code cadas are a very helpful tool for deliberate practice.
[00:29:47]
Like when I think of deliberate practice for, for coding, I think of code cadas.
[00:29:51]
It's not the only way to do deliberate practice.
[00:29:53]
There are different techniques that are all valuable, but code cadas are, are awesome.
[00:29:59]
I highly recommend giving, giving them a try.
[00:30:02]
So code cada is basically a repeatable exercise.
[00:30:07]
And the fact that it's repeatable is the point.
[00:30:10]
So a fizzbuzz, for example, you know, given the number one, return one, two, return two,
[00:30:17]
three return fizz.
[00:30:18]
If it's a multiple of three return fizz, if it's multiple of five return buzz, if it's
[00:30:23]
a multiple of three and five return fizzbuzz, otherwise return the number, just writing
[00:30:27]
a function that does that, right?
[00:30:29]
So that's one of the simplest code cadas.
[00:30:33]
And you don't do it once you don't solve the exercise once and then you're done.
[00:30:37]
You do it repeatedly.
[00:30:39]
But because it's this boring, easy exercise, you can apply a challenge to that and work
[00:30:47]
on that deliberately.
[00:30:48]
So you can say, I want to do fizzbuzz in elm and I want to work on my refactoring.
[00:30:56]
Like at what stage do I refactor?
[00:30:59]
I want to play around with that.
[00:31:00]
I want to.
[00:31:01]
So like when you're doing this deliberate practice, I think it's really important to
[00:31:06]
say, to do things that feel like you're going overboard and being too extreme.
[00:31:11]
Like really, do I need to refactor this much?
[00:31:14]
Well try it, try it and see how it goes.
[00:31:16]
And maybe you'll, maybe you'll try it and you'll say, yeah, that was too much, but you've
[00:31:23]
actually built a habit that makes you more proficient at that.
[00:31:27]
And now when you go into a production code base, you've built up those refactoring muscles
[00:31:32]
and you can actually use those.
[00:31:34]
They're more available to you.
[00:31:35]
You've built those habits and that skill and that way to just identify refactoring opportunities.
[00:31:42]
When do you commit during refactoring?
[00:31:45]
Doing your, so always try to be your best self when you're doing Kadas, even like if
[00:31:52]
it seems like you're going overboard, just do it.
[00:31:55]
And oftentimes I will say from my experience, oftentimes when I think I'm going overboard
[00:32:00]
with Kadas, it actually ends up shaping the way I look at it.
[00:32:04]
I'm like, I actually don't think that's overboard anymore.
[00:32:06]
I really liked that.
[00:32:07]
Like that really worked for me.
[00:32:09]
Like doing tiny commits when I just rename a function actually really works for me.
[00:32:15]
And now that's part of how I code and how I think about coding.
[00:32:18]
So yeah, crank it up to 11.
[00:32:21]
Yeah, exactly.
[00:32:22]
Exactly.
[00:32:24]
But think of it as a time to experiment because it's low stakes.
[00:32:27]
You're not shipping to production and that's an important part of it.
[00:32:30]
So how, how else can you, so how else can you practice?
[00:32:33]
You've got coding Kadas.
[00:32:35]
I know that when you're studying you can also do like write self quizzes.
[00:32:42]
Like you write the answer to a question, you can write a question and the answer on the
[00:32:47]
back and you practice learning that.
[00:32:50]
I don't think that applies to programming too much, but maybe you have some ideas.
[00:32:55]
It depends on your context.
[00:32:57]
I mean, I've certainly done deliberate practice to learn a particular web framework and just
[00:33:05]
say like, I want to build a to-do list application from scratch five times.
[00:33:12]
I've done that before and it's very helpful.
[00:33:14]
Like just being like five times in a row, build a to-do application.
[00:33:19]
You get really good at that and you kind of, you're like, okay, this is where these components
[00:33:25]
sit on the file system and this is how you wire them up.
[00:33:28]
And this is the thing that I kept running into that I messed up and you learn about
[00:33:31]
that.
[00:33:32]
Right.
[00:33:33]
So those aren't code Kadas, but that's a deliberate practice that you're honing in on a goal and
[00:33:37]
isolating to get better at a specific thing.
[00:33:40]
Yeah.
[00:33:41]
I'm guessing you could over memorize the technique.
[00:33:44]
Oh, sorry.
[00:33:46]
I'm guessing you could over, I'm guessing you could over learn the exercise.
[00:33:50]
Like if you do writing a to-do app, you could have it all already in your mind and you just
[00:33:56]
write everything line by line, line by line without ever compiling or working.
[00:34:02]
But if you're not perfect at it, then you could notice, oh, well now it's not working.
[00:34:08]
Even after I've written all the code, I don't know where the problem is.
[00:34:12]
And then you could do some introspection, like how could I, how could I have done this
[00:34:17]
better?
[00:34:18]
And I think it's something you mentioned, but introspection and critical thinking seems
[00:34:25]
very important.
[00:34:26]
Like how, why am I not fast at this?
[00:34:30]
Is it because I am having issues with remembering when I need to extract a function?
[00:34:36]
Is it because blah, blah, blah, should I do TDD more?
[00:34:41]
I don't know.
[00:34:42]
You need to have a critical thinking brain next to your working brain, I imagine.
[00:34:49]
Right.
[00:34:50]
I really liked that you brought up introspection.
[00:34:52]
I actually, I neglected to put that on my list of points to talk about, but in hindsight,
[00:35:02]
that is like a hundred percent a core part of it.
[00:35:05]
Yeah.
[00:35:06]
Like if you're, if you're not introspecting and thinking, what do I need to get better
[00:35:08]
at doing some deliberate practice and saying, hmm, what, what's not, what's not flowing
[00:35:14]
so well or working on production code and saying like, feels like, I don't know, the
[00:35:20]
way I'm refactoring this code feels like I could be better.
[00:35:24]
So yeah, absolutely.
[00:35:25]
You introspect, maybe even have a running list of things you want to get better at or
[00:35:31]
work on.
[00:35:32]
And cause yeah, you have to start with those intentions and how do you get those intentions
[00:35:36]
by being mindful, applying critical thinking, being introspective.
[00:35:40]
And as, as to you know, a particular exercise getting too rote where you're just spitting
[00:35:48]
out the same code, it depends on what your goal is.
[00:35:52]
That might be okay to a certain extent.
[00:35:54]
Like if your goal is to get, like when I was working on just building a to-do list five
[00:35:59]
times in a row, I wanted it to become kind of rote to just create components and, and
[00:36:07]
wire things up.
[00:36:09]
And it wasn't so much about solving the problem.
[00:36:12]
And actually sometimes code kata's, I like code kata's that allow me to focus less on
[00:36:18]
the problem I'm solving and more on how I'm solving it.
[00:36:22]
So I really like the tennis kata, just a simple scorekeeping app where you, you can just call
[00:36:30]
a function that says player one scored or player two scored, and it will print out the
[00:36:35]
current score of the game in, in tennis language.
[00:36:39]
And sometimes when you get to like prime factor kata's and things like that, it's test, it
[00:36:45]
feels like it's testing more like math or comfort with certain standard library functions
[00:36:53]
more than it's testing my ability to like refactor code and extract things nicely.
[00:37:01]
It feels more like an exercise rather than a drawing board or a practice board.
[00:37:09]
Yeah.
[00:37:10]
I'm not thinking about coding.
[00:37:11]
I'm thinking about like solving a specific problem, but I kind of want it to be like
[00:37:15]
a vessel for thinking about how I'm coding, not like, because it's okay for it to become
[00:37:22]
rote where it's like, you know, okay, I've done, I've done the gilded rose 50 times,
[00:37:28]
but I can still approach it with these steps.
[00:37:31]
I can still try gilded rose, which is a great exercise by the way.
[00:37:35]
It's more focused on legacy, getting legacy code under test and refactoring legacy code.
[00:37:41]
So I can try like different techniques for getting legacy code under test, do it with
[00:37:46]
a code coverage tool and use that to identify the parts that I get under test and then feed
[00:37:53]
test inputs into it and commit those tests and get it under code coverage and then start
[00:37:57]
refactoring or I can try it with fuzz testing doing that.
[00:38:01]
Or I can try it with a snapshot testing or I can try it with like a particular refactoring
[00:38:08]
technique once I've got it with tests.
[00:38:10]
I can try it with, I can try the Kata where I already have existing legacy code tests
[00:38:16]
and then I try using only editor refactorings to accomplish a particular task or, you know,
[00:38:23]
try it with Elm Review Simplify and then let Elm Review Simplify help you along and see
[00:38:29]
how, see how that feels.
[00:38:30]
And maybe you learn something that you bring over to your production process.
[00:38:35]
And so like, think of it as a test lab, like if, if you don't have for technology for like,
[00:38:43]
you know, CPUs or whatever tech stuff, if you don't have the labs and the academia exploring
[00:38:51]
cutting edge things, eventually the industry stuff is going to go stale and plateau.
[00:38:56]
You need those labs.
[00:38:58]
It's not like, maybe you're not investing 90% of the resources into the labs for your
[00:39:05]
new cutting edge processors, but if you're investing nothing in it, you're going to plateau.
[00:39:12]
So it's, it's the same with the way we write code.
[00:39:14]
Like you need to have a laboratory to explore new things and some of them will be successful
[00:39:19]
and some of them won't.
[00:39:20]
And that's part of it.
[00:39:21]
It's part of the learning.
[00:39:22]
And you want to create that low stakes environment where it's okay to fail and experiment and
[00:39:27]
try things that you might not like that.
[00:39:29]
That's part of it.
[00:39:30]
That's part of learning.
[00:39:31]
Yeah.
[00:39:32]
So you can find a lot of Kadas online, maybe not for Elm, but maybe less for Elm.
[00:39:38]
I'm guessing that what you can also do is if you've noticed you worked on a project
[00:39:43]
and there was a, an assignment that you worked on and that was more complex to solve than
[00:39:51]
you expected, like it's not necessarily very complex, but you struggled with it.
[00:39:56]
You could try to redo it again after the fact when you're in a non-stressful environment,
[00:40:01]
when it's already been pushed, or you just try to do it again without the stress of deadlines,
[00:40:08]
without the exploratory phase and figure out with critical thinking, like how can I do
[00:40:15]
this better?
[00:40:16]
How can, what habits can I learn to make this easier for myself the next time I encounter
[00:40:21]
this kind of situation?
[00:40:23]
So create your own Kada on the fly.
[00:40:25]
Yes, absolutely.
[00:40:28]
That said, Kadas are probably designed to be helpful for these kinds of issues, for
[00:40:34]
refactoring for TDD.
[00:40:36]
So it might be more appropriate, but if you already have a stake in a problem, then why
[00:40:43]
not?
[00:40:44]
I completely agree.
[00:40:45]
Yeah.
[00:40:46]
Try your own experiment.
[00:40:47]
And these Kadas are pretty, pretty language agnostic.
[00:40:50]
So you can try, some of my favorites are Fizzbuzz, Tennis Kada, Gilded Rose, we've mentioned.
[00:40:59]
I really like the Roman numeral Kada to sort of produce, convert numbers to Roman numerals.
[00:41:06]
I really like that one a lot.
[00:41:08]
And that Kada is very good for practicing tiny steps.
[00:41:13]
I honed a lot of my skills and my ideas about tiny steps.
[00:41:17]
Well, I learned a lot of ideas from a lot of great thinkers, you know, like Kent Beck
[00:41:23]
and Llewellyn Falco influenced me a lot in tiny steps and Woody Zool, but then you have
[00:41:29]
to like apply those things to understand them for yourself.
[00:41:34]
And things like the Roman numeral Kada really helped me do that, for example.
[00:41:38]
There's also the side benefits that if you train Fizzbuzz a lot, then you're going to
[00:41:43]
rock that tech interview.
[00:41:45]
Yeah, totally.
[00:41:46]
Yeah.
[00:41:47]
I think I had to do it at some point for a technical interview.
[00:41:52]
Yeah, I did.
[00:41:54]
With good reason.
[00:41:55]
Like if you're really good at these Kadas, then you've acquired those skills.
[00:42:00]
Like you've earned those skills and like, you know, yeah, if you've practiced that specific
[00:42:05]
thing that's on the interview, okay.
[00:42:07]
But yeah, Kadas will make you better at interviews probably where there's live coding.
[00:42:12]
They definitely will.
[00:42:13]
Is there a Kada for inverting a binary tree or something like that?
[00:42:18]
I don't know.
[00:42:19]
I mean, you could do it.
[00:42:21]
Why not?
[00:42:22]
I mean, you could do it.
[00:42:23]
Like you said, you can create your own exercises.
[00:42:24]
100%.
[00:42:25]
So one thing that I want to emphasize with code Kadas is part of the idea with code Kadas
[00:42:33]
is that you can apply different techniques for things that you want to learn.
[00:42:37]
You can say, I want to try using this data structure, this refactoring technique.
[00:42:41]
I want to focus on incremental steps.
[00:42:43]
I want to do more tiny steps than I'm used to.
[00:42:46]
I want to practice committing after every small step.
[00:42:48]
You can do all these, you know, sometimes people call them constraint games.
[00:42:52]
There are even more like interesting ones like setting a timer and saying, okay, if
[00:42:59]
the tests are read after this amount of time, revert everything, you wipe everything out.
[00:43:05]
Yeah.
[00:43:06]
You reset hard.
[00:43:07]
Or I'm dash RF slash, that would be brutal as a, as a way of building up your muscle
[00:43:17]
and getting feedback for yourself for tiny steps.
[00:43:20]
Cause then you learn tiny steps.
[00:43:22]
So you know, all these things are the, sometimes these are called constraint games and super
[00:43:27]
valuable, but one of the ideas with Kadas is that test driven development is always
[00:43:33]
part of the practice.
[00:43:34]
And that's how I think of them.
[00:43:37]
I'm so I consider, I consider test driven development to be just a core tenant of Kadas.
[00:43:45]
How so like, like, does it have to be part of it or do you need the safety nets or, or
[00:43:51]
should you always train TDD for everything?
[00:43:54]
I mean, I think for example, using, using for me, TDD and tiny steps are really intertwined.
[00:44:07]
Like it's part of how I practice that.
[00:44:09]
And it's part of the muscle I want to build up.
[00:44:12]
It's just such, it's just such a core skill.
[00:44:15]
So of course some people might disagree with this, but that's how I think of it.
[00:44:20]
I think of test driven development as such a foundational skill and so linked to how
[00:44:26]
I think about refactoring tiny steps, getting, getting something read, right?
[00:44:31]
What is a like tiny steps doing the simplest thing that could possibly work?
[00:44:35]
Great thing to focus on when you're doing deliberate practice.
[00:44:38]
Well what is doing the simplest thing that could possibly work if you don't have a test
[00:44:43]
to tell you, okay, now here's the red that tells you the thing you need to get to work.
[00:44:49]
Like what is working?
[00:44:50]
The test tells you this is, this is working.
[00:44:53]
Now the green tells you that you've done the simplest thing that could possibly work.
[00:44:58]
That you've gotten it to work.
[00:44:59]
Right.
[00:45:00]
But let's say for instance, I want to train making opaque types.
[00:45:05]
I want to, sorry, I had to say, absolutely.
[00:45:12]
Let's say you want, you want to train extracting a data type into a new module and making an
[00:45:18]
opaque.
[00:45:19]
You don't need test for that probably.
[00:45:22]
Or I mean not having tests probably doesn't block you from learning this skill.
[00:45:29]
So here I would say you probably don't need TDD or am I missing something?
[00:45:33]
So if I were sitting down to do an opaque type practice session, which I also think
[00:45:41]
is an excellent idea, I would definitely be starting with a test.
[00:45:46]
And part of the reason is because like opaque types and tests are deeply connected.
[00:45:51]
Like because opaque types are about the public interface.
[00:45:54]
So how do you test something with a hidden private interface?
[00:45:58]
What are the implications of that for testing?
[00:46:00]
What are the implications of that for tiny steps?
[00:46:02]
At what point do you extract it to an opaque type?
[00:46:06]
That's something you can practice.
[00:46:07]
You can practice, do I immediately create a module where I define that code and make
[00:46:14]
it opaque from the start?
[00:46:15]
Or do I do it incrementally in steps?
[00:46:17]
And to me it's like doing that process like without tests to support me through those
[00:46:22]
small steps.
[00:46:24]
Just first of all, I want to take the opportunity to build the testing habit.
[00:46:28]
I want to have tests to support me refactoring and I want to practice refactoring with tests
[00:46:36]
because that's what I want to be really good at.
[00:46:38]
And it also keeps me honest about taking tiny steps.
[00:46:41]
So like it just, it's a tool that the reason I think test-driven development is such a
[00:46:46]
foundational skill is because it reinforces all of these things because it is a built-in
[00:46:53]
feedback loop and it helps keep you honest about are you doing large steps where you're
[00:47:02]
going from where you have a broken implementation.
[00:47:05]
It's a feedback loop that lets you know more about that because you have a big red thing
[00:47:10]
as you're writing all this code that hasn't been tested and taking a big step.
[00:47:16]
It makes you sort of feel the fact that you're doing that a little bit more.
[00:47:20]
It's a feedback tool for that and feedback tools are important and test-driven development
[00:47:25]
is a very good feedback tool.
[00:47:26]
Yeah, I'm thinking you're trying to learn how to drive a car on the racetrack and you're
[00:47:35]
doing that using the stick shift because you're used to it.
[00:47:39]
In this analogy, driving the car is extracting an opaque type and the stick shift is TDD.
[00:47:47]
Like you know how to do TDD, you know how to use the stick.
[00:47:51]
But if someone doesn't know how to do TDD well or are that familiar with it, then you're
[00:47:58]
kind of training both things.
[00:48:01]
Then it's not deliberately practicing the opaque types thing, you're deliberately practicing
[00:48:07]
a little bit of both.
[00:48:08]
So I would say you're kind of diluting the practice if you're not familiar with TDD.
[00:48:14]
If you're familiar with TDD and it's a tool that you use, then sure.
[00:48:18]
I wouldn't say it's necessarily you need to do TDD.
[00:48:22]
If it helps you, it helps you.
[00:48:24]
But otherwise, yeah.
[00:48:26]
I see what you're saying, but I would look at it more like, well, first of all, if I
[00:48:34]
was not super comfortable with TDD, instead of saying, therefore I'm going to do some
[00:48:40]
kata's where I practice some things without TDD, instead I would say, I'm going to get
[00:48:45]
really good at these TDD skills and do some kata's focused on that before I do these more
[00:48:50]
advanced things.
[00:48:52]
I'm going to learn stick shift before I learn these other things because the race is going
[00:48:58]
to be in stick shift.
[00:48:59]
And so I'm going to have to get comfortable with stick shift.
[00:49:03]
And I want to practice all of these things with stick shift.
[00:49:05]
So I'm going to do that.
[00:49:07]
I thought you were going to say that.
[00:49:09]
And to me, it also feels like practicing music without a metronome.
[00:49:14]
It's like it's just such a foundational tool because again, it's a tool that assists you
[00:49:20]
in taking it up a small notch at a time.
[00:49:23]
And it helps you just like in the same way, TDD helps you control the size of your steps.
[00:49:30]
So you can play around with that.
[00:49:31]
It helps you manage your refactoring.
[00:49:34]
So it's just a foundational tool that I consider to be core to all of these practices.
[00:49:39]
Yeah, but there will be some exercises where you won't need TDD or for instance, for piano,
[00:49:48]
you will need to put your hands into specific positions.
[00:49:52]
Like if you're doing a chord on a guitar as well, you don't need the metronome.
[00:49:57]
Where the metronome is going to be helpful for so many exercises, but not for some of
[00:50:03]
them, not for the more, the tiny ones.
[00:50:08]
But it might be helpful for more things than you realize too, because even practicing particular
[00:50:14]
chord voicings on the piano or guitar or whatever it may be, if something takes you a long time
[00:50:21]
to get your hand into the correct position for that, maybe you're without a metronome,
[00:50:28]
you're going to be practicing that in a way that doesn't nudge you to grow a little bit.
[00:50:35]
And so what's going to tend to happen is the ones that you're comfortable with, the G major
[00:50:40]
chord on the guitar that you're comfortable getting your hands into versus the bar chord
[00:50:45]
that you're less comfortable getting your hands into, you're going to take a little
[00:50:49]
more time every time you get your hand into the bar chord and you're little by little
[00:50:53]
going to get really fast at doing that familiar G major chord and stay kind of the same speed
[00:50:59]
at the F major chord.
[00:51:00]
If you put on a metronome, little by little, you're going to grow a little bit every day
[00:51:06]
and you're going to get better at it.
[00:51:08]
So it just keeps you honest.
[00:51:09]
And I see TDD as the same sort of forcing function there.
[00:51:12]
Yeah, I would say this is like, again, the level of difficulty, the level of challenge.
[00:51:19]
Like if you really don't know how to do that chord, like if it's painful for your hand,
[00:51:24]
then practice it without the metronome.
[00:51:27]
Once you feel like you can do it, start adding the metronome because you're now at that level
[00:51:31]
of challenge.
[00:51:32]
So yeah, TDD is a good tool to have.
[00:51:37]
Yeah, we may have to agree to disagree on this one, but hopefully, I mean, people can
[00:51:43]
come to the conclusion.
[00:51:45]
We disagree on the tiny details.
[00:51:47]
Like I'm always nitpicking, but as long as we agree that you should make opaque types,
[00:51:54]
we're good.
[00:51:55]
Exactly.
[00:51:56]
This Elm Radio podcast can continue on.
[00:52:01]
I wanted to touch on one thing, which is, so we talked about cadas and these different
[00:52:06]
types of exercises.
[00:52:08]
Actually so on the topic of tests versus not being a core practice to this.
[00:52:14]
So there's something called Exercism, which is a really great service.
[00:52:19]
And I've gone through several of them, really enjoyed them, learned a lot from them going
[00:52:25]
through different languages.
[00:52:26]
Definitely recommend it.
[00:52:27]
Try it out.
[00:52:28]
It uses Elm Review to check the results.
[00:52:32]
Yeah, yeah, that's so cool.
[00:52:36]
Yeah, it's amazing.
[00:52:37]
So one thing to be aware of with Exercism is that it is different than code cadas, at
[00:52:45]
least how I practice them, in the sense that the tests are written for you.
[00:52:49]
So I just think that's something to be aware of.
[00:52:53]
Do Exercism, have fun with it, get feedback from people that helps you learn a language
[00:52:58]
and get more idiomatic about it.
[00:53:00]
It's very good for that.
[00:53:01]
It does not help you learn and practice TDD because TDD, an important part of TDD is writing
[00:53:09]
tests and you don't write tests.
[00:53:11]
You're given a suite of tests and you make them pass.
[00:53:14]
So it's just different.
[00:53:15]
It's not bad, but don't go into it expecting to learn TDD because it doesn't, it just doesn't
[00:53:22]
teach you that skill.
[00:53:23]
Okay, let's talk about tests again.
[00:53:28]
So let's imagine you want to do the opaque type thing and you start by writing tests,
[00:53:34]
from what I understand, right?
[00:53:35]
Yes, yes.
[00:53:36]
And then you, once you have that safety net and that feedback mechanism, that's when you
[00:53:42]
start actually doing the opaque type migration.
[00:53:47]
So you're going to do this exercise and you're going to be somewhat content or discontent
[00:53:51]
with your results and you're going to do it again.
[00:53:55]
Will you again write the tests from scratch or will you reuse the tests?
[00:54:02]
I will write the tests from scratch.
[00:54:04]
Yeah.
[00:54:05]
I'll throw everything away.
[00:54:06]
I'll get reset hard.
[00:54:07]
Okay, because that feels like you're again not practicing this turn.
[00:54:14]
You're practicing the turn and the whole, the very long straight line before it.
[00:54:23]
It doesn't feel that way to me.
[00:54:25]
And especially if you become very fluent with writing test cases, that's just how you code.
[00:54:35]
It's not an extra step.
[00:54:36]
It's not extra credit.
[00:54:38]
That's just what coding looks like.
[00:54:40]
And I think that's, you know.
[00:54:43]
Yeah.
[00:54:44]
For instance, if I'm doing the Gilded Rose kata, where the code is already written, but
[00:54:48]
there are no tests, writing the tests is something that I wouldn't like to practice potentially
[00:54:54]
because it's interesting.
[00:54:56]
But in a more realistic scenario, I might have written the code along with tests.
[00:55:03]
So Gilded Rose is actually a special case for me because it's a legacy code kata.
[00:55:11]
And so yeah, in that case, I do practice that sometimes with an existing test suite.
[00:55:19]
So yeah, to just say, here's some super messy code that I want to refactor.
[00:55:25]
I'm just going to go in and refactor.
[00:55:27]
And I think that's, for me, that's super valuable.
[00:55:29]
Okay.
[00:55:30]
So yeah.
[00:55:31]
So I think the difference in what we had in mind for the question was, I imagine that
[00:55:37]
you've got existing code and you have to write tests for it.
[00:55:41]
Right.
[00:55:42]
Yeah.
[00:55:43]
Whereas you were thinking of, I'm going to write tests for the results.
[00:55:47]
So that is part of the exercise.
[00:55:49]
Right.
[00:55:50]
I would never do fizzbuzz kata, tennis kata, Roman numeral kata with, here's a suite of
[00:55:58]
tests.
[00:55:59]
Now I need to make them pass.
[00:56:00]
I only do those with, okay, what's our first test case?
[00:56:04]
And that's one of the things that I might experiment with.
[00:56:08]
What does it look like if I do that with fuzz tests?
[00:56:11]
What if I do fizzbuzz with fuzz tests?
[00:56:13]
What does that look like?
[00:56:14]
I don't even know.
[00:56:16]
We've talked about that on our episode with Martin, where we talked about fuzz testing.
[00:56:20]
Martin Janacek.
[00:56:21]
By the way, that would be fuzz biz.
[00:56:26]
Fair point.
[00:56:29]
And I won't let that job.
[00:56:34]
Instantly fired.
[00:56:35]
You have not been hired, but you have been fired already.
[00:56:40]
We may take the unusual case of hiring you for the sole purpose of being able to fire
[00:56:47]
you.
[00:56:48]
Fair.
[00:56:49]
That's fair.
[00:56:50]
Okay.
[00:56:51]
So we agree again.
[00:56:52]
Yeah.
[00:56:53]
So, yeah, exorcism, definitely play around with exorcism.
[00:57:03]
I also-
[00:57:04]
That said, for exorcism, you got a lot of exercises which are problems to solve.
[00:57:09]
If you don't know how to solve them, then it's not a good exercise to practice something.
[00:57:16]
You need to understand the problem well to have resolved it already before you can see
[00:57:20]
it as the exercise for different techniques, I would say.
[00:57:26]
Right.
[00:57:27]
That's absolutely.
[00:57:28]
So not that there's anything wrong with just exploring and saying, I'm going to try to
[00:57:34]
solve this problem.
[00:57:35]
That's totally fine.
[00:57:36]
But hopefully people have a takeaway that maybe if they really want to do deliberate
[00:57:42]
practice, they want to set an intention, get better at a specific habit or skill.
[00:57:49]
A really good way to do that is to repeatedly do the same thing, changing one piece of it.
[00:57:56]
I'm going to change how I try this thing.
[00:57:58]
I'm going to change using opaque types.
[00:58:00]
So that's a really good technique.
[00:58:02]
It doesn't mean that it can't be great to just explore, like, I'm going to try to solve
[00:58:07]
this problem and only ever try solving it one time in your life.
[00:58:10]
That's a great thing to do, too.
[00:58:12]
But yeah, like repeatedly doing the same problem is a very powerful tool for building habits,
[00:58:20]
specifically for building habits.
[00:58:21]
So I think that's it's worth making that distinction.
[00:58:23]
So there's also Advent of Code, which is at the time we're recording this, very close
[00:58:29]
at the time people are listening to this, probably starting right now.
[00:58:32]
It probably started.
[00:58:34]
You already have a few days of exercises.
[00:58:37]
You have a few.
[00:58:38]
Yes, it's not too late to start now.
[00:58:41]
So absolutely go do it.
[00:58:43]
And Advent of Code is super fun.
[00:58:46]
It's a great way to experiment with test driven development or any different programming languages,
[00:58:52]
different programming techniques.
[00:58:54]
And it's just fun exercises.
[00:58:56]
Again, it is like it's not necessarily the best way to just like extremely deliberately
[00:59:04]
and in a very focused way, build a specific habit.
[00:59:07]
But it's a great thing to do.
[00:59:08]
So yeah, definitely have it's fun and learning and fun are inseparable, in my opinion.
[00:59:16]
Like we shouldn't we shouldn't feel like we're forcing ourselves to do things.
[00:59:21]
We should be curious and have fun doing things.
[00:59:25]
So I have heard that Elm Radio is a podcast about Elm.
[00:59:32]
Maybe we should talk about it a little bit.
[00:59:36]
So one thing that we'll notice that feedback loops, quick feedback loops are very important
[00:59:43]
to learn.
[00:59:44]
And the Elm compiler being very fast makes it very nice.
[00:59:51]
But yeah, my question for you is, what do you think that Elm programmers should deliberately
[00:59:58]
practice except TDD and small steps?
[01:00:03]
Which absolutely.
[01:00:04]
On three, one, two, three.
[01:00:07]
Opaque types.
[01:00:09]
There you go.
[01:00:13]
Yes.
[01:00:14]
Love it.
[01:00:16]
Yeah, I think I think it's really nice to think about like, OK, so when you establish
[01:00:26]
a routine of using these deliberate practice techniques and using cadas to hone particular
[01:00:32]
skills in a certain way, you develop a relationship with it where you can almost like use it to
[01:00:38]
explore deep questions about how to approach problems, which is kind of cool.
[01:00:44]
So I like to think of it like that, like, hmm, I wonder what it would be like if like,
[01:00:50]
what would it be like if I made everything an opaque type?
[01:00:53]
That would be interesting.
[01:00:54]
What if I solved a problem where everything was an opaque type?
[01:00:57]
What if I solved a problem with zero type aliases or primitive types in Elm?
[01:01:02]
That'd be interesting.
[01:01:03]
Is it a good idea?
[01:01:05]
Maybe maybe not.
[01:01:06]
But you know, you know, what would be a really bad place to do that experiment is in your
[01:01:12]
production code base.
[01:01:14]
And you know, what would be a really good place to do that experiment is not there,
[01:01:19]
maybe in a cada that you can throw away at the end and pretend never happened because
[01:01:23]
it turned out to be a really bad idea.
[01:01:25]
That's fine.
[01:01:26]
Like, this is a safe space to try out your possibly bad ideas.
[01:01:31]
And no one has to see it ever.
[01:01:36]
So yeah, use that opportunity to experiment and validate or invalidate ideas.
[01:01:42]
I think it's a really good place to explore.
[01:01:45]
So like, if you have a question like, are opaque types really that useful?
[01:01:51]
Try a cada with them.
[01:01:53]
And that's a good way to get a sense of that.
[01:01:55]
So yeah, like what types of things might you be exploring those kinds of questions with
[01:02:00]
in Elm?
[01:02:02]
To me, I often think about like, yeah, how do like, how do I want to organize my code?
[01:02:07]
When do I want to extract my modules?
[01:02:10]
You know, is like, is fuzz testing?
[01:02:14]
When is fuzz testing useful?
[01:02:15]
What kinds of cases can it help with?
[01:02:17]
Like, that's a really good thing to explore in that context.
[01:02:20]
How do I approach refactoring?
[01:02:21]
How can I use my tools to better refactor?
[01:02:24]
How can I make this impossible state impossible?
[01:02:27]
Or exactly, do I go get there?
[01:02:30]
Exactly.
[01:02:31]
Do I use dictionaries to model this or records?
[01:02:34]
CodeCad is a great way to explore that.
[01:02:37]
Extracting functions also, although that will be part of the process as well.
[01:02:40]
But I mean, if you want to test to, if you want to practice lower level techniques, right?
[01:02:47]
Yeah.
[01:02:48]
What about like writing JSON decoders?
[01:02:50]
Yeah.
[01:02:51]
You know, like, should I write a unit test with a, for a JSON decoder?
[01:02:57]
Should I write a fuzz test?
[01:02:58]
Should I, how does it work?
[01:03:01]
Like if I write a reversible test for an Elm JSON decoder encoder pair or a codec, if I
[01:03:09]
use Elm codec or if I use Elm serialize instead of Elm codec, like you can play around with
[01:03:15]
that and try it, you know, do a, create a little JSON serialization, deserialization
[01:03:22]
kata for yourself in Elm.
[01:03:23]
That's like a great thing to experiment with.
[01:03:26]
Even trying like different dictionary implementations, any dict and it's a great place to just,
[01:03:34]
it's a laboratory for, for trying these things out.
[01:03:37]
So if there's something you want to like learn about, it can help you learn and explore an
[01:03:42]
idea if there's a habit you want to build, you can build that habit.
[01:03:46]
So like, when should I write, when should I write type annotations?
[01:03:50]
If ever, what if I did a kata for where I never wrote a type annotation?
[01:03:56]
What would happen?
[01:03:57]
Would it, would it suck or would it be liberating?
[01:03:59]
Can I give the answer?
[01:04:02]
Yeah.
[01:04:03]
Opaque type, oh no.
[01:04:06]
No.
[01:04:07]
What?
[01:04:08]
No.
[01:04:09]
I thought opaque types was the answer to everything.
[01:04:11]
Yes.
[01:04:12]
But there are better answers to this question.
[01:04:15]
Okay.
[01:04:16]
Okay.
[01:04:17]
So the answer is opaque types.
[01:04:19]
No, it's a, yeah, always write type annotations.
[01:04:23]
But, but you know, like I think if, if you're having an existential crisis about whether
[01:04:30]
you as an Elm developer should be writing type annotations and you're like flirting
[01:04:34]
with the idea that maybe I don't always need to write a type annotation, take that heretical
[01:04:39]
thought and in the privacy of your own home, do a little code kata to see how it feels.
[01:04:46]
Nobody has to know whatever happened.
[01:04:49]
It's a safe space.
[01:04:51]
I'm guessing that for these, there are certain questions like, like these where you will
[01:04:57]
feel the pain of doing or not doing something when you need to maintain code.
[01:05:02]
So you need to do, to have larger amounts of code.
[01:05:06]
So for instance, like why would you use Elm?
[01:05:07]
Oh, well try a kata.
[01:05:08]
Yeah.
[01:05:09]
But if the kata is quite small, then Elm is going to be, feel more painful than JavaScript.
[01:05:14]
So I'd say that you will not always get the answer you should if you're doing it on the
[01:05:22]
wrong exercise.
[01:05:23]
Yes.
[01:05:24]
And katas aren't the answer to every problem, unlike opaque types.
[01:05:28]
Unlike opaque types.
[01:05:30]
You know, just as I, I said that I think that, you know, like something like, something like
[01:05:37]
exorcism isn't teaching you test-driven development.
[01:05:40]
It doesn't mean it's bad.
[01:05:41]
It's just, you're not going to learn that from it.
[01:05:44]
Code katas are not going to teach you everything.
[01:05:46]
It's like, it's a very good way to do a very specific thing, but it doesn't teach you everything.
[01:05:52]
It's not, it's not a proxy for every real world code situation.
[01:05:57]
Real world code is messy and ugly and has all these properties that a kata doesn't.
[01:06:02]
So, but you can have a very short feedback loop to try things very quickly.
[01:06:08]
And that's a good learning environment for specific types of things.
[01:06:12]
So know what it's good for, it's not a substitute for all learning.
[01:06:15]
So in a way I think of, I think of it a little bit like unit tests versus end to end tests.
[01:06:21]
Like if I have only unit tests in my code base and no end to end tests, I'm not going
[01:06:26]
to have that much confidence about going to production.
[01:06:30]
Is my payment processing still working?
[01:06:32]
Is, you know, I probably want like some monitoring end to end tests, you know, maybe some like
[01:06:40]
smoke tests, like some performance tests and, and a lot of unit tests because unit tests
[01:06:47]
are very cheap and easy way to exhaustively exercise all of the behavior of a function.
[01:06:54]
They're very good at that.
[01:06:56]
They're not very good at making sure that your entire application is wired up in a way
[01:07:01]
that's going to accept Black Friday coupon codes and receive money in your payment processing
[01:07:09]
platform when the big sale happens.
[01:07:13]
And that's probably something you want to know.
[01:07:15]
And a unit test just doesn't give you that.
[01:07:18]
And in the same way, like code cutters are very good for like drilling in a particular
[01:07:24]
habit or skill or exploring a small idea.
[01:07:28]
But that's, that's what the tool is for, but you should still be exploring, exploring things
[01:07:34]
in your code base and introspecting.
[01:07:35]
What do I want to experiment with in a production context and safely experimenting with things
[01:07:42]
in production, doing spikes, doing small research spikes where maybe you try some mad science
[01:07:48]
fuzz testing thing.
[01:07:50]
Maybe you want to do that in your code base and see how it goes.
[01:07:53]
So code cutters aren't a substitute for that.
[01:07:56]
Another thing I wanted to mention is TCR, test, commit, revert, which is a really, really
[01:08:03]
interesting technique where you, it's, it's pretty extreme as far as XP goes.
[01:08:09]
It's definitely turning it up to 11.
[01:08:11]
Really?
[01:08:12]
Yeah, I would say so.
[01:08:15]
So the idea is you have your suite of tests running, you have a test watcher and you make
[01:08:24]
a change to your code.
[01:08:25]
Anytime your test suite goes green.
[01:08:28]
So you do a refactoring step.
[01:08:30]
Your test reruns.
[01:08:31]
It's green.
[01:08:32]
It automatically commits it.
[01:08:34]
Anytime your test suite is red, you do a small step.
[01:08:37]
It makes things red.
[01:08:38]
It reverts it.
[01:08:40]
Every time you save, right?
[01:08:42]
Right.
[01:08:43]
So it's interesting because it, it actually does change the test driven development workflow
[01:08:47]
a little bit because in test driven development, you start with a red test, but in TCR you
[01:08:53]
can't do a red step.
[01:08:55]
So it changes the way you do things, but you have to do a lot more preparatory steps, faking
[01:09:00]
values along with a new test case.
[01:09:03]
So it immediately passes things like that.
[01:09:06]
But it's really interesting for keeping you honest with taking tiny steps.
[01:09:11]
So that's, I have not used TCR in a production context personally, but it's a very good learning
[01:09:18]
tool and I really like experimenting with it in the context of Katas.
[01:09:22]
It's a really good way to keep you honest for taking tiny steps so that that can be
[01:09:26]
like a nice exercise to play around with in a Kata, for example.
[01:09:31]
Do you have a tool somewhere to try that out?
[01:09:35]
I have a little script I can share.
[01:09:37]
It's just a small little script.
[01:09:39]
Yeah.
[01:09:40]
And there's a live stream that Corey Haynes and I did that I'll share a link to where
[01:09:45]
we did the Gilded Rose Kata in Elm with like a prototype of a snapshot testing Elm tool
[01:09:51]
I built and we used like a TCR workflow where it would automatically commit a revert.
[01:09:59]
So I'll share that as well.
[01:10:00]
Yeah, actually Aaron Vonderhaar and I have been doing some occasional pairing sessions
[01:10:06]
together where we've actually been doing like some refactoring on the Elm GraphQL code base
[01:10:12]
as practice, just for fun to hone our skills.
[01:10:16]
And we've been using like a TCR workflow to refactor and take tiny steps.
[01:10:22]
So I guess I take that back.
[01:10:23]
I have somewhat used TCR in a production context, but still pretty experimental.
[01:10:30]
So sometimes you can find like a way to do exercises in a low stakes safe way where you
[01:10:37]
can experiment in production.
[01:10:39]
So you need to create some guardrails and limit the scope and risk of that experiment.
[01:10:45]
But you can set it up in a way where you can do a small experiment in production too.
[01:10:50]
So I think we're coming to the end.
[01:10:52]
So maybe we should summarize what deliberate practice is and how you can use it.
[01:10:57]
Yeah.
[01:10:58]
So what I gather is that you should try to find something that you want to improve.
[01:11:05]
You make an intention, you make a goal of improving some kind of thing, and then you
[01:11:11]
do some introspection on figure out how can I improve this?
[01:11:16]
How can I cut this up into multiple separate exercises that I can work on?
[01:11:21]
And then whenever you do these on repeat, on repeat, and then you do some again introspection
[01:11:28]
to figure out, did I do this how I wanted it to be?
[01:11:33]
Did I improve?
[01:11:34]
Did I did it worse?
[01:11:36]
And you continue on until you're happy with the results, or maybe you even change the
[01:11:40]
exercise.
[01:11:41]
Yeah.
[01:11:42]
Yeah.
[01:11:43]
That's a great summary.
[01:11:44]
Yeah.
[01:11:45]
And you need to do TDD apparently.
[01:11:48]
Dillon says do TDD.
[01:11:49]
Tell them Dillon sent you.
[01:11:53]
Yeah.
[01:11:54]
Yeah.
[01:11:55]
And have fun and explore and hopefully doing this with other people is great too.
[01:12:03]
You can learn a lot from other people's ideas about this.
[01:12:06]
It can make it more fun.
[01:12:08]
It can give you a way to learn from what shortcut key somebody else is using or...
[01:12:15]
So much.
[01:12:16]
Yeah.
[01:12:17]
Just these little things that you pick up from other people.
[01:12:19]
And it also naturally makes it easier to be like, do we really need to take that small
[01:12:24]
of a step?
[01:12:25]
And you're like, well, we're doing the exercise.
[01:12:28]
Let's do it.
[01:12:29]
It helps you sort of stay disciplined about doing the exercise.
[01:12:34]
Learning shortcuts is also something like you should absolutely do something deliberate
[01:12:38]
and practice on those a few.
[01:12:40]
Totally.
[01:12:41]
That's a great constraint game.
[01:12:44]
Yeah, absolutely.
[01:12:45]
Yeah.
[01:12:46]
So, where can people find exercises and katas?
[01:12:51]
So you mentioned exorcism.
[01:12:54]
Are there any katas that...
[01:12:55]
I think you have a repo with a few katas.
[01:12:58]
I do have a repo with a starter for some katas.
[01:13:03]
And yeah, I'll link to some resources for some katas, some descriptions of katas, a
[01:13:09]
Gilded Rose kata starter, that video where Corey and I go through Gilded Rose.
[01:13:15]
Yeah.
[01:13:16]
And you just sort of have to dive in a little bit too.
[01:13:21]
It's the kind of thing like you might not necessarily have somebody sit you down and
[01:13:25]
like say, here's how you do a kata.
[01:13:28]
So you just start somewhere.
[01:13:30]
Just do like really just, you know, try to solve fizzbuzz, do elm init and set up a test
[01:13:38]
repo or you can like pull down my elm kata starter, you know, probably nicer because
[01:13:44]
you don't have to set up elm tests and things like that.
[01:13:47]
Clone that, write a failing test for fizzbuzz with one, input one, make it pass, etc, etc
[01:13:55]
until you solve fizzbuzz.
[01:13:56]
Like really that...
[01:13:58]
And then?
[01:13:59]
And then apply to Dillon's company because he wants to hire fizzbuzz developers.
[01:14:06]
I want to hire fuzzbuzz developers.
[01:14:08]
Fuzzbizz.
[01:14:09]
It's more cutting edge.
[01:14:11]
Am I fired again or?
[01:14:15]
Double fired.
[01:14:16]
Double fired.
[01:14:17]
Twice in a day.
[01:14:20]
Try fizzbuzz and then try it again.
[01:14:22]
If you've done that, then you're well on your way to doing katas.
[01:14:26]
So like it seems very simple, but start there.
[01:14:31]
Well, so give us a star and heart and favorite on Twitter if that's still around when this
[01:14:38]
episode goes live.
[01:14:40]
Give us a rating in iTunes podcasts.
[01:14:44]
Tell a friend about Elm Radio.
[01:14:46]
Submit a question at elm-radio.com slash question.
[01:14:51]
Join our Slack channel, elm-radio in the Elm Slack and Jeroen.
[01:14:56]
Until next time.
[01:14:57]
Until next time.