Latest / DevQuestions with Tim Corey / 039 How Do I Practice What I Am Learning?
Transcript
- 0:00SPEAKER_00: Welcome to the Dev Questions Podcast with Tim Corey.
- 0:03SPEAKER_00: Join us each episode as we tackle the questions you are asking about a career in software development, understanding the industry, and new technology.
- 0:12SPEAKER_00: If you're just starting out or you want to grow stronger as a developer, this is the place to get your questions answered.
- 0:19SPEAKER_00: Now, here's your host, expert developer and online educator, Tim Corey.
- 0:25SPEAKER_01: How do I practice what I'm learning?
- 0:27SPEAKER_01: How do I come up with ideas of how to practice?
- 0:30SPEAKER_01: What kind of apps do I create to practice?
- 0:33SPEAKER_01: These are questions that I can't really attribute to one person because pretty much everyone seems to ask these questions.
- 0:42SPEAKER_01: So in this episode of Dev Questions, I want to cover these questions.
- 0:46SPEAKER_01: How do I effectively practice what I'm learning?
- 0:50SPEAKER_01: Okay, so let's start off with a definition or the definition of practice.
- 0:57SPEAKER_01: Okay, what are we trying to accomplish?
- 0:59SPEAKER_01: What's our goal in practice?
- 1:01SPEAKER_01: Well, it's not just to replicate what you just saw in the video or read in the in the tutorial or blog post.
- 1:11SPEAKER_01: It is to understand what you just learned, to ensure you actually understood what you just learned.
- 1:19SPEAKER_01: This is something I often see, especially newer developers, doing is they'll watch one of my videos and then go on to the next video and the next video in the next video.
- 1:29SPEAKER_01: And I can tell that there is not really time in between those videos.
- 1:35SPEAKER_01: So one of two things is the case.
- 1:37SPEAKER_01: Either one, I covered topics that they already knew.
- 1:41SPEAKER_01: That's that's one possibility.
- 1:43SPEAKER_01: But the other possibility is that they assumed that because they watched a video and it made sense that they understood the topic.
- 1:52SPEAKER_01: And quite frankly, you don't understand the topic well until you've practiced it.
- 1:57SPEAKER_01: Okay.
- 1:58SPEAKER_01: So, and I've said it before, okay.
- 2:00SPEAKER_01: Unless you practice something, you haven't really learned it.
- 2:03SPEAKER_01: When I watch things, the very first thing I do is I build something.
- 2:07SPEAKER_01: Because when I build something, either I affirm that I have learned what I learned, or I figure out that I assumed things and they weren't necessarily true assumptions.
- 2:19SPEAKER_01: Okay.
- 2:20SPEAKER_01: And usually it's a ladder or some form of the ladder, especially since when you practice or when I practice, I don't just practice what I call the happy path, the path where everything should work and it all comes out roses.
- 2:34SPEAKER_01: What happens if you make a mistake, or what happens if you have an exception, or what happens if the user doesn't give you the right information?
- 2:41SPEAKER_01: How does it work?
- 2:43SPEAKER_01: Those are the kind of things I practice as well to make sure you understand how to use it in the real world.
- 2:49SPEAKER_01: So let's talk about what practice isn't first.
- 2:54SPEAKER_01: Okay.
- 2:54SPEAKER_01: So what practice isn't is creating a real application.
- 3:00SPEAKER_01: People often get hung up on this.
- 3:02SPEAKER_01: They say, Well, I would love to create practice apps, but they're just so big and so hard to create.
- 3:08SPEAKER_01: And I ask, well, what are you trying to do?
- 3:10SPEAKER_01: And they're like, Well, I'm I'm creating an application.
- 3:13SPEAKER_01: But an application to do what?
- 3:15SPEAKER_01: And they say, Well, you know, it's gonna be a to-do list that, you know, uses Signal R and all this other stuff in order to practice this stuff.
- 3:23SPEAKER_01: That's not practice, okay?
- 3:25SPEAKER_01: It's not the practice that you should do most often.
- 3:27SPEAKER_01: Now it is practice, but it's practice for full application integration testing practice.
- 3:34SPEAKER_01: Okay, it's not practice uh of small little pieces.
- 3:39SPEAKER_01: Okay, so practice isn't real applications.
- 3:42SPEAKER_01: Your applications you build for practicing one little thing should not do anything except prove you understand how the thing you learned works.
- 3:54SPEAKER_01: That's it.
- 3:54SPEAKER_01: That's all they should do.
- 3:56SPEAKER_01: They should not have a real world purpose.
- 3:59SPEAKER_01: So, what are the keys to good practice?
- 4:03SPEAKER_01: Well, number one, keep it simple.
- 4:08SPEAKER_01: So I use console applications whenever possible for testing.
- 4:14SPEAKER_01: And the reason why is because I can build up and get a console app working in 30 seconds.
- 4:22SPEAKER_01: I say file new project console app, and I say delete that console right line hello world statement they have.
- 4:31SPEAKER_01: I'm now good to go.
- 4:32SPEAKER_01: I'm I'm ready to start practicing whatever it is I learned.
- 4:36SPEAKER_01: Now, obviously, there's some things that you can't practice that way.
- 4:39SPEAKER_01: If you're learning about MVC, then you probably can't practice using a console application.
- 4:45SPEAKER_01: But in general, there's a lot more to learn in C Sharp besides just a user interface.
- 4:53SPEAKER_01: And often people say, Well, I want to practice, I want to learn MVC, so therefore I'm gonna do all my practice on MVC.
- 5:00SPEAKER_01: No, don't do that.
- 5:02SPEAKER_01: Because building up an MVC application is slow.
- 5:06SPEAKER_01: You have to do all this work to get it set up and make sure it's working and diagnose little quirky problems, and you haven't even gotten to the testing part yet, the practice part.
- 5:16SPEAKER_01: So keep it simple.
- 5:18SPEAKER_01: Build a console application.
- 5:20SPEAKER_01: And this is one of those confusions people have is they say, Well, but I want to learn MVC.
- 5:26SPEAKER_01: Yes and no, MVC is just a user interface.
- 5:30SPEAKER_01: What you're trying to learn is most likely C sharp.
- 5:34SPEAKER_01: So if you're learning about delegates, or if you're learning about data access, or if you're learning about an if statement, all those things are C sharp.
- 5:44SPEAKER_01: They're not specific to a user interface.
- 5:47SPEAKER_01: Therefore, use the simplest user interface possible so you can build up a test very, very quickly.
- 5:54SPEAKER_01: Your practice should be as much focused on just your thing you're learning about and nothing else.
- 6:02SPEAKER_01: Okay, so keep it simple.
- 6:04SPEAKER_01: Number two of the keys to good practice: have a goal.
- 6:10SPEAKER_01: Know what you're trying to practice.
- 6:12SPEAKER_01: It seems it seems obvious.
- 6:14SPEAKER_01: Okay, so if you're learning an if statement, you might say, Well, I'm practicing my if statement.
- 6:19SPEAKER_01: Well, yes, but what are you practicing?
- 6:21SPEAKER_01: Okay, so I start off with the happy path practice, is what I call it.
- 6:26SPEAKER_01: Okay, the happy path is the if everything works right, this is what should happen.
- 6:31SPEAKER_01: Okay, and so I will test an if and else statement is my first practice.
- 6:36SPEAKER_01: So happy path, uh, if else statement.
- 6:39SPEAKER_01: And then I'll do edge cases.
- 6:42SPEAKER_01: So I'll say, what about um an if else if else?
- 6:47SPEAKER_01: Or what about if I'm testing, you know, first name and last name, but the last name's not quite right?
- 6:54SPEAKER_01: What happens then?
- 6:55SPEAKER_01: And all these different things I try and test around the basic if else.
- 7:01SPEAKER_01: Uh cascading if, else, if, else, if, else, if else.
- 7:06SPEAKER_01: Those kind of things.
- 7:08SPEAKER_01: Trying to figure out how those all the different things work.
- 7:10SPEAKER_01: ORs, ands, ands, and ors, combining them, using parentheses to group them to create different scenarios.
- 7:18SPEAKER_01: All those things I try and test, and I'll create a different test for each one.
- 7:22SPEAKER_01: Or I call them tests, but it's practice.
- 7:25SPEAKER_01: Okay.
- 7:25SPEAKER_01: So these are not unit tests, don't get confused.
- 7:28SPEAKER_01: These are just testing out your knowledge.
- 7:31SPEAKER_01: So I'll create a goal with each of those practices and say, in this practice, I'm gonna test else if statements, and that's what I'll do.
- 7:39SPEAKER_01: In this test, I'm gonna test complicated if statements.
- 7:44SPEAKER_01: So first name equals Tim and last name equals Corey or last name equals Smith and all that kind of stuff.
- 7:51SPEAKER_01: Okay, so have a goal for each practice project.
- 7:57SPEAKER_01: Number three kind of goes along with this.
- 7:59SPEAKER_01: Cover the edge cases.
- 8:02SPEAKER_01: Don't just test the simple stuff.
- 8:05SPEAKER_01: Make sure you understand what happens.
- 8:08SPEAKER_01: For example, um, in the the next Timco retail manager video I'm gonna do, we're doing authentication from Blazor Web Assembly to an API.
- 8:20SPEAKER_01: Well, the API already exists and I already have authentication up and running.
- 8:24SPEAKER_01: So I'm having to hook that up to a Blazor Web Assembly.
- 8:27SPEAKER_01: And it's it's not the um the simplest thing to do.
- 8:31SPEAKER_01: And so what I did is I create a test project to test it out.
- 8:35SPEAKER_01: But I didn't just create a test project that did that that worked, where the username is correct and the password is correct.
- 8:42SPEAKER_01: I tried what happens if the username and passwords are not correct, what happens if the uh the role isn't existing, or what if what happens if?
- 8:52SPEAKER_01: And I try all these different ways to trick it out.
- 8:55SPEAKER_01: What if it's offline?
- 8:56SPEAKER_01: What happens?
- 8:57SPEAKER_01: All those things.
- 8:58SPEAKER_01: I try all those different things because I wanted to cover the edge cases and know how they worked, not just that if you have a login in and password, it works correctly.
- 9:10SPEAKER_01: Because what happens if I just stopped there and I tested?
- 9:14SPEAKER_01: Well, I put the correct username and password in and it works.
- 9:17SPEAKER_01: Woo-hoo! Great.
- 9:19SPEAKER_01: Um, except what if I put the wrong username and password in and it still works?
- 9:24SPEAKER_01: I've had that happen.
- 9:26SPEAKER_01: Where I thought I had authentication working, and I figured out that I just didn't need authentication because I wasn't asking for it.
- 9:34SPEAKER_01: So that's why you test those edge cases.
- 9:37SPEAKER_01: Test your assumptions.
- 9:38SPEAKER_01: And that's number four.
- 9:40SPEAKER_01: Test your assumptions.
- 9:42SPEAKER_01: When you say, Yeah, I've got this, you gotta test that.
- 9:47SPEAKER_01: Maybe you do.
- 9:49SPEAKER_01: Maybe you got this, maybe you fully understand it and you grasp it right away just by watching it.
- 9:55SPEAKER_01: But test that to make sure.
- 9:57SPEAKER_01: Because more likely what happens is you've got the big picture and you've got 80% of the details, but you're missing 20%.
- 10:06SPEAKER_01: And that's where testing those assumptions reveals that 20%.
- 10:10SPEAKER_01: And you go, oh, so that's what I need to do.
- 10:14SPEAKER_01: And then number five, the final key to good practices for testing or for practice is um do larger practice projects occasionally.
- 10:25SPEAKER_01: So I said at the beginning that your projects shouldn't do anything, they should just be about testing your little piece.
- 10:35SPEAKER_01: And if you liken this to unit testing, those are unit tests.
- 10:38SPEAKER_01: Okay, there's the testing one little thing and that's it.
- 10:42SPEAKER_01: And so I hard code everything.
- 10:44SPEAKER_01: If it's not part of my test, I hard code it.
- 10:47SPEAKER_01: So if I'm testing first and last name, those are hard coded.
- 10:49SPEAKER_01: I'm not asking the user for them because that's that's more work I have to do.
- 10:53SPEAKER_01: Yeah, it's a little bit of work, and I've done it lots of times, but nope, hard code it, it's easiest.
- 10:59SPEAKER_01: Okay.
- 11:00SPEAKER_01: But then at some point, you're gonna want to put a few of those different things together into a larger project.
- 11:08SPEAKER_01: And this still has to be tiny.
- 11:10SPEAKER_01: So I say larger, I mean compared to your super simple, super little practice projects.
- 11:16SPEAKER_01: But at some point you create a little bit larger of a project that maybe has a hundred lines of code.
- 11:23SPEAKER_01: Let's just pick a number.
- 11:25SPEAKER_01: Now, of course, your mileage may vary.
- 11:27SPEAKER_01: It depends if you're doing a full web project or something like that.
- 11:31SPEAKER_01: But just if your practice projects have 20 lines of code, this might have a hundred.
- 11:37SPEAKER_01: So in this one, you're putting a few of them together and you do that and you test out, make sure they interact properly.
- 11:45SPEAKER_01: And then maybe you build something a little bit larger.
- 11:48SPEAKER_01: So, for example, um, this is where you start to see projects that actually do something, even if it's tiny.
- 11:56SPEAKER_01: If you want examples of this, look at my Prove It series.
- 12:00SPEAKER_01: I am Tim Corey.
- 12:01SPEAKER_01: There's currently four different courses there, and then there's one bundle.
- 12:06SPEAKER_01: But you don't have to actually buy the courses, just look at the titles in the prove it.
- 12:12SPEAKER_01: Prove it is about doing those larger practice projects.
- 12:15SPEAKER_01: It's not about the super specific testing, it's about the little bit larger practices where you're putting something together and you're testing out your knowledge of a little bit larger topics.
- 12:29SPEAKER_01: So in there, you'll see things that test maybe something small as a four each, but maybe something larger, like, hey, use a date time to do these calculations.
- 12:40SPEAKER_01: It's a little bigger than just working with date time.
- 12:43SPEAKER_01: Now it's about calculating two different date times together, getting a time span, all that kind of stuff.
- 12:49SPEAKER_01: Okay.
- 12:51SPEAKER_01: And then when you're building a practice real-world project, which is still for making sure you know how things fit together.
- 13:01SPEAKER_01: Still, I don't want to say cut corners because that's not the right word.
- 13:05SPEAKER_01: But you don't have to build a feature complete application.
- 13:11SPEAKER_01: An example of this is the Timco Retail Manager.
- 13:14SPEAKER_01: Now, that series, which is on YouTube, we've been doing for over two years now.
- 13:19SPEAKER_01: Now, it's every other week, so it's about, I think, 60 episodes in, something like that, 50, so.
- 13:25SPEAKER_01: Um, but in that series, we are building a real world application.
- 13:31SPEAKER_01: But right now, it has one checkout page, it has um one administrative page, it doesn't have tons and tons of pages, which a real world application would.
- 13:45SPEAKER_01: And yet it simulates a real world application.
- 13:48SPEAKER_01: The reason why is because the rest of those pages probably sit do the same thing or similar as the pages we have.
- 13:57SPEAKER_01: So I don't need to create 20 pages that are pretty similar and just do slightly different things.
- 14:02SPEAKER_01: So I'm gonna do one page to show off that I can do it and show off I can work with it, but I'm not going to um repetitively do that for my practice.
- 14:13SPEAKER_01: Not unless I feel like I need that additional repetition.
- 14:17SPEAKER_01: Okay, so that's why a Timco retail manager, it's a full application and yet pretty cut down.
- 14:22SPEAKER_01: There's some things that people say they they make suggestions, which I really encourage suggestions in the Timco Retail Manager, especially, where I'm asking you, hey, how can we make this better?
- 14:33SPEAKER_01: But one of the things people ask about is, well, what if we add these pages or what if we add these these features?
- 14:38SPEAKER_01: And some of it's like, you know what, we could, but that's really just repetition, or it's really not that beneficial for our practice.
- 14:47SPEAKER_01: And so even though we do that in the real world, we're not going to do that in a Timco retail manager.
- 14:52SPEAKER_01: So that's another example of how to do it a larger practice where you're you're still doing a large practice, but at the same time, you're trimming it down as much as possible.
- 15:03SPEAKER_01: And here's the key as to why the longer you spend practicing, where you're doing setup work and repetit repetition work, the less you're learning.
- 15:17SPEAKER_01: So even though you're spending more time practicing, you're actually getting less value for it.
- 15:22SPEAKER_01: You want to maximize your practice because practice is important, it's highly important, but you want to maximize it so you can still move as quickly as possible through the different learning pieces you have to get through.
- 15:40SPEAKER_01: So every time you learn anything, practice it, but strip away all the stuff that's not necessary.
- 15:48SPEAKER_01: Get down to the very basics, keep it simple.
- 15:51SPEAKER_01: Make sure you have your goal, make sure you test those edge cases, also test your assumptions as to what you think should happen or does happen.
- 16:02SPEAKER_01: And then only do larger practice projects occasionally.
- 16:06SPEAKER_01: That will really speed up your process while at the same time giving you the value you need out of that practice.
- 16:14SPEAKER_01: By doing that, you're going to move forward faster.
- 16:18SPEAKER_01: Even if you're the person going from video to video to video, and you feel like, well, I'm really slowing down and do practice.
- 16:25SPEAKER_01: No, you're not.
- 16:26SPEAKER_01: What you're doing is you're speeding up your comprehension.
- 16:30SPEAKER_01: You may be slowing down all the things that you know about, but you're not slowing down your comprehension because just knowing about a topic and actually knowing how to do it are two different things.
- 16:44SPEAKER_01: And that's where this is going to help you.
- 16:47SPEAKER_01: Okay?
- 16:47SPEAKER_01: So I hope you found this episode helpful.
- 16:50SPEAKER_01: If you did, I'd appreciate it if you'd share it with your social networks.
- 16:53SPEAKER_01: Thanks for listening.
- 16:54SPEAKER_01: And as always, I am Tim Corey.
- 16:57SPEAKER_00: Thank you for joining us for this episode of Dev Questions.
- 17:00SPEAKER_00: Tim is committed to making it easier for you to become a developer.
- 17:03SPEAKER_00: If you would like to help make more content like this possible, please like, subscribe, rate, and share Dev Questions.
- 17:11SPEAKER_00: You can also send your questions to questions at IamTimcore.com.
- 17:16SPEAKER_00: Until next time, remember, you are too smart and your time too valuable to waste it making all the mistakes Tim did.
- 17:23SPEAKER_00: When you're ready to learn to think and code like a professional developer, head over to IamtimCore.com and enroll in a course.