In this post, I'm going to share the resources and tips that worked for me while learning to code.
My learning process, featuring The Bachelorette and rsyvarth.
- Why learn to code
- Which language to choose
- Where to start
- General tips
Why learn to code
Most people start out learning to code with a goal in mind. They might have an idea for a website they want to build or be working towards a career change.
For me, I enjoy learning new things and getting hands on with new information. When I started my serverless business development role at AWS, I wanted to be able to really understand AWS services, and that meant building things myself. I could make simple static websites or provision EC2 instances without code, but I needed to learn to code if I wanted to go deeper, for example writing my own Lambda functions. With each new projects I've built, I've also built on my programming knowledge.
If you're looking to build personal projects, there's a chance you may be able to use no-code tools (👋 hello Amazon Honeycode). If a no-code tool works for you and saves you time, by all means use it.
If you do have the time, I've personally found learning to code worthwhile. First, there's endless opportunities of things you can build and problems you can tackle just knowing the basics of programming, which is incredibly empowering. Second, I appreciate learning more about the underlying technology and learning to think like a programmer, which opens up new ways of problem solving.
Which language to choose
Python has served me well as a first programming language and is often recommended as a good one to start with. It's an easy and intuitive language to learn and is a good foundation to learn other languages from. Even cooler, it's used in a variety of different fields. Python is great for everything from automating tasks on your computer and building website backends, to advanced work with AI/ML and IoT technologies.
If you want to compare more languages and when you might choose them, this infographic is fun.
Where to start
Note: Python 2 is an older version of Python than the current version (3). It looks like Codecademy's Python 2 course is free, while their Python 3 course is paid. Given that the differences between Python 2 and 3 are fairly minimal at the beginner level, you could still take the Python 2 course, learn a bit about the version differences (namely,
print('hello')), and start coding in Python 3 without issues.
Overall, I appreciated starting with interactive online courses to get a feel for how the language works, before moving on to books. Books are great for learning more details and getting deeper into the language.
In this section, I'll share some general tips that helped me stick with learning to code, work through difficult bugs, and reach the point I'm at today where I really enjoy coding.
1. Build while you learn
I've found that intermixing studying from an online course or book with working on your own projects is a great way to stay motivated and learn as you go.
I typically start with the first few chapters of a book or a course, then spend some time building a new project with what I've learned. When I feel like I've reached a point where I'm struggling, I'll go back to studying.
Working on real projects will help you stay motivated and learn by doing, while also building a strong foundation through courses and books.
2. Get good at asking questions
Learning to program is all about learning to problem solve. If you're brand new to it, you might be surprised to learn that Google is one of software developers' primary tools for working through coding problems. Googling your questions is powerful, but even more so when you can do it well.
The more you code, your searches will evolve from 'how do I put something in a list at a certain point in python', to the more precise 'how do I insert a string into an array at a specific index', getting you answers faster.
Sometimes you've exhausted all potential searches and still don't know what to do. Another problem solving approach that I like is rubber duck debugging. In this method, you explain to someone (a rubber duck, a friend, a pad of paper) what each line of your program is supposed to do. Plenty of bugs will suddenly appear obvious once you've taken a step back.
When you first start coding, and especially when you leave behind book problems and start building your own projects, it can feel like you're constantly running into things you don't understand and getting blocked. As you improve your ability to quickly debug issues, coding will become a lot more fun. Writing code will start to flow and you'll even see things work on the first try 😎.
3. Ask for help
Few things are more frustrating than running into a programming problem that you just can't figure out how to solve. This is when it's helpful to have back-up!
- Friends. You might have friends that are learning to code or are already experienced programmers. People new to coding like yourself may be able to see things that you've missed, and software developers can show you how they would approach solving the problem.
- Coding meetups. Pre-COVID 19, I attended Meetup events for developers, like Puget Sound Programming Python (PuPPy). Hopefully we'll get this back someday! I know many groups are still doing virtual events.
Online learning groups. There's lots of great groups learning together on Twitter, Slack, and community forums to be a part of. To name a few: