ChiPy mentorship — Blog 1
Want to see what success looks like?
It looks like the ugliest Tic Tac Toe board you’ve ever seen. It’s beautiful, isn’t it? You may not see much here, but I see: hours of work and dozens of error messages. It’s the first major portion of the ChiPy project that I’m working on as part of their mentorship program (it will eventually be an unbeatable Tic Tac Toe API in Flask).
To say that I navigated and persevered through hours of errors is something I should emphasise. (Note the emphasis?)
You see, ten months ago, this would have looked like gibberish to me:
Ten months ago, I would have thrown my hands up in the air and immediately declared: “Welp, I guess I’m not cut out for this.” I would just have closed the laptop and gone back to some other task that took less effort.
But that was ten months ago. Today: I see instructions, helpful hints, friendly suggestions!
Error messages aren’t the enemy — But you should still chase them.
The most important skill I’ve learned since beginning my trek into the unknown territory of web development: READ THE ERROR MESSAGE!
The secret to learning how to program: If you’re trying to get the thing to do the thing and it’s just simply not doing the thing that you’re trying to make it do…The error message will tell you why (hint: it’s NOT because you’re not cut out for this). Does that make sense?
So let’s break apart this error message, shall we?
- This is telling me that there’s something wrong on line 29 of my “primenums.py” file. I wonder what it is. Let’s keep reading.
2. Hmm. Ok. “NameError.” I wonder what that means. What should we do if we don’t know what something means?
Ooo, we’re in luck! It appears that we’re not the first ones to have ever had this issue. (I know what you’re thinking: “You mean my computer doesn’t just hate me? You mean this message is actually trying to help me?” Yes. Yes it is.)
This ‘NameError’ thing. It basically means that the code was working just fine until it got to this “primes” word that it had never heard of.
It’s like when you’re at a fancy restaurant and the waiter asks if you’d like to try today’s special: “choucroute garnie.” You instantly get that deer-in-the-headlights look as you search through your brain, trying to figure out what the heck he just asked you. You quickly come to the conclusion that you’ve never heard of this thing “choucroute garnie,” so you let him know he needs to define it for you. You’ve just experienced a “NameError”: exactly what your computer’s error message is trying to tell you that it’s experiencing.
That “NameError” thing sounds pretty fixable to me. Let’s just give our computer the definition of “primes” so that it doesn’t panic (like you did at the restaurant) when it comes across that word.
Whew. That wasn’t as scary as I thought it would be.
This shouldn’t be so hard; Mama always told me I was smart…
If you couldn’t tell, I’m trying to get really awesome at Python. And part of getting really awesome at something is pushing through the gut-wrenching pain of being really bad at it for awhile.
In order to help me get really awesome: I’ve been building some super basic, beginner things. My mentor suggested I work on a “prime factors” method to get more comfortable with coding in Python. I’m still stuck debugging an issue, but I haven’t given up yet (and I won’t). I’m going to Google, Google, bang my head against the keyboard, and then Google some more. If that approach fails, I’ll ask a more experienced Python-er for guidance. (That’s not cheating; it’s how you learn to program.)
Up next: “Completing my Tic Tac Toe Flask API, or: How I learned to stop worrying and love the frustration.” Stayed tuned…