Learning Python

I've been working on learning Python, with the help of a fun, accessible game called The Farmer Was Replaced

What’s Next is a newsletter by Will Smith about the ways today’s computers are broken and how we can fix them. If you think computers should be designed to make our lives easier and better instead of capture our attention to make giant corporations wealthier, consider subscribing or supporting the newsletter! Let's figure out what's next together!

First off, I need to apologize for the unplanned hiatus. I had a few prospective topics in a row fail to work out as newsletters, which was compounded by an incredibly busy few weeks in my day job, and a full-blown obsession with getting Linux up and running as a daily driver on my main PC. The good news is that I’m using Linux just about half the time now, and there are a lot of potential topics there. There’s so much that it’s a bit overwhelming (more on that at the end of the letter).

At the same time, and partly because it’s much more useful as a day-to-day Linux user than a Windows user, I’ve been teaching myself Python. And I’m doing it with a game. The Farmer Was Replaced is a game that helps you learn how to use Python (technically, it uses a language similar to Python, but the syntax is extremely similar) to solve a series of increasingly complicated tasks. After spending a bunch of time with it over the last few weeks, it’s also the first programming game I’ve played that actually helped me learn how to go from an blank text window to a functional program.

I’ve been trying to learn how to write useful programs since I was in college. I took CS100, where I learned to write C code on Sun workstations back in the 90s. I learned some fundamentals about writing software there that have stuck with me for 30 years—how to use loops, recursions, and basic data structures to make useless software that only ran in CLI mode on the CS department’s Sparcstations. I bailed out of the CS department after I realized that I was less interested in learning about the theoretical underpinnings of software than I was in writing functional programs for computers people actually used.

I once learned how to make an audio CD library program using CLI mode on a SparcStation just like this one. It wasn’t particularly useful software.

Later on, I wanted to build webpages, so I learned markup languages, CSS, and a little bit of Javascript in the late 90s and 2000s. When the first Arduinos came out, I found that my CS100-level knowledge of C was useful again and I’ve used that to make a handful of simple, but useful Arduino devices over the years. The ability to start with a blank page and write a program that did something I needed done was always a wall for me, but I could look at other people’s scripts and figure out how they worked and then adjust them to do what I wanted.

When companies like Zachtronics started releasing games that required programming skills to play, I tried a bunch of them. But I inevitably hit that same wall, where the problems the game presented exceeded my ability to come up with an algorithm and then turn that algorithm into code that can solve the problem . I think part of that is that Zachtronics games seemed to be tuned for people who were already programmers—people who understood how to assemble the basic pieces of a program from scratch and how to create algorithms that could solve complicated mathematical problems.

The Farmer Was Alone seems to have been made for people who want to learn to program. It’s helped me push through several of the walls I’ve hit in previous attempts, and it’s done it by building a very satisfying loop. It presents me with a problem, I figure out how to solve it, I write the code to execute that solution, and then I get to watch the code execute (and/or spend some time debugging, if I’m being honest).

It starts with a simple metaphor, some land that you—a drone farmer—need to tend. You learn how to monitor growth, cut the grass, and create loops that run based on specific conditions. Then your single tile is turned into a single row, and eventually more rows are added until you have an arbitrary-sized grid to manage and are harvesting tens of thousands of crops per minute.

The Farmer Was Replaced starts simple, with one tile to maintain. You expand your farm as you expand your abilities.

The game has a skill tree, that lets you unlock ability to grow different crops. Different crops have different requirements for optimal growth, some require tilled soil, some require watering or fertilizer, and some require that you plant them between other crops. Each of the new crops provides an additional challenge, and each one teaches you new programming and algorithmic concepts—everything from recursion and object-oriented programming to sorting and maze-solving algorithms—as you progress up the game’s tech tree.

And the game does it with a gentle difficulty curve. The problems are presented in a straightforward and incremental way and the game includes a well-developed hint system that holds your hand when you need that but also knows when to get out of its own way. (If you’re new to programming, there’s no shame in using the hint system, it includes absolutely crucial information that you’ve probably never been exposed to.) When you reach more complicated computer science topics, like sorting algorithms or maze-solving techniques, the hint system gives you the keywords that you need in order to find useful results on the web, rather than reinvent the bubble-sort wheel.

Eventually, you unlock abilities that let you perform every action that you’ve had to manually trigger with code, which let’s you write code to perform all the tasks in the game, including meta-progression stuff, like unlocking skills. The endgame for The Farmer Was Replaced is to replace the player—that is to write a program that plays the entire game. Once you’ve done that, you can optimize your speed until the game is playing itself as quickly as possible. And yes, there are leaderboards. I’m not quite ready for leaderboards yet, but I can see the path to get there!

A screenshot of my pumpkin/wood farm midway through my playthrough. It pretty consistently farms most resources now, but I haven’t gotten logic for handling upgrades in yet.

Why am I talking about this today? I think that it’s important to know how to write programs for our computers. Even if it’s just a simple script to manipulate file names on your computer or organize your photos by date taken, it’s worth taking the time to learn. The Farmer Was Replaced is the first tool I’ve used that actually helped me make that leap from a blank page of code to a working program.

What’s Next

Part of the output from being “busy at my day job” is available online to watch now. There are a handful of videos on the way, but the first of them, a look at why id software’s modern Doom games feel so fast despite running at relatively modest framerates, is live now over at PC World’s YouTube channel. Coming soon are deep dives into performance degradation on Windows over longer periods of time and the impact of system cruft on different system configurations.

I’m still a little swamped at the day job, but unless something drastic happens, the next edition of the newsletter will cover some good backup strategies that don’t involve paying Microsoft to do a half-assed job of it with OneDrive. I’ve done a bunch of research on this topic and tried out a handful of the most recommended tools and I have thoughts. I’ll be including guides for people who have some sort of network-attached storage, use simple external drives, or are just looking for a simple cloud solution.

Folks who also listen to either the Tech Pod or The Full Nerd know I’ve been half joking that Microsoft abandoning Windows 10 this fall makes 2025 a strong Year of Desktop Linux candidate. I could really use your help figuring out exactly how I should cover desktop Linux here.

I’ve got some basic guidance in the works that covers how I evaluated potential distros, what I looked for, how I chose things like desktop environments and boot management tools, etc. I’ve also got some “trip report” type coverage, which gets into what’s working well for me and what I’m having trouble with, as well as what I’m learning along the way. I’m also planning on covering some more specific topics—like getting games and other Windows software running, how you can keep your PC safe when you’re using software that doesn’t include guardrails, and collections of tips and tricks. I’d love to know what other questions you have and what topics you’d like to have included, so please mash that reply button and let me know!

Thanks for reading this far! If you enjoy the newsletter, if you sign up here, I’ll deliver one a week to your inbox. As always, What’s Next is reader-supported, so if you enjoy my work and think I should be paid for it, I’d really appreciate it if you chuck me a few bucks here.

Reply

or to participate.