Learning to Code – Part 1

A Better Approach

  1. Learn Basics/Fundamentals of Python
  2. Jump straight into "Easy" level data structures and algorithms on AlgoExpert. Practice them over and over until you are proficient. Follow the REACTO method right from the start. Also check that some types of problems (Linked Lists) start at medium level. Do 1 or two of those as well.
  3. Build a small project (Tic-Tac-Toe/Rock Paper scissors/) with no libraries imported. Build with function based and class based code. The second project (Snake Apple Game) can be built with a module like PyGame.
  4. Learn client-side or server-side theory: Odin project + Mozilla docs
  5. Build your own projects + contribute to open source. Better yet, find a volunteering group on VolunteerMatch or other sites

When you read about what it’s like being a professional programmer, a lot of advice like this comes up:

  • Won’t use most of the theory you learn in school
  • Don’t always need to know syntax
  • Need a solid portfolio with projects and open source contributions
  • Learn the most on the job, with Google and StackOverflow as your most useful resources
  • Work projects rarely start from scratch

Because of this, my programming journey started from step 1 and jumped to 5 while completely skipping over all the other steps. My thinking process was to get a portfolio going as soon as possible to get the ball rolling. I had several ideas for projects that I was excited about so it was just a matter of building them.

Mistakes of purely project-based learning:

To compensate for skipping steps 2, 3 and 4, I would google everything and use python tutor for debugging. It does work! But you are a much worse programmer. I did something similar when volunteering for a Java project. I didn’t know how to code but I would try a bunch of different things and google like crazy. Could I technically implement CRUD functionalities in Java? Yes. Did it take me twice as long? Honestly, probably three or 4 times as long. I confused frustration with learning.

Around that time I started looking at beginner friendly open source projects, but I couldn’t understand the issues themselves or the communication happening between the developers. When I pulled their code, I thought I was quick in figuring out the objective but really, I should have been faster. Even when I did understand and had an idea of what to implement, I didn’t know anything about best practices/efficient code so I figured I would slow down the project. No worries, I thought. I have my own projects to work on anyways.

After a year of pure project-based learning, I realized I couldn’t actually code. Sure I had a portfolio going the quality of my code was terrible. I didn’t know anything about best practices and my fundamentals were mediocre at best. In January of 2021, I spent 3 months on steps 2, 3 and 4, and looked back embarrassingly at one of my "grand" projects and realized it’s all procedural programming rather than my attempt at the time to implement functional programming.

My original plan used the concepts from Ultralearning to plan my learning. After re-visiting the book, I realized I skipped the drilling/attacking weakness part. It says: be good at the thing you are trying to get good at, which is obvious: become a good programmer. Except I took that as remembering syntax and understanding overall how python works. I also skipped the part of testing myself. I did use Anki once in a while but more for syntax rather than concepts. I originally planned on using the Feynman technique for all the conceptual level stuff but that also got pushed aside. After a year, it took me several more months to relearn and practice what I should have already known at that point. Eventually I found a better path and updated my plan to actually following the steps. Here they are in more detail and why the order is important.

1. Basics

I questioned a lot of the python basics that came up and was pretty sure I wouldn’t be using. I treated syntax and functions as math formulas: you need to know when to use the formula, not memorize the actual formula. But really, the early learning journey wasn’t formulas, it was the equivalent of learning numbers, operators, and arithmetic. Later on, you won’t need to memorize calculus formulas but that concept comes in much later later in the programming journey; certainly not at this point.

2. Data Structures

Some tutorials and books will have exercises but I argue you need more practice than that. This is where data structures comes in. I have a whole new appreciation for this topic and for me, this was one of the most foolproof ways to understand concepts, learn efficient code and get instant feedback. Even though you won’t use these problems on the job, you’ll certainly need to think about a problem or develop a framework for it in a similar fashion. Classes and OOP became much easier too after you struggle through a few linked Lists and Binary Search Trees.

AlgoExpert was really foundational in this. I really like the video explanations with the Space/Time Complexities and alternative solutions which I didn’t find in other websites. This shows you how to think through a problem and essentially explain your way to solving it. It’s not free but I found it more useful.

3. Small projects

The first project should force you to be a bit uncomfortable but it’s nothing you don’t know already at this point. This should be done from scratch and no help.

When following a tutorial like the Snake Apple game for your second project, don’t just code alongside and understand the concepts. Instead, code before the instructor starts coding. So as soon as a concept is explained and the instructor is about to implement it: pause the video, cover up the book, and do it yourself. The great thing about programming is that you know right away whether you figure it out or not. Use this to your advantage. If you come up with other methods, code that as well. Figure out which seems optimal, cleaner, and more efficient.

I built a Tic-Tac-Toe after a year or bad coding and later revisited after completing steps 2 and 3 and could not believe how much easier and faster it was. I also got better at handwriting pseudo code and working through my logic. This is something that is emphasized in the Odin project as well.

What I didn’t realize that up until step 3, you are simply learning how to think like a programmer. Common debugging errors, patterns, functions etc. should be at the back of your hand so you can progress much faster and eventually get better at them. I use to use python tutor immediately for debugging or understanding my problem which meant I was outsourcing my thinking.

4. Theory

Calling this a step 4 is slightly misleading; Learning some basic theory while coding small projects is probably the best time to start. This completely depends on what you’re going into. Data Science/Machine learning might mean learning Statistics. Web development in general means understanding routers, APIs, design, etc.

I did this step too late in the game and would have been really helpful before starting more advanced topics. If you don’t understand your tutorials, then you need to learn the theory behind it. For example: I wish I learned server-side overview through Mozilla docs before doing any of Corey Shafer’s Django tutorials. I didn’t remember most of it because I didn’t understand server side development then. I didn’t know how anything about requests/responses while trying to build a back-end API, I was just hoping things I googled would stick and work themselves out.

5. Bigger projects

This means building a project with frameworks or multiple libraries. You can use the same process with tutorials and really start diving into documentation at this point to understand the "why’s" and not just the "how’s". This will probably encompass everything you’ve learned in all the previous steps and can be put on your portfolio as well. Or find a project with others.

Final Thoughs

If I had seen this guide earlier, I’m not sure I would have followed it. The stubborn side of me was convinced that I knew myself best when it came to learning new skills, and was hoping to use any shortcut to get to the end result. My Ideal Coding Bootcamp follows the same logic.

Even if I was being asked for interviews, there is no way I would pass the technical portion. Even if I did pass, my first few weeks or even months would be overwhelming in a field where you’re expected to quickly catch up.

After all of this, I’m really excited to start my first batch ever at the Recurse Center! The next 12 weeks will be solidifying what I know, learning more web development theory, and working/refactoring projects. Part 2 of this post will come out when I finish up my batch or land that first job. But for now, I’m excited to join a group of people who are excited about become better programmers, and have fun while doing it.