How I would learn to code (if I could start over)
By Tina Huang
Summary
## Key takeaways - **Start with Python Basics**: Recommended language to start coding in is Python because it's extremely beginner-friendly, versatile, with simple syntax, great documentation, and easy to get help. Cover variables, simple data types like strings, floats, ints, arrays, loops, functions, if statements, and object-oriented programming. [00:52], [01:06] - **Use Interactive Platforms**: Recommend interactive websites like freeCodeCamp and Codecademy because you don't have to spend time setting up environment, it's hands-on, you implement things learned and get instant feedback. [01:26], [01:44] - **2-Week Basics Timeline**: If dedicating 4 hours a day, basics take around 2 weeks; don't waste time understanding every detail or taking syntax notes, focus on trying concepts yourself. [03:31], [03:42] - **Pick Small Interesting Projects**: Choose first project that's interesting/useful and start small, even if someone has done it already for reference when stuck, but don't copy without understanding. Examples: random food recommender, blackjack, tic-tac-toe, simple stock trading bot. [04:35], [05:04] - **Tinker and Explore Code**: When practicing, play around and explore outside what's prescribed, like trying int in print('hello world') to learn data type errors and transformations; best programmers are tinkerers. [02:28], [02:56] - **Embrace Errors Calmly**: Get comfortable with not knowing things and errors; if code runs first time without errors, be suspicious; freaking out hinders learning, just fix problems. [11:01], [11:07]
Topics Covered
- Tinker beyond instructions
- Skip syntax details, master concepts
- Iterate projects endlessly
- Embrace errors as default
- Join community for acceleration
Full Transcript
Hey guys, how's it going? So, I've been coding for 5 years now. So, there were things that I did right from the very beginning, but there were also a lot of things that I didn't do correct and I
had to like kind of figure it out. So
this is the video that I wish that I had when I was starting off and how I would learn coding if I were to do it all over again. So, in this video, I'm going to
again. So, in this video, I'm going to go through my step-by-step approach to learning coding, as well as an approximate timeline. I'll also be
approximate timeline. I'll also be recommending some resources and going through how to pick projects, including some example projects. And then I'll be
talking about the correct mentality or mindset as you learn to code, which is something that I got really, really wrong um from the very beginning. And it
actually took me years to adapt to the correct mindset. Finally, I'll be
correct mindset. Finally, I'll be sharing with you guys a supercharged tactic to learn to code faster after you've covered the basics. My
recommended language to start coding in is Python. Python is an extremely
is Python. Python is an extremely beginnerfriendly language because it's very versatile and the syntax is also very simple to understand. It's also an extremely popular language. So there's
great documentation for it and it's easy for you to get help. So here's the basics to cover. First, you should cover variables and then move on to simple data types like strings, floats, ints
as well as arrays. Then you should cover loops, functions, and if statements. And
you should also learn the concepts of objectoriented programming and that should be enough to get you started. In
terms of resources, I recommend interactive websites or platforms like free code camp and code academy. This is
my preference because you don't have to spend a lot of time downloading everything and setting up your environment, which by the way I still think is like the hardest part of coding today. And it's also very hands-on. So
today. And it's also very hands-on. So
you immediately get to implement the things that you learned and you get instant feedback on it. and you know immediately if you got the answer correct or not. I go into a lot more detail about why learning through application is extremely important for
technical things in my how to learn technical things video. So do check that out and I'll link it above if you want to hear a more in-depth reasoning for this. If you do prefer books for videos
this. If you do prefer books for videos that is totally cool as well. And here
are some good resources that I recommend.
My one piece of advice is that if you do choose to learn through video or through books, make sure that you also practice everything it is that you're learning and you're not just like sitting there and reading your book or something and just trying to like consume that
information and remember it. So that
application is going to be more on you.
Another general piece of advice regardless of what where it is that you're learning from is that make sure that when you're practicing and implementing, try to play around with things a little bit and actually explore
outside of what it is that you're told to do just from that resource. I'll give
you an example. So, say that a question is telling you to print something right? Like print um I don't know, hello
right? Like print um I don't know, hello world, for example. And then you're like, okay, so I'm printing hello world and that's a string data type, right? So
what happens if I put in an int data type? Well, if you try doing that
type? Well, if you try doing that you'll realize that hey, it actually would throw an error. So what you actually have to do is that you have to transform that int into a string data type.
And that really solidifies the idea of different data types as well as the fact that functions will take specific kinds of data types. So, I'll be going into a lot more depth about mentality later on in the video, but just for now, I wanted
to kind of bring that up that exploring and just playing around with things while you're coding is a really good way of solidifying information is also going to be what makes you a better programmer
faster. In terms of timeline, I
faster. In terms of timeline, I recommend that you go through these basics fairly quickly. Say if you're able to dedicate 4 hours a day, like four proper hours to studying, I think
this will take you around 2 weeks to cover all these basics. You might be thinking to yourself, "Wow, that is a pretty short period of time." And yeah yeah, it is. If you've never learned technical things before, you might fall into the trap of wanting to like
understand exactly every single little detail and trying to take a bunch of notes about the syntax, but that is a a big trap. It's also a mistake that I
big trap. It's also a mistake that I made. Trust me, you would be wasting a
made. Trust me, you would be wasting a lot of your time if you tried to do that. You really need to focus on
that. You really need to focus on understanding these fundamental concepts by trying them out yourself. And don't
focus too much on the details. So after
you've covered these basic topics, it is now time to do your first project.
Learning to code is all about doing projects. So congrats, you're ready to
projects. So congrats, you're ready to start your first one. Now some platforms or classes will give you some sample projects to do. So feel free to do those. Although I still recommend that
those. Although I still recommend that you also choose some of your own projects to do as well. And these are my criteria for choosing your first coding project. Number one is to choose
project. Number one is to choose something that you find interesting and slash or useful. And number two is to start small. In fact, don't be afraid to
start small. In fact, don't be afraid to do a project that someone has actually done already. It actually might be quite
done already. It actually might be quite helpful because if you get stuck, you can reference some of the material that they did and that can help unstick you along the way. Just make sure that you're not copying code from another
resource without actually understanding it or attempting it for yourself first because that will not help you learn.
So, here are some example projects. One
of the first projects that I did was a random food recommendation system. I'm
the kind of person that never knows what I want to eat. So, what I did was that I had an array and I put all the meals that I knew how to cook um and that I usually like eating and I put them into
an array and then there's a random module in Python and you can and you can call a function that is able to randomly index that array and get the food item
um and print it out as a recommendation for what I should cook that day. After
writing that core function, I then made it into a program that was able to take in inputs from the user about what I actually had in the fridge and I was able to add some logic. So, it would only recommend recipes that contain
certain ingredients. This project was
certain ingredients. This project was pretty great because it was useful to me and it also covered a lot of the basics um that I just learned and I was able to practice implementing. Another great
practice implementing. Another great category of starter projects is simple games. For example, like blackjack and
games. For example, like blackjack and poker. These games are really great for
poker. These games are really great for practicing object-oriented programming.
You can also do like tic-tac-toe or snake, which I think are great because you can actually display a simple UI.
It's pretty exciting cuz you can actually like visually play your game.
Another great starter project is kind of like a scoped down version of what I'm working on right now, which is a stock trading bot. My project is a little bit
trading bot. My project is a little bit more complex because we're getting the data um doing some logic on it, and then we have to connect back to the brokerage so that we can put in trades. But if
you're interested in the stock market and trading in general, we can do a scope down version pretty easily. For
example, you can have some arrays with the prices um of a stock that you're interested in as well as maybe like volatility for example. And then you can do some logic like if the average price
is equal to this, then we should sell we should buy. And you can also do like other technical indicators like RSI for example. After you do that, you might be
example. After you do that, you might be like, hm, wouldn't it be nice if I can actually get the data instead of just manually inputting into arrays? And
that's when you can start learning about the Pandanda's data frame, which is for storing tables of data as well as APIs which stands for applied programming interfaces, which is when you have
different pieces of software interacting with each other. So, in this case, your code or your software is getting that data from another piece of software. And
that's how you make your beginner project into an intermediate where you in an advanced project. This is actually a great example that illustrates a fundamental concept of learning how to code. You start off with this simple
code. You start off with this simple project and you start iterating on it and making it better and better as you learn more and you become a better programmer and over time your projects also get better and better. It's a
little bit harder to give a timeline and how long it will take for you to finish your first project because like I was saying you can start off with a simple project and you can keep building upon that, iterating upon that. But I would say like to build that simple project
from the very beginning. That would
probably take you maybe around like a week or so. So say that you learn everything in two weeks and then you probably have like another week or so in which you implement the first version of that project. My advice after finishing
that project. My advice after finishing your first project is that if you haven't already to start learning more about algorithms and data structures.
Again, there's a lot of resources about this and wherever it is that you learn the basics probably also has a section on algorithms and data structures. Data
structures come in pretty handy and I wouldn't be surprised if you kind of just ran into them already and learned what they are. These include
dictionaries, link lists, cues, heaps trees, graphs. I think that's most of
trees, graphs. I think that's most of them. A fun visual project you can do
them. A fun visual project you can do that really gets you implementing these data structures and algorithms is building a maze and algorithms to solve it. I'll link some resources in the
it. I'll link some resources in the descriptions that can get you started. I
also recommend focusing on learning how APIs work. Understanding APIs is really
APIs work. Understanding APIs is really important because a lot of the code that you'll be writing is not going to be in isolation. You'll actually be writing
isolation. You'll actually be writing code to interact with multiple pieces of other software to ultimately create a project that does the thing that you want to do. Also recommend spending time learning how to read documentation cuz
you're going to be spending a lot of time reading documentation. So at this point you've covered the basics, you've done your first project, you learn about data structures, algorithms, APIs. At
this point, it's just going to be all about learning more topics and implementing them on more projects.
Depending on your interest, you might start looking more into web development for example, app development. We're
playing around with AI random. The world
is your oyster, and the possibilities are, endless., All right,, now, we're, on, to
are, endless., All right,, now, we're, on, to the section about mentality and the correct mindset to learn how to code. I
mentioned this one previously. It's
about the importance of implementation and application as opposed to the theory and concepts.
Yeah, knowing all the things isn't going to help you that much in doing the things.
I've already touched on number two as well, which is staying curious and really exploring things outside of what is exactly prescribed in a resource. I
gave the example of that print statement earlier and that's kind of how you start um learning about a lot of these like other concepts and also more deeply understanding the concepts that you do know. The best programmers that I've met
know. The best programmers that I've met are the tinkerers. They're the people who play around with their code and just like try a bunch of different things and that makes them really deeply understand what it is that they're doing and that
also reveals topics that they can later delve deeper into. Number three is when you get stuck and you need to learn how to solve your own problems. When you really boil it down, programming is all
about problem solving. And you can ask any programmer, even super experienced ones that have been coding for like 10 years or 20 years, Stack Overflow is probably still their best friend. It's a
forum style website in which people ask coding questions and it's the first place that you should look when you run into a problem. When I was a beginner and also what I noticed a lot in beginners is that when they run into a problem, when you get like an error
message or something, they like don't know what to do and then they kind of just like freak out and don't know how to solve the problem. But often times if you just take that error message that you get and just Google it, uh the first
link that pops up is probably from Stack Overflow and if you read the answers that people give, it would probably tell you what your problem is. and then you can go back and actually solve it.
Number four is getting comfortable with not knowing things and being okay and staying calm and actually figuring it out. I'm not kidding when I say that if
out. I'm not kidding when I say that if I write a piece of code and it actually runs without any errors the first time I become extremely extremely suspicious that something must have went wrong. My
default state is that whatever code I'm running is probably has an error in it.
But you know that's okay. Like I just have to look through it and just fix the problem so that I eventually get it to work. This is an extremely extremely
work. This is an extremely extremely crucial mindset to get into because if you freak out and just can't deal every time you run into an error, then you are going to have a huge problem learning to code and just being a programmer in
general. All right, so how to
general. All right, so how to supercharge your learning? After you've
covered the basics and maybe did a project or two, I highly recommend that you find a community to work on projects together. Or even better, get a job in
together. Or even better, get a job in which you code on a job. For example, a software engineer, data scientist something like that. It'll let you learn from experienced programmers and you will learn so much just from interacting
with these people. Plus, it gives you a great boost of accountability because if you get stuck in whatever, you can't just give up because it's literally your job. Learning how to code is really a
job. Learning how to code is really a neverending process. You start with the
neverending process. You start with the basics, build out your first project and then you become an intermediate coder at some point, and you just build more and more projects, learn more and more things. There's never going to be a
more things. There's never going to be a time in which you're like, "All right, I am a master coder now. um I never have to learn anything again. No, that's
that's literally never going to happen because in this field it's also evolving so quickly. There's always going to be
so quickly. There's always going to be like new tools that are being released um and just things just keep getting better and better. If you wish to take this further and even build a career out of coding, then that's something that
you need to embrace. Embrace the
learning process and embrace making projects. For myself, I really have to
projects. For myself, I really have to say learning how to code is one of the best decisions I've ever made. It's such
a powerful tool in your toolbox in our day and age. And it also gave me a lot of freedom because say like I'm interested in a certain project or you know I'm just like curious about
something. It's easy for me because I
something. It's easy for me because I know how to code to actually go do it myself, right? I don't need to rely on
myself, right? I don't need to rely on other people to do the implementation for me. Well, that's all I've got for
for me. Well, that's all I've got for today's video on how I would learn to code if I were to do it again. I hope
this video is helpful for you. hopefully
gets you more excited about coding and gives you a path on how to get started on learning the basics and doing your first project. I'll see you guys in the
first project. I'll see you guys in the next video or live stream.
Loading video analysis...