Growing up, my mom taught me how to play chess. I enjoyed playing the game until about the 8th grade. As an adult, I have dabbled back into the game from time to time. I really enjoy the game (and all the frustrations that come with it) because it is a seemingly endless canvas of creative possibility to accomplish a goal.
If you are unfamiliar, chess is a game that is played by two players. Each player has an identical set of pieces on a game board. Each piece has a specific pattern in the way it moves and interacts with other pieces. The objective of the game is to capture the King piece of the opposing player while protecting your own. If you are interested in learning more about the game, here is a great introductory article. Understanding how the game works will help you better understand this blog post.
Setting up the Board
When I began to learn how to play chess, my first lesson was in setting up the board. Learning where each piece went in relation to the other pieces. This is similar to setting up your IDE (Integrated Development Environment, where you do your programming work) for the first time. First, you have to understand what an IDE is and how it works. Then you can begin to explore the features the IDE might have to help you. I encourage anyone getting ready to start their programming journey for the first time to try a few different ones to see which you enjoy.
Here are a few that I have enjoyed using. Keep in mind, that my two primary languages of choice are Java and Python.
- PyCharm [Python] - PyCharm is heavy on features and, in my opinion, a bit more approachable. They have out of the box templates that will help you get a quick start on your projects. Smart Assistance is a nice plus, too!
- IntelliJ [Java] - From the same folks who brought us PyCharm, IntelliJ is a similarly designed IDE for Java. I really enjoy using IntelliJ primarily because of the inclusion of Tomcat. If you are unsure of what Tomcat is, no need to worry about that now. But as you progress on your journey with Java, you will come to know Tom soon enough.
- VSCode [Various] - VSCode has quickly become a standard for beginners and experts alike, and for good reason. VSCode is an editor that works with all sorts of programming languages. This is great news! If you work in one language and decide you would like to work in another, there is no need to change tools. This is my editor of choice even though it might require a small bit of setup to get started.
After the board is setup, you can begin to think about what each piece does. How does a pawn move? What about the Bishop or Queen? What does it mean when you capture an opponents piece and how do you do that? Similarly, when you begin to program for the first time, you have to understand what pieces make up a program. Integers, strings, booleans, and collections make up some of the fundamental pieces that you will use all the time. Understanding what each piece is capable of and how they interact with the other pieces of your program is important.
There is an abundance of resources out there that can help you get started. Many of them right here, at Dev.to! In order to find a resource that might work for you, you might have to ask yourself a few questions. First, how do you like to learn? Do you like lectures? Perhaps you prefer a well written article or book? Or maybe interactive modules are more your speed. There are no bad choices here and there is no shortage of material. I encourage you to spend some time researching a teaching style that speaks to you! To help get you started, let's start right here at Dev.to with one of my favorite writers, Ali Spittel!
Your First Game
We have our board setup and we have a basic understanding of what each piece does... now what? The paralyzing fear of your first game of chess is similar to the fear of trying to think of your first programming project independent of the tutorials that have graciously gotten you here. You understand the pieces, but how do you pull it all together? How do you capture the king, exactly, and what does the even mean?
In programming, you can now begin to experiment with designing algorithms or precise steps that collectively complete a task. Similar to chess where you must begin to design a step-by-step process to win the game. This can be overwhelming, right? After all, there are a lot of steps and there is so much that can happen in between.
Next, we learn the all important concept of creating small, obtainable goals.
When the game of chess begins, it would be inadvisable to think in terms of capturing the King right away. There is simply too much to think about and too much can happen that can sideline your perfectly designed plan of attack. Instead, you might focus on a few specific pieces or a small area of the board to control. Likewise, when you begin your first project, it might not be best to think about the entire project at once. Instead, think of small tasks that need to be accomplished first. Designing functions and class structures might be something to work on first. Perhaps we want to think about how we want to store our data. Do we want to leverage an existing library or framework?
If you need some help with project ideas, you are not alone. The previously mentioned article by Ali is helpful here as well. I would like to add, for Python specifically, a programmer named Al Sweigart. He has written several books that are not only approachable but also provide enjoyable project ideas that can help get the creative juices flowing. Specifically, Automate the Boring Stuff comes highly recommended.
After you get a few games of chess under your belt, you begin to gain a better understanding of how the pieces work. You will begin to make connections you didn't think about before and as your knowledge grows, so does your creative ability to capture other pieces. Programming is not any different. As you work on and complete projects, it becomes a little bit easier each time you start on something new. You learn about how to efficiently pool resources and over time you begin to notice you have a robust toolkit full of fundamental concepts that allow you to begin to create more complex projects.
Of course, it doesn't stop there (with chess or programming)! There are unlimited avenues for improvement in both domains. There are hundreds of thousands of games from Grandmasters to study. Likewise, there is no shortage of great projects and developers to learn from. The journey is what you make of it and you get what you put in. The greatest assets to a chess player (and a developer) are creativity, patience, and focus. You cannot master any one of these topics in an abbreviated amount of time and new ideas are always right around the corner.