Controlling What You Can Control: On Coding, Python, Data Science and Sports

Five is my favorite number. But this past weekend, my son’s baseball team had five obviously missed calls go against us. These calls were way beyond questionable balls and strikes, which are a part of every baseball game. You’ve probably seen games like this in any sport, where it appears like the officials are simply against a certain team’s success. Our team was rattled and frustrated.

In life right now, there’s also a lot to be rattled and frustrated about. The pandemic sweeping the world is making things very difficult in most parts of life, from educating kids to buying groceries.

Basketball Coach John Wooden, who established a dynasty at UCLA by winning 620 games in 27 seasons, had a coaching philosophy that applies in a situation such as this:

“We had no control over the many possible variations an opponent might use in a game. We did have control, total control, over preparing to execute our game. To me, it made more sense to concentrate on that.”
John Wooden

Simply, control what you can control. I’ve also heard other coaches refer to this as not worrying about the “uncontrollables.” Weather, umpires, the other team, none of it matters as much as controlling your own team’s effort and attitude.

One way I’m trying to live this philosophy out daily is by adding skills to my toolbox, rather than being frustrated and stressed out by all the changes to daily life and work. Earlier this summer, I completed the 9th and final course in the IBM Data Science Certification.

The courses were incredibly difficult at times. I learned a lot about programming and data analysis. I also realized just how far I needed to go in order to become proficient in Python, one of the main programming languages of data science. After being in the IBM program for about 5 months, I wanted something fun to work on to up my programming skills.

Thankfully, a friend recommended the book “Python Crash Course” by Eric Matthes at just the right time. I worked through the first 11 chapters, methodically moving towards the fun to begin in Chapter 12, which is titled “A Ship That Fires Bullets.”

 
Python Crash Course by Eric Matthes

Python Crash Course by Eric Matthes

 

Using VS Code as the editor, Pygame as the Python module, and Eric’s help along the way, I wrote a video game from scratch: “Alien Invasion.” The game is complete with moving aliens, a ship that fires bullets, sounds and a scoreboard.

 
Early version with thick bullets

Early version with thick bullets

 

I also learned a lot that applies to many other parts of life. Here are four things I learned about tackling a project like this…

1. IT’S NEVER TOO LATE TO START LEARNING SOMETHING NEW
For years, I’ve told my students at both VCU and UNC to get outside their comfort zones. Take a new route to class or work, have a conversation with people different from themselves, read something with a different point-of-view than they’re used to. But when it came to learning programming, it was intimidating. I truly believed I was too old to learn it at first. Then, after starting I realized that it’s nothing to be intimidated about. It wasn’t too late at all.

 
Visual Studio Code - editor window

Visual Studio Code - editor window

 


2. JUST DO SOMETHING
On a related note, there’s a lot to be said for just starting something. There’s a time to think, and then there needs to be a time to just start doing stuff. Last fall, I was feeling like data science and analytics would be a good skillset to add on to what I currently offer clients. However, I was stuck in decision paralysis by looking at different education options and thinking about what to do….there are so many recommendation lists and books. I thank my wife for knocking me out of this standstill, when she said “just start by taking one course, buying one book, and if you don’t like them, no big deal, check out something else.” No excuses anymore.

3. DEEP WORK IS TRULY THE BEST WAY TO WORK
The only way to program a video game is to embrace Cal Newport’s method of “deep work.” This is a way of working in which we tune out all distractions and clearly focus on creating value, on creating something net positive in the world. I would at times disappear into VS Code for hours at a time to get this game programmed! Deep work works.

4. IT TAKES A LOT OF SUPPORT TO CREATE
Communities such as Stack Overflow, Full Stack Python, and Python.org were so helpful in answering questions, seeing what other people had done, etc. The documentation alone on Python.org and Pygame.org was incredibly helpful. This is the first time I really experienced the power of community and open-source software.

CLOSING THOUGHTS
My game isn’t done just yet. It may never have all the features I want to include, but it is fun to play – a viable product! There's even a sticky note with many updates to make at some point.

 
Note about what’s next

Note about what’s next

 

I don’t envision launching an 8-bit computer game programming career any time soon, but I do envision using Python quite a bit in the data science and analytics projects that await. Having a little fun with gaming while learning to code well was worth the time investment.

Back to that baseball game and the rough umpiring… my son’s team ended up storming back from an 8-1 deficit to win 9-8 in a walk-off.

When we focus on controlling what we can control, beautiful things will happen.

 
Final version of game play

Final version of game play

 

Josh Carlton is the Founder of 500THz, a market research firm that delights in using data + creativity to make better customer experiences. This post also appears on LinkedIn.

josh carlton