back to index

What Does Deliberate Practice Look Like for Computer Programming?


Chapters

0:0 Cal's Intro
0:25 Cal reads a question about deliberate practice
0:54 Activities designed to stretch your comfort point
1:40 Write real code
3:52 How to get the stretch

Whisper Transcript | Transcript Only Page

00:00:00.000 | [MUSIC PLAYING]
00:00:03.400 | All right, let's do some questions.
00:00:07.840 | Let's do some questions.
00:00:09.920 | We will start here, as always, with some questions
00:00:12.560 | about Deep Work.
00:00:14.200 | Coffee up.
00:00:18.360 | All right.
00:00:18.880 | So our first question comes from Alessandro.
00:00:23.040 | Alessandro asks, what does deliberate practice
00:00:26.360 | look like for computer programming?
00:00:31.200 | And he goes on to clarify that he finished
00:00:33.680 | a master's in applied math.
00:00:35.640 | He has a junior software developer job,
00:00:38.320 | and he wants to get better fast.
00:00:40.920 | All right.
00:00:41.440 | So we talk about deliberate practice all the time.
00:00:44.320 | Quick primer, it's the best framework
00:00:46.560 | we have for understanding how people get better
00:00:48.480 | at complex skills, be them physical or intellectual.
00:00:51.400 | It requires stretch.
00:00:54.000 | So activity is designed to stretch you
00:00:56.000 | past your current comfort point.
00:00:57.520 | If you're not stretching, you're not going to improve.
00:01:00.520 | And then two, it requires feedback, feedback
00:01:04.120 | so that you know that whatever you're doing here,
00:01:06.320 | the stretch activity you're doing,
00:01:07.740 | that you're doing it right, that you're doing it right
00:01:11.280 | and you're doing it well.
00:01:12.320 | Because underneath the hood that is our skull,
00:01:17.400 | you're really trying to isolate the relevant neural circuit
00:01:21.360 | and fire it as cleanly as possible.
00:01:23.720 | Because what fires together wires together.
00:01:25.520 | So you're going to get more myelination
00:01:28.280 | on those circuit connections if you isolate it.
00:01:30.360 | So what you want to be doing is really focusing
00:01:32.320 | on doing the thing you want to do better.
00:01:34.640 | So you need feedback to make sure
00:01:36.000 | that you're doing it right.
00:01:37.120 | All right.
00:01:37.620 | So how do you get that in computer programming?
00:01:40.000 | Write real code.
00:01:42.680 | Right.
00:01:43.640 | Be doing the thing you want to get better at.
00:01:46.360 | So you want to be writing real code.
00:01:48.520 | The feedback is really clear in computer programming.
00:01:52.160 | A, does it compile and B, if it compiles,
00:01:53.920 | does it do the thing it's supposed to do?
00:01:56.400 | You're constantly getting that feedback.
00:01:58.440 | Rookie mistake we see in the computer science curriculum
00:02:00.760 | all the time.
00:02:01.280 | I don't really teach programming courses
00:02:02.640 | because I'm a theoretician.
00:02:03.760 | But I hear this from the professors that
00:02:05.840 | do teach the skill of programming
00:02:07.400 | to computer scientists is that rookie computer programmers
00:02:11.920 | often do too much before they test.
00:02:15.600 | Like in some sense, they say, OK, I'm
00:02:17.200 | going to just try to make this whole thing work
00:02:19.160 | and see if it works.
00:02:21.040 | More adept programmers, what they're going to do
00:02:23.120 | is test at the level of their uncertainty.
00:02:27.360 | So at the very smallest granularity at which I'm not
00:02:30.680 | quite sure, I'm not 100% sure that what I did is actually
00:02:33.040 | going to do this, then you need to be testing.
00:02:35.560 | And testing could be as simple as you have print lines
00:02:37.880 | in there.
00:02:39.080 | But if you're doing, let's say, some assignment,
00:02:41.560 | like I'm going to use a linked list as part of a program
00:02:46.080 | to add polynomials.
00:02:48.880 | Don't just write the whole program.
00:02:51.560 | Does this work?
00:02:52.520 | I gave it a polynomial and another one
00:02:54.080 | did it add it properly.
00:02:55.480 | You should be with little print statements in there testing
00:02:58.040 | everything along the way, especially if you're new.
00:03:00.160 | Does my linked list work?
00:03:01.760 | Let me just make sure and do a little test there.
00:03:04.560 | Is it properly storing all the parts of the polynomial?
00:03:07.040 | Let me print everything there.
00:03:10.160 | Is this add routine being called properly?
00:03:12.240 | So you want to be getting feedback from,
00:03:14.400 | does the code compile first of all, and two,
00:03:17.080 | does it do what I want to do?
00:03:18.600 | But that means you have to have this very small granularity,
00:03:21.160 | especially if you're new.
00:03:21.920 | Just a little bit at a time, make sure it works,
00:03:23.960 | do the next thing.
00:03:25.400 | If you're compiling and praying, like I wrote a bunch of code,
00:03:31.760 | it doesn't compile.
00:03:33.400 | I'm just going to randomly change a bunch of stuff
00:03:35.480 | and try again and see if it compiles.
00:03:37.440 | You're not learning.
00:03:38.960 | Incremental.
00:03:40.160 | Does it compile?
00:03:40.840 | Did it work?
00:03:41.640 | All right.
00:03:42.160 | Let me add one more little thing to what I'm doing here.
00:03:43.880 | Some new print statements to test it.
00:03:45.040 | Does it compile?
00:03:45.720 | Does it work?
00:03:46.720 | That's how you get the feedback.
00:03:48.640 | And then finally, to get the stretch,
00:03:50.760 | whatever you're programming should be hard.
00:03:54.640 | There's something you're trying to learn how to do.
00:03:58.320 | So you're actually stretching yourself
00:04:00.040 | to do that in the program that you're writing.
00:04:01.960 | If it's too hard, then you're out of luck.
00:04:06.280 | If you're new to programming and you say, OK,
00:04:08.560 | here's my challenge.
00:04:09.640 | I want to write my own Minecraft style voxel engine.
00:04:14.920 | That's too big of a stretch.
00:04:16.800 | But if you're kind of new to programming and you say,
00:04:20.840 | I'm going to look up in a textbook a sorting algorithm
00:04:25.720 | and I'm going to actually implement that sorting
00:04:27.800 | algorithm to see if I can sort this array,
00:04:29.520 | I'm not quite comfortable with looking up algorithms
00:04:32.400 | and implementing them.
00:04:33.520 | That's like a very good healthy stretch.
00:04:36.480 | All right.
00:04:37.000 | So I'm getting a little nerd.
00:04:38.200 | I'm getting the nerd weeds here.
00:04:39.560 | But Alessandro hopes that helps.
00:04:42.360 | Write real code, compile and test as your feedback.
00:04:45.800 | Make sure that code is hard.
00:04:47.120 | You're doing something you didn't know how to do before,
00:04:49.480 | but not too hard.
00:04:51.440 | There's actually-- some of my kids like Minecraft.
00:04:55.080 | Jesse, you probably don't know Minecraft
00:04:57.360 | because you're not a 12-year-old boy.
00:05:01.920 | But it has a very complicated graphics engine.
00:05:04.920 | It's a voxel engine, blah, blah, blah.
00:05:07.480 | There's these YouTube videos my son
00:05:09.760 | was showing me where people see how fast they
00:05:13.160 | can build it from scratch.
00:05:14.840 | So it's like a screenshot of their computer
00:05:17.000 | and they cut through time a lot, but they basically
00:05:19.280 | build the game from scratch in a day.
00:05:22.600 | Yeah.
00:05:23.720 | Which brings me to my other point.
00:05:25.840 | I can't help but think, what societal good could they
00:05:29.360 | be doing instead with that brain?
00:05:30.760 | You see somebody could do that, you're like, I don't know,
00:05:33.200 | man, couldn't you be working on vaccines
00:05:36.200 | or coding up a system to help people find new jobs?
00:05:44.240 | That's often my thought when I see YouTube,
00:05:46.040 | is that's a smart person with a lot of time on their hands.
00:05:48.680 | And maybe they should be organizing a food drive
00:05:51.920 | at their church or something.
00:05:53.400 | And yet, we're on YouTube.
00:05:54.920 | So rocks, glass houses, things are shattering.
00:05:59.000 | [MUSIC PLAYING]
00:06:02.360 | (upbeat music)