A Beginner's Guide to Winning at Coding: 7 Hacks from a Mid-Career Learner

· Thoughts

If you're thinking of doing Harvard's CS50X program—or any coding course for that matter—I'm here to tell you to go for it. I’m in my mid-50s and started in April with no programming knowledge whatsoever, and I've now completed CS50X, CS50P, and CS50SQL in about three months. My journey wasn't easy, but it was incredibly rewarding. My Duck Companion for CS50X I believe in the philosophy of "Make Everything A Learning Experience." That mindset is what got me through, and it's what I want to share with you. Here are a few things I learned along the way that I think might help you.

1. Embrace Your Mistakes and Trust the Process Coding is a skill you learn largely from mistakes and troubleshooting. You're going to write code you think is perfect, but it's likely to be full of errors. Even Professor Malan makes mistakes and they don't get edited out! If you allow yourself to get stressed by this, you'll likely have a very unpleasant journey. Get used to it. It's part of the learning. When you embrace and celebrate how awful you are at coding, you'll soon start getting the right mindset.

2. Separate Logic from Language This is a core concept that is essential for any coder. There are two things you have to learn:

  • Computational Logic: This is your approach to solving the problem. It's best characterized by writing a lot of pseudocode. You'll learn what that is soon enough. I wrote a lot of pseudocode before I started the actual coding, and they were almost childlike.
  • The Language: This is the syntax of C, Python, or SQL. It's very precise—every semicolon, indent, and actual word matters. You're going to get this wrong, a lot. Don't get stressed. Trust Professor Malan when he says this is just muscle memory. You can't expect to speak a new language perfectly the first time you try.

My Pseodo codes with all its mispelled glory 3. Write a lot of debugging print statements: This is probably the single most helpful hack I adopted. I would include a lot (and I mean a lot) of print statements, especially when dealing with variables. My go-to was always: print("line number", x) The 'line number' is a quick reference so I know exactly where the code is misbehaving, and 'x' is whatever variable is being passed at that time. It's a simple trick, but it helps me understand what the computer is actually doing and what the problem is if check50 doesn't play nice. It's part of building that muscle memory. My print debugging statements. I use this everywhere.

4. Prioritize Your Resources (and build your muscle memory) When you get stuck on a problem set, don't just jump to a solution. I found that a good flow is to refer to the lecture videos, then the shorts, then the "Duck" (CS50.AI), and then this subreddit group. If all that fails, then YouTube and Google Search. My one personal rule: If I came across any code snippets, I would not copy and paste. I would take the time to type it out. It was a pain, but that's how you build muscle memory. If I used a resource too much on a problem set, I would simply delete my code and start again, even if it passed check50. That's how I learned.

5. The Active Learning Hack Midway through the course, I decided to change my flow. I started the week by attempting the problem set first and used the lectures and shorts as a resource to help me solve it. This is a more active way of learning. It worked for me, and it might work for you. I’m not saying it’s for everyone, but I wanted to put it out there.

6. Name Your Files for Future You This is a small hack I adopted. I would follow Professor Malan when he types in the codes but would name the file differently, like 'print-hello.c' or 'print-hello.py'. These are more descriptive names, and I now have a small library of codes that I can easily find and repurpose for the problem sets.

7. Have Fun Lastly, and most importantly, this is a learning experience, so have fun. The feeling of finally solving a problem set is one of the best feelings you'll have in the course. I can't tell you how many times I'm working on a problem set in a cafe or a library or even at home and nervously types in check50 and punching the air in triumph when I see those green ticks all the way to the end. It's one of the most satisfying feeling of joy I have ever experienced. If I (and so many others with similar stories) can do it, so can you. Seriously.

Reza
Make Everything A Learning Experience


← Latest