My random thoughts about software engineering

An aspiring software craftsman journey, By Mahmoud Ben Hassine

How Chess Made Me A Better Software Engineer

Believe it or not, this post is may be the best post I will never write in my life. At this exact point of time where I am writing the current line, I am already excited to share with you how chess made me a better software engineer and a better person in general.

I have learnt chess when I was 7. And from that time, I don’t remember a day I didn’t played a chess game. I am a chess junkie! Actually I don’t know why I am so addicted to this game, it is incredible and strange at the same time :smile:

Chess is actually more than a game, it is a whole theory. Entire books have been written on chess, chess is even being taught in schools. All this interest around the game is actually not a coincidence. This is because chess has so many benefits that can change a human being.

In this post, I will explain how chess made a better software engineer since this is my main job.

Chess improves your memory

This is my favorite one, you will see why :smile: Obviously, playing chess improves your memory. Here are at least 3 points to prove it:

  • In a given position, you try to play different variations in your mind and to visualize next moves without moving pieces on the board
  • At some level, you need to memorize opening positions in order to achieve the best middle game position
  • When you become a chess master, you have already memorized patterns of positions and you know what to play in each recognized position. This is known as chess pattern recognition.

Let me say that “Chess pattern recognition is for chess what Design pattern recognition is for software development”. And this is why this point is my favorite one :smile: When you learn to recognize chess patterns, you improve your ability to recognize when and where to apply a given design pattern.

For a scientific explanation, take a quick look at this amazing 2 minutes section from the National Geographic documentary about Susan Polgar, the top ranked female player in the world.

Chess teaches you to plan and make strategic decisions

Planning is one of the most important aspects of software engineering. If your planning is wrong, your project will fail. Obviously when you play chess, you begin by establishing a plan that you will develop during the game. Usually, even beginners establish at least two plans: A and B. A will be the first plan to apply, and if things go wrong, move to plan B. The more you play chess, the more your are able to establish plans. This is the same in software engineering, we all have already planned a second, secure plan.

Every single chess game includes a strategy, unless played by monkeys. When you begin playing chess seriously, you understand how strategy is important in a chess game. This is when you begin to learn how to establish the right strategy to play according to the game’s context (opponent, tournament, etc). This is the same in software engineering, you learn how to establish the right strategy according to the project’s context (budget, resources, client, etc)

Chess teaches you how to manage your stress

Stress, you should be familiar with this term if you have already worked in a professional environment. Of course, every person can manage work stress in a more or less efficient manner. But when you play chess, you learn how to manage your stress. Yes, chess can be stressful under certain circumstances and especially, at high level tournaments. When you play a stressful chess game, you force yourself to manage your stress in order to win the game. And this exercise makes you better at self-stress management.

Believe me, chess has dramatically changed my way of how to behave in a stressful software development project in order to win the game make the project a success and not a failure.

Chess teaches you how to think and analyse a step further

This is the most obvious point, when you play chess, you have to think how to react to your opponent’s next move, and may be the move after, etc. In software engineering, this means that you should be able to think a step further of how your software should behave when the user performs the next action. This helped me a lot at the requirement analysis, specification and test phases of software development. If the user clicks here, what should the program do? And what if he clicks there? When you begin to think many steps ahead, usually you write better software specifications and acceptance tests.

A chess game is actually a sequence of if/then/else statement, is this the language of software developers? Yes! so every software developer should be a good chess player :smile:

Chess teaches you how to organize your time

Time boxing is a key concept in agile environments. There are many techniques to learn how to time box your self in order to organize your time and be more productive.

A chess game is usually played in a finite amount of time, and you should learn how to best use your time to win the game before time runs out.

This exercise is actually very important because it improves your ability to organize your self to achieve a goal in a time frame.


Chess improves your concentration

Many chess grand masters have defined chess strength as the ability to concentrate more than you opponent. The first one who loses focus will lose the game. Chess masters are excellent at keeping focus on their game, they can look around, talk to you and at the same time be concentrated on their game!

Keeping focus is a key point in software engineering. Developers hate being disturbed. And if you play chess, you learn to improve your abilities to concentrate on your current task and to keep focus even in a noisy open space..

Chess improves your problem-solving skills

Every single position in a chess game is a problem to solve. By playing chess, you exercise yourself at problem-solving. You try to find the best move for the current position, the next best move and my be the next one, etc. So you are actually looking for many solutions to the same problem and try to evaluate the best one.

This is the same in software engineering when you are faced to a problem.

Chess teaches you how to learn from your mistakes

It is always a pleasure to win a chess game or any other game actually. But sometimes, it is a pleasure to lose too! What? Yes, sometimes you lose a game but you learn something from the mistake(s) you made and that causes you to lose the game. This is true in general life but it is more important in software development because once you make a mistake that causes your game to be lost your 100.000$ project to fail, chances are that you will never make the same mistake again :smile:

Analysing a chess game afterword is like a sprint retrospective in agile methodologies: You analyse what went well, what went wrong and how to improve it next time.

Chess teaches you to be a social person

This is not really related to software development, but it is worth including to the list of benefits. I used to play chess against my computer and that was a lot of fun :smile: I had no chance to win. You know why? Because It is stronger than me of course, but most importantly because it does not react to my motions and emotions! The human factor is extremely important in chess. Playing against a human is very different form playing against a silent machine. Interactions, motions and emotions can change a game course. Usually chess players look for clubs to play against others persons, make new friends, play online with other players, so yes, chess makes you a social person. By the way, benas is my social handle to play chess online with my friends at lichess.org and playchess.com. Feel free to add me to your social chess network.

Let me conclude by giving you some further interesting readings:

I hope I was able to convince you to learn chess in order to become a better software engineer :smile: No, just kidding..