The Principles of Chess and Software

The Principles of Chess and Software

Ian Carroll

August 09, 2017

I’ve been playing a lot of chess as part of my apprenticeship at 8th Light. It helps me step away when I get bogged down in a software problem. When I return to the code, I see it from a fresh angle and solve the problem more quickly.

Chess is a deep game. There are about 10¹²⁰ games of chess possible. That’s more than just a lot of games. It’s a whole heap of a lot of games!

Like really.

An unimaginable number of games.

To get some perspective, There are only 10¹⁴ cells in your body and 10¹⁸ grains of sand on all of Earth’s beaches. There are only 10⁸² atoms in the entire visible universe. And there have only been 10²⁷ milliseconds since the big bang. This means that if you were to multiply every atom in the universe by every millisecond in the universe, there are still about 100 billion times more chess games than that!

Point being, a person can’t see every possible move. Likewise software crafters can’t anticipate every change the software will need. Chess may be deep, but it’s nothing in comparison to the march of history and market economies. So how do we make good decisions in chess and software if we can’t know the outcome? We rely on principles.

At the start of a chess game, you want to get your knights and bishops out and active, you want a pawn near the center of the board, and you want your king in a safe place. This allows you room to maneuver, gives you tactical opportunities in the middle game, and protects you from unanticipated tricks your opponent would otherwise pull. This is the key to my chess strategy. I am currently undefeated in the office, and I’m surrounded by some very smart people. It’s not about being perfect. I blunder queens and still end up winning. The key is a good set of principles.

But truth be told, I’m not all that good at chess. I might be undefeated at the office, but online players beat me regularly. There is a gap between the principles and my practice. That doesn’t stop me. There's a lot I can learn from more principled players. Every time I play, I observe their methods. I reflect on the games I've played, apply lessons learned, and become progressively stronger at my game. I discover more and more what it means to be principled at chess.

Likewise in software, we at 8th Light have a set of principles we live by that are designed to give us maximal freedom to change code at minimal exposure to the unanticipated snags that are endemic to working in a field as complex as ours. But just as I have much to learn about chess, I have even more to learn about software. I am not an expert in these principles just because I work here. I have to learn from continual practice and refinement exactly how to apply them effectively.

At 8th Light, we are committed to:
1. Well-Crafted Software
2. Steadily Adding Value
3. A Community of Professionals
4. Productive Partnerships

Well-Crafted Software is how we show our strength.

In modern chess there is a formalized rating system. I can boast all I want about how awesome I am at chess, but my actual playing strength can be described by a number. As I write this sentence, I am rated 1024 on five-minute blitz games at chess.com. This means that if someone is rated 800, I'll almost certainly win. If someone is rated 1350, I've got just about no chance. Professional chess masters have ratings above 2200. But software has no such formalized rating system. So we have to describe our strength the way chess masters did before the rating system. We have to let our game speak for itself.

Well-Crafted Software means we let our work speak for itself so our words will not outstrip our deeds. We don’t stop there. Even if we aren’t experts at everything, we continually master other technologies. We are ravenously curious about what’s out there, and are courageous enough to master what’s unfamiliar if it’s the best solution to a client’s need. We take responsibility for our code by making sure it’s thoroughly tested. Defects are not something we are prepared to live with. We keep our code clean and well organized so that it can be changed in whatever way conditions demand.

Right now, I am learning exactly how to construct a system that can be changed easily. I am learning the hard way that I have to keep responsibilities separate and interactions between parts of the code as simple as possible. That way I can easily plug and play parts as needed. Tests help, but even writing a clean maintainable test suite is challenging. Still, I won’t get any better by shying away from it. So onward I blunder, and learn as I go.

Steadily Adding Value means that we aim for solid results over quick fixes.

In chess, you may be tempted to bring your queen out early. This is a quick fix. The queen is the most mobile piece on the board and has many tricks up her sleeve. If you’re lucky you might sucker-punch your opponent and pull an early win, but if your opponent is unimpressed by this shock-and-awe tactic, it will backfire. Because the queen is the most mobile piece, she is also the most valuable piece. The rest of the pieces will push her around, and either trap her or waste your moves as you are forced to save her again and again. Moving the queen out early gives a savvy opponent the advantage in the middle game.

Likewise, in software we don’t pull all-nighters to get the source code ready in a sleep-deprived delirium. That makes a quick fix now, but it will become a nightmare in the middle game. We work at a sustainable pace and build solid solutions. We commit to our estimates and do not promise what we can’t deliver. We take responsibility for our commitments and communicate issues as soon as they arise. We actively search for solutions and we learn from our mistakes. This makes us better and better at delivering quality. We steadily add value to the project and our ability to deliver future projects.

This is also a challenge for me. If I am running behind schedule I have to fight the urge to work late to get things back on track. Instead, I have to take a step back and reflect on what I can use to work more efficiently. Maybe I need to use a new automated tool, maybe I need to work on my mind set, or maybe I need to manage scope and make better estimates. Failures like these only remain so if I never reflect on what went wrong and don’t strive to improve. Software is a game of continual reflection and improvement. I’m learning that reflection takes courage to face.

We cultivate A Community of Professionals.

In chess, I am only as good as the people I play against. I will not improve if there are no good players to learn from. And if I am the only one who knows how to play, I'll never be any good. What does it matter if I'm the best at a game only I know how to play? If I'm the only chess player in the world, could I even claim to be a chess player? Could I even claim that chess is an actual game? That's why I bring in chess books to the office and offer coaching for anyone who wants it. If I encourage others to play chess, and they play it in a way that is unique to their own point of view, I will improve. And since a game isn't a game if nobody plays it, chess itself is strengthened when I help others to learn it.

Likewise, The more software crafters there are in the world, the better crafters we will be, and the more value there will be in our craft. So 8th Light embraces diversity and differences of opinion. We teach anyone who wants to learn. The more people who can do what we do, the faster and better our solutions become. Differing perspectives allow us to approach technical challenges from many angles and find better solutions faster. We prefer open source tools for the same reason. When code is open, everyone can help improve it. Bugs and security flaws are more easily identified. By cultivating a community of professionals, we improve as crafters. And our software gains greater value.

Contributions to the community can be anything. They include giving lightning talks, facilitating events, mentoring even while being mentored, and writing blog articles about chess and software. The key is a desire to give back and an excitement to share. But sharing is only half the story. Right now I am learning how to ask for help and how to make the most out of the help I get. It’s natural for me to want to prove my worth by taking care of everything myself. I did spend a lot of time before the apprenticeship learning entirely on my own, but there is so much time I can save if I ask the right person the right question. Our community is a tool at my disposal. I am still learning how to harness its power.

Finally, we foster Productive Partnerships.

It could be seen as odd to relate chess, a zero-sum competitive game, with the collaborative process of working with a client, but I don't view chess as a zero-sum competitive game. Winning or losing a chess game produces zero consequences besides the ones I make up for myself. Ultimately, chess is a bunch of inanimate sculptures set up to act in an artificially limited fashion that in no way reflects the reality of true competition. For true zero-sum competition, the solution to chess is to throw the board aside and punch your opponent in the face. All 10¹²⁰ games solved.

What makes chess special to me is the conversation you have with the other player. It's a dance, a riddle and an exploration of beautiful patterns that requires each player to understand themself, the board and their partner in an unfolding story that unites all three to create something new: something that, because of the vastness of possible games, has never happened before, and will never happen again. To me, chess is cooperative.

Chess is also game of perfect knowledge. If anyone wants to know what is happening in a game of chess, the whole board and all of the pieces are open to view. But the reality is still far from this. Despite being completely transparent, chess does not make a great spectator sport. The schemes and instincts of chess masters are happening at a level of understanding far deeper than a casual enthusiast's. That's one reason that if I see a newer player leaving a piece out to hang, I'll mention it. It gives them a chance to notice their blind spots and see the board more clearly.

Like chess, fostering productive partnerships starts with being open to view. In addition, presenting the deeper design challenges of software without concealing or embellishing the truth allows our clients to understand the risks and make better decisions. It's also a two-way street. Software is not the only human endeavor that is deep and complex. We respect that by striving to understand our clients’ business needs too. The goal is to work together as a team to build software that really will deliver value. We do that by going out of our way to understand what's needed and to tell the truth of what we see.

It’s so easy to tell a client what they want to hear. Who likes to disappoint people? But if there is a problem, I have be courageous enough to communicate it right away. It’s far worse to give an ugly surprise later than to suffer some momentary discomfort now. And if I and the client both know the problem beforehand, there’s a chance to solve it. But if I over-promise and hide problems, they only get discovered when there’s nothing we can do about them.

That being said, I am proud of my ability to empathize with clients. I can’t work on software unless I understand how it’s going to be used and what benefit it’s supposed to have. So it’s not like I’m bad at everything. I just have a lot to learn, which is awesome. It means that there’s a whole new software frontier out here for me to discover. And I have some great guides at 8th Light.

By adhering to these principles, we make sure that we deliver software that works well, is adaptable, and is optimized to the needs of our client’s circumstances, even if we cannot anticipate everything the future holds. As an apprentice, I am continually refining and improving my understanding of these principles. Like any good set of chess principles, they are cultivated from practice. I’m excited to be cultivating 8th Light’s principles for myself. Now if you’ll excuse me, I have to get back to blundering.