Perfection vs Progress
Greetings Foolish Ones!
This is my first post on my new journey in programming and blogging. My goal is to create a log of my programming sessions to help me stay focused and committed to finishing real working projects. I've dabbled in programming since I was in high school, but I've always found myself failing to ever finish any projects I've started. Usually this is due to me realizing the scope of the project is outside of my skill set, or more often I just get bored and start thinking up a new project. It's a problem I have noticed has creeped into my everyday life as well. I have trouble finishing video games because I always end up restarting if things don't pan out exactly as I planned. I'm sure other people face this problem too. Start a new hobby, obsessively learn everything you can about it, buy a few hundred dollars worth of equipment or materials, annnnd you're done and ready for the next new thing. It's frustrating, and I want to help myself (and hopefully others) to break the cycle. In these blog posts, I'm going to attempt to break down my thoughts into small bite size ideas. If possible, I'll be encapsulating these ideas into quotes that I've come across. So without further ado.
"Perfection is the enemy of Progress" - Winston Churchill
I've been practicing programming for the past 10+ years, but I'd likely fail any interview for even the lowest level programming jobs out there. I know the basics of variables, functions, loops, and everything else you can learn online pretty easily. But I've never actually programmed anything beyond simple apps like a dice roller or text based adventure. I've never finished a project that I then went back and used for something in my daily life. I caught myself recently trying to learn C. It's like a dopamine hit for me when I start to learn something new. But that hit quickly dies off as soon as I develop a basic understanding of what I'm learning, and the drive to learn further dies almost immediately.
I think a lot of the interest I have when it comes to learning new things comes from a deeper desire to know things better than most people. I am not a genius, but I hate feeling like I don't know something, especially when I'm engaged with that topic or discussing it with other people. I have a perfectionist mindset that hates to be wrong. This often causes me to iterate through whatever I'm learning until I burn myself out on the basics. I'm afraid to move forward if I feel I haven't completely mastered what is already in front of me. In this way, I prevent myself from progressing. It is comforting and easy for me to master the basics, as it requires very little effort while also providing a very high return on knowledge.
For my first real coding project, I'm going to design a deck builder for the game Magic the Gathering, specifically for the Commander format. For those who haven't played, Magic is a high fantasy game of creatures and spells that you cast against your opponents. The object of the game is to bring your opponent's life points to 0. In Commander, you normally have 3 opponents, each with 40 life points. Each player picks a special creature card as their commander, who they can cast at any point in the game. A Commander deck is made up of 99 cards, plus the commander, for a total of 100 cards. A Commander deck can only contain one copy of any specific card (with exception to certain cards like Basic Lands). Commander decks all share common categories for specific gameplay mechanics. In general, these are Ramp, Card Draw, and Removal. Anyone who plays Commander or Magic will understand these terms, but to anyone who doesn't play, just think of them as categories that we need to fulfill to make a good deck. So to start, we need to create a program that contains a variable for our 100 card deck. Then we need to create 3 categories, and decide how many cards we want for each category. As we add new cards to the deck, we can assign them to one or more categories. We want a minimum number of cards for each category, but no maximum. We also need to make sure the deck contains enough land cards (resource generation).
For my program, I'm choosing the following template
1 commander, 39 lands, 15 ramp, 20 card draw, 25 removal
At this point you might already see some issues. Magic players will see that you can only choose 1 commander, a rule that has been changed with the introduction of partner commanders. They will also likely disagree with the categories and number of cards assigned to each.
Now the programmers will argue to make these variables that the user can define. They'll also likely want to make the program scaleable, allowing for additional categories and user defined templates.
As a beginner, we need to remember to limit ourselves while learning the ropes. This project does not need to be perfect. It's ok to hard code variables and limit user interaction. We just need something that works right now. One of the biggest mistakes I think I made when learning programming was watching other programmers on YouTube. You'll quickly burn out or lose heart in a project when you watch someone else creating code using best practices while typing at 80 words per minute. My best advice for others looking to start programming is to use websites like w3schools, and work through the tutorials. I'll put the link below.
W3Schools Python TutorialI found that watching YouTube videos usually ends up with me just copying code and hitting run, rather than actually learning what I'm doing as I go through each step. Reading tutorials, running the code, and tinkering with it really helps develop a better understanding of what's going on under the hood.
So to finish this first post, I want to put together the first iteration of my code, which I'll post alongside this blog post. It won't be perfect, but it will be the beginning of something new. In my next post, I'll go over the next section of the program I want to develop, and tie in another concept. Until then.