Tips On Learning How To Code

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video we're going to be talking about some tips when learning how to program okay whether you're learning a language or a specific framework or whatever it may be now if you haven't watched my healthy tips for programmers video I would suggest checking that out as well put a link in the description that covers more of the physical and mental health areas alright so first thing we're going to discuss is how to remember all the code you learn and how to retain that stuff this is something that every programmer battles with people ask me all the time how do you remember all these different languages and frameworks and constructs how do you have that much space in your mind well ironically the first thing to do is to not remember you don't want to simply remember the characters that you're looking at on the screen you want to understand and comprehend it there's a huge difference in cramming remembered information into your mind and really comprehending what's happening and how the logic is working and you have to remember that all code is different so if you just remember let's say some kind of helpful function and then later on you run into some code where that function could be used to solve a particular problem but one little thing has changed from what you've remembered so you're going to get stuck because you simply remember the structure of the code but you didn't really understand or grasp the concept if you had then you'd be able to test other ways of doing it and you'd be able to adopt to this new change it's kind of like reading a book and just memorizing the words but not really understanding the story behind them and you want to be an active learner not a passive learner a passive learner basically listens and takes notes to try to retain the information for the next test and an active learner is aimed at creating similar situations and solving problems so it's a much more dynamic way of learning so you want to put what you've learned into use into common use something you would actually face in the real world first you want to just run the original code exactly as is exactly as you read it or saw it on a video and then you really want to understand the logic of every single line and everything character okay so if there's one piece of code or function that you don't know or you don't understand what it does Google the out of it every function every expression figure out what that line does and how it does it because you're you not knowing that one line of code could make or break you using that function or whatever it is in the future future situations and then once you really understand a piece of code you want to try and make some changes start small and start by adding an extra piece of functionality or you don't even have to do that you can just clean it up maybe maybe there's some code that is very similar in the script and you can put put those into a custom function so you don't have to repeat yourself and you save yourself a few lines just something small like that to start with and once you made some small changes try and recreate something completely new using that same type of logic this is where active active learning really shines if you just remember the code then you're not going to be able to create something new you only be able to repeat the same thing over and over if you truly understand the logic then everything else is just a variable okay this makes you a much more dynamic programmer now when you're learning something new you're going to make mistakes and probably a lot of them you're going to get strange errors of all different types and this is actually a good thing fixing errors is one of the best things you can do to learn in programming and Google is your best friend in these situations search sites like Stack Overflow for all the different types of error messages that you're getting and it might take a while but eventually you're going to find what you're looking for okay so as I said earlier you don't want to just remember code you want to understand it but sometimes you do need to go back and check the correct syntax especially if you're working with more than one language sometimes I'm writing JavaScript and then all of a sudden they'll start going into PHP I'll start adding you know money signs of my variables I won't use var and so on it's easy to get the syntax with multiple languages can used so if you have multiple references that you can go back and check the exact structure and the exact syntax that's really helpful and there's a couple ways to do this so one is to keep small text files with common snippets for each language I'll keep it right on your local machine or you could use a cloud service like Dropbox so you can access them from anywhere I have a folder called snippets and then I have subfolders with each language and then another level for certain frameworks of that language okay there's also a lot of online tools that you can use to store and look up snippets just box is a really popular one you just need to github account and you can sign up for free you can categorize snippets into color-coded folders and you can label them search for them and so on see snip is another really cool snippet manager you can sign up with your github account and I've heard lots of good things about snip leaf but I've never actually used it and for most of these snippet managers they allow you to set your code to private so only you can see it or to public if you want other people to be able to use your snippets another great resource is documentation whether it's the documentation of a language like PHP net or Doc's for specific framework or library you'll be able to find all the functions the class names and so on okay you also have informational sites and blog posts I have about a hundred different blog posts bookmarked that I use to to go back and look at examples and references to certain blocks of code another tip when learning to program is to write code every single day even if it's only for 20 or 30 minutes you want to stuff fresh in your mind if you stop coding for a month or two or even less than that sometimes your mind is going to stop working in that particular way of problem-solving you're going to forget a lot so forgetting is is much easier than learning people have actually forgotten full programming languages from not using that part of their brain for so long you know it's usually pretty easy to get back but it does take that extra time where if you just practice it more often you wouldn't have lost that knowledge all right now try to learn something new every day even if you have to wake up a half hour earlier to watch a couple tutorials that can help you a lot all right you also want to stay up-to-date with trends current trends in technology and more specifically in programming this is for any programmer or developer not just people learning and if a co-worker starts talking to you about a common trend you want to be able to respond and it also gets your brain going and gives you that much more knowledge all right so there are some common principles in computer programming and web development that apply to a lot of different situations we even have fancy acronyms for them so kiss or keep it simple stupid doesn't just apply to programming but it definitely does apply you don't want to make things more complex than they need to be don't try to show off and make something complex just to make it complex remember it's not just writing code that you need to think about you also need to think about maintaining it and the more complex the harder it is to maintain so dry or don't repeat yourself is another really helpful principle to stick by when you're learning so if you have two or more pieces of code that are pretty similar and they just have different variables you want to put those into a single function or method or class or something like that make your code as simple and as short as you can while keeping the same functionality okay it'll help you and anyone else who uses for your code in the future okay there's also yeah Guinea or Yagami and not exactly sure how to pronounce it but it stands for you aren't going to need it and what this means is you should only implement what you actually need especially if it's a big project and you're just starting out focus on the key features that you a school we need and then later on you can think about the extra bells and whistles okay now this doesn't always apply sometimes you do need to plan for future growth but just try to stay focused on the absolutely accessories if you can so this last slide is probably the most important there's going to be times when you get stuck and you start to really question if this is what you want to be doing are not want to be but if this is what you should be doing you want you start thinking that you're not smart enough even if you've ever felt like that trust me you're not alone especially if you're like me and you didn't grow up in front of a computer screen and you may think since you weren't a tech geek all your life that this isn't the place for you and you don't fit in I can't tell you how many times that I felt like that myself but the most important thing is that you stick with it and have confidence in yourself all right you you can't be doubting yourself and you can't beat yourself up okay we all get to that place where we get stuck and it seems like it's impossible to find the answer all right but if you do fall and you get into a slump just make sure you get back up and that may sound cliche but if that doesn't make it any less true okay it's also important to do what you love if you love design and front-end stuff try to do as much as that as you can if you love logic and algorithms and back-end stuff then do that alright just whatever you do don't give up all right so enough with the self-help stuff that's it guys for this video hopefully you enjoyed it and you'll use some of this stuff to keep learning more and more and that's it thanks and I'll see you next time
Info
Channel: Traversy Media
Views: 181,272
Rating: 4.9743972 out of 5
Keywords: learning how to code, learn code, learn to code, coding, code, programming, computer programming, coding tips, write code
Id: 0wHyoBPc6zs
Channel Id: undefined
Length: 10min 19sec (619 seconds)
Published: Fri Mar 10 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.