3.1 Get more context: solve problems like a programmer
3: Control Flow with Conditionals
3.1 Get more context: solve problems like a programmer - Video Tutorials & Practice Problems
Video duration:
9m
Play a video:
<v ->Now we are gonna talk about how</v> to think like a programmer. Bear with me, this content is a little bit fluffy. But I've done quite a few courses in person with people who are totally new to programming and I wanted to have some part of this video to address those areas of concern that people have had. That are not related to, how do I program this one thing. In general, there are some good skills for programmers out there and some of them are not necessarily intuitive. The first one I'll talk about is structured problem solving. Then redefining success. Learning how to love learning and finally, empathy. The first one, structured problem solving is, generally, what people think of of when you say, think like a programmer. Steve Jobs said everyone in this country should learn to program a computer because it teaches you how to think. He probably didn't have this in mind, my code doesn't work, let's change nothing and run it again. That is definitely how some programmers think. I do that all the time. But, structured problem solving, in theory, should be, is first taking a large problem and understanding it. Asking questions so that you can figure out exactly what it is that you're trying to do. Being able to explain it to your grandmother, for example, or a child so that you can articulate the problem that you're trying to solve. Then you'll wanna break it down into smaller problems. For example, if your stuck on writing an algorithm for solving a maze, for example. It's not useful to search anything on the internet related to solve this maze. Maybe it is, but it is much easier if you can break it down into step by step. First we wanna do this, we wanna define what the maze looks like and how it's represented and then down to this problem, if this happens then do this. That gets into writing it out using computer logic. If statement, if and else statements, not, or, and, loops, things like that. Which we're gonna cover all of these things in this section of the course and the next section. You're breaking it down from the small problems into things that the computer understands and can act on. Then translating each of those statements to code. Once you have all of those smaller pieces broken out then you can work on solving each of those ones individually. That will make a large, complex problem way more manageable. The next is redefining success. This is a very common meme, my code doesn't work I have no idea why or my code works and I have no idea why. Both of those are problems. The latter one is very common for developers. If something works the first time, you're like wait, what did I do wrong, how is this working. You're gonna get a lot of errors and that's just gonna be a natural part of programming. When you're troubleshooting, debugging, you're getting an error, ways of solving it and knowing how to solve it is gonna be a very useful skill as a developer. So, look for the offending line of code. You can do that by looking at the stack trace in the error message using debug or print statements and using the debugger, as we saw in an earlier lesson. Searching the internet for the error message. Also, because Python is open source and its libraries are open source you can even look for the error message in the actual code and see when it gets called. Then next, learning how to love learning. This will eventually be you, hey, you've got a new error. That's some progress there. As I mentioned before, if you already know everything that you're doing and you write code without errors it's actually very boring. It gets to be a really tiring job if you're not constantly learning. So, pushing yourself, looking for new opportunities, working with people who are more experienced than you and asking for feedback, those are all great. There are a lot of learning sources available to you, especially these days, because there's a plethora of tutorials if you wanna learn a new library, a new language, a new skill. There are videos, websites, books and whatnot. I'll give a list of resources at the end of or in lesson five, about what to keep learning for after the class. There's also a documentation. Documentation could be better or worse for different languages. Python is moderately documented. There are a lot of blogs and stuff, and websites that you can ask questions. You can ask mentors and peers and, of course, taking courses, so online bootcamps or going to university or college. Lastly, let's talk about empathy. Now, this is not something that's traditionally seen as a big skill for software developers but I wanna point out why it is important, more and more, for developers to have empathy. One is for the user of your program to make your application useful, you have to think about the user's perspective. How are they likely going to use my program? You need to put yourself in the user's shoes. Is it easy for them to make mistakes? If we had that user input command and they put something in that we weren't expecting and we don't handle it, it breaks, you know that's not good. That can be frustrating. Also, is it intuitive? User experience design is a really fast growing area of computer science. Because nowadays, the idea itself and the function itself is not what creates success for an application. The design, is it intuitive, are people not frustrated when they're using it? Also, is it gonna be used by children or by the elderly or by people who don't speak the same language as you or have the same level of technical expertise. These are all, computers are in everyday life now and are being used by people who are not you. Next, what benefit is your application providing? First of all, to the creator, obviously, you wanna get some benefit, maybe you just want people to like your things, so you can get more subscribers and get more money. Maybe you're collecting a bunch of data to help improve the product or for some other purposes. In addition to that, think about the benefit to the user. So, for example, YouTube recommended videos are based off of an algorithm that isn't necessarily about what the user wants to see but what has been proven to have other users spend the most time on the platform. Those videos that get you addicted and go down these rabbit holes of YouTube videos is exactly what the company wants and what the video producers want because there are just more views, more time spent. But it's not really in the best interest of the user. These kinds of conversations are going to be more common, the more the technology is in our lives. Lastly, who is being harmed? There are a lot of discussions now about some unethical practices and a project manager or some boss tells the software developer to implement this thing. You can see yourself, as a software developer, being like, yeah, I guess it's my job to just like implement the thing they said and not ask questions. If I don't do it, someone else will do it. But more and more, the scrutiny is gonna come to the developers. Who actually implemented it? You are the last line of defense against malicious software. Not even overtly malicious but asking questions like, why are we doing this thing. Do we need to collect all of that information? What happens is if there's a data breach? Those kinds of conversations are not necessarily thought about too much by the people who are making decisions who don't know how to create software. You really have to be on the look out for those kinds of things. I would say that all of these skills, now, are very useful for being a successful developer and they're all skills that you can learn and you're not just innately good at software or not good at software.