10 Reasons Why Solving Code Puzzles Makes You Smarter

5/5 - (2 votes)

In this post, I will give you 10 reasons for puzzle-based learning. There is robust evidence in psychological science for each of these reasons. Yet, no existing learning system lifts code puzzles to first-class citizens. To change that, I developed the Finxter App and published the programming textbook “Coffee Break Python: 50 Workouts to Kickstart Your Rapid Code Understanding in Python”. In brief, these are the 10 reasons for puzzle-based learning:

1. Overcome the Knowledge Gap

The great teacher Socrates delivered complex knowledge by asking a sequence of questions. Each question built on answers to previous questions provided by the student. This more than 2400 year old teaching technique is still in widespread use today. A good teacher opens a gap between their knowledge and the learner’s. This knowledge gap makes the learner aware that they do not know the answer to a burning question. This creates a tension in the learner’s mind. To close this gap, the learner awaits the missing piece of knowledge from the teacher. Better yet, the learner starts developing their own answers. The learner craves knowledge.

Santorinni Greece during Daytime

Code puzzles open an immediate knowledge gap. When looking at the code, you first do not understand what the puzzle means. The puzzle’s semantics are hidden. But only you can transform the unsolved puzzle into a solved one. Look at this riddle:

“What pulls you down and never lets go?”

Can you feel the tension? Opening and closing a knowledge gap is a very powerful method for effective learning.

(By the way, the answer is Gravity.)

Bad teachers open a knowledge gap that is too large. The learner feels frustrated because they cannot overcome the gap. Suppose you are standing before a river that you must cross. But you have not learned to swim, yet. Now, consider two rivers. The first river is the Colorado River that carved out the Grand Canyon–quite a gap. The second river is Rattlesnake Creek. The fact that you have never heard of this river indicates that it is not too big of an obstacle. Most likely, you will not even attempt to swim through the big Colorado River. But you could swim over the Rattlesnake if you stretch your abilities just a little bit. You will focus, pep-talk yourself, and overcome the obstacle. As a result, your swimming skills and your confidence will grow a little bit.

Puzzles are like the Rattlesnake–they are not too great a challenge. You must stretch yourself to solve them, but you can do it if you go all-out.

Constantly feeling a small but non-trivial knowledge gap creates a healthy learning environment. Stretch your limits, overcome the knowledge gap, and become better–one puzzle at a time.

2. Embrace the Eureka Moment

Humans are unique because of their ability to learn. Fast and thorough learning has always increased our chances of survival. Thus, evolution created a brilliant biological reaction to reinforce learning in your body.

Your brain is wired to seek new information; it is wired to always process data, to always learn.

Men's Gray Crew Neck Shirt

Did you ever feel the sudden burst of happiness after experiencing a eureka moment? Your brain releases endorphins, the moment you close a knowledge gap. The instant gratification from learning is highly addictive, but this addiction makes you smarter. Solving a puzzle gives your brain instant gratification. Easy puzzles open small, hard puzzles, which open large knowledge gaps. Overcome any of them and learn in the process.

3. Divide and Conquer

Learning to code is a complex task. You must learn a myriad of new concepts and language features. Many aspiring coders are overwhelmed by the complexity. They seek a clear path to mastery.

Full Frame Shot of Abstract Pattern

People tend to prioritize specific activities with clearly defined goals. If the path is not clear, we tend to drift away toward more specific paths.
Most aspiring coders think they have a goal: becoming a better coder. Yet, this is not a specific goal at all. So what is a specific goal? Unfortunately for many of us, the goal “Watching Game of Thrones after dinner, Series 2 Episode 1” is as specific as it can be. Due to the specificity, watching Netflix is more powerful than the fuzzy path of learning to code. Hence, watching Netflix wins the battle for attention too often.

As any productivity expert tells you: break a big task or goal into a series of smaller steps. Finishing each tiny step brings you one step closer to your big goal. Divide and conquer makes you feel in control, pushing you one step closer toward mastery. You want to become a master coder? Break the big coding skill into a list of sub-skills–understanding language features, designing algorithms, reading code–and then tackle each sub-skill one at a time.

Code puzzles do this for you. They break up the huge task of learning to code into a series of smaller learning units. The student experiences laser focus on one learning task such as recursion, the for loop, or keyword arguments. Don’t worry if you do not understand these concepts yet–after working through this book, you will. A good code puzzle delivers a single idea from the author’s into the student’s head. You can digest one puzzle at a time. Each puzzle is a step toward your bigger goal of mastering computer science. Keep solving puzzles and you keep improving your skills.

4. Improve From Immediate Feedback

As a child, you learned to walk by trial and error–try, receive feedback, adapt, and repeat. Unconsciously, you will minimize negative and maximize positive feedback. You avoid falling because it hurts, and you seek the approval of your parents. But not only organic life benefits from the great learning technique of trial and error. In machine learning, algorithms learn by guessing an output and adapting their guesses based on their correctness. To learn anything, you need feedback such that you can adapt your actions.

Girl Wearing White Clothes Walking on Pavement Road

However, an excellent learning environment provides you not only with feedback but with immediate feedback for your actions. In contrast, poor learning environments do not provide any feedback at all or only with a large delay. Examples are activities with good short-term and bad long-term effects such as smoking, alcohol, or damaging the environment. People cannot control these activities because of the delayed feedback. If you were to slap your friend each time he lights a cigarette–a not overly drastic measure to safe his life–he would quickly stop smoking. If you want to learn fast, make sure that your environment provides immediate feedback. Your brain will find rules and patterns to maximize the reinforcement from the immediate feedback.

The Finxter App offers you an environment with immediate feedback to make learning to code easy and fast. Over time, your brain will absorb the meaning of a code snippet quicker and with higher precision this way. Learning this skill pushes you toward the top 10% of all coders. There are other environments with immediate feedback, like executing code and checking correctness, but puzzle-based learning is the most direct one: Each puzzle educates with immediate feedback.

5. Measure Your Skills

You need to have a definite goal to be successful. A definite goal is a powerful motivator and pushes you to stretch your skills constantly. The more definite and concrete it is, the stronger it becomes. Holding a definite goal in your mind is the first and foremost step toward its physical manifestation. Your beliefs bring your goal into reality.

Think about an experienced Python programmer you know, e.g., your nerdy colleague or class mate. How good are their Python skills compared to yours? On a scale from your grandmother to Bill Gates, where is your colleague and where are you? These questions are difficult to answer because there is no simple way to measure the skill level of a programmer.
This creates a severe problem for your learning progress: the concept of being a good programmer becomes fuzzy and diluted. What you can’t measure, you can’t improve. Not being able to measure your coding skills diverts your focus from systematic improvement. Your goal becomes less definite.

Red Pencil on Gold Metal Rulers

So what should be your definite goal when learning a programming language? To answer this, let us travel briefly to the world of chess, which happens to provide an excellent learning environment for aspiring players. Every player has an Elo rating number that measures their skill level. You get an Elo rating when playing against other players–if you win, your Elo rating increases. Victories against stronger players lead to a higher increase of the Elo rating. Every ambitious chess player simply focuses on one thing: increasing their Elo rating. The ones that manage to push their Elo rating very high, earn grand master titles. They become respected among chess players and in the outside world.

Every chess player dreams of being a grandmaster. The goal is as definite as it can be: reaching an Elo of 2400 and master level. Thus, chess is a great learning environment–every player is always aware of their skill level. A player can measure how decisions and habits impact their Elo number. Do they improve when sleeping enough before important games? When training opening variants? When solving chess puzzles? What you can measure, you can improve.

The main idea of our book Coffee Break Python, and the associated learning app, is to transfer this method of measuring skills from the chess world to programming. Suppose you want to learn Python. The Finxter website assigns you a rating number that measures your coding skills. Every Python puzzle has a rating number as well, according to its difficulty level. You play against a puzzle at your difficulty level: The puzzle and you will have more or less the same Elo rating so that you can enjoy personalized learning. If you solve the puzzle, your Elo increases and the puzzle’s Elo decreases. Otherwise, your Elo decreases and the puzzle’s Elo increases. Hence, the Elo ratings of the difficult puzzles increase over time. But only learners with high Elo ratings will see them. This self-organizing system ensures that you are always challenged but not overwhelmed, while you constantly receive feedback about how good your skills are in comparison with others. You always know exactly where you stand on your path to mastery.

6. Individualized Learning

The educational system today is built around the idea of classes and courses. In these environments, all students consume the same learning material from the same teacher applying the same teaching methods.
This traditional idea of classes and courses has a strong foundation in our culture and social thinking patterns. Yet, science proves again and again the value of individualized learning. Individualized learning tailors the content, pace, style, and technology of teaching to the student’s skills and interests. Of course, truly individualized learning has always required a lot of teachers. But paying a high number of teachers is expensive (at least in the short term) in a non-digital environment.

Person With Body Painting

In the digital era, many fundamental limitations of our society begin to crack.
Compute servers and intelligent machines can provide individualized learning with ease. But with changing limitations, we must adapt our thinking as well.
Machines will enable truly individualized learning very soon; yet society needs time to adapt to this trend.

Puzzle-based learning is a perfect example of automated, individualized learning. The ideal puzzle stretches the student’s abilities and is neither boring nor overwhelming. Finding the perfect learning material for each learner is an important and challenging problem. Finxter uses a simple but effective solution to solve this problem: the Elo rating system. The student solves puzzles at their individual skill level. Our programming textbook “Coffee Break Python” and the book’s web backend Finxter pushes teaching toward individualized learning.

7. Small is Beautiful

The 21st century has seen a rise in microcontent. Microcontent is a short and accessible piece of valuable information such as the weather forecast, a news headline, or a cat video. Social media giants like Facebook and Twitter offer a stream of never-ending microcontent. Microcontent is powerful because it satisfies the desire for shallow entertainment. Microcontent has many benefits: the consumer stays engaged and interested, and it is easily digestible in a short time. Each piece of microcontent pushes your knowledge horizon a bit further. Today, millions of people are addicted to microcontent.

However, this addiction will also become a problem to these millions. The computer science professor Cal Newport shows in his book “Deep Work” that modern society values deep work more than shallow work. Deep work is a high-value activity that needs intense focus and skill. Examples of deep work are programming, writing, or researching. Contrarily, shallow work is every low-value activity that can be done by everybody (e.g., posting the cat videos to social media). The demand for deep work grew with the rise of the information society; at the same time, the supply stayed constant or decreased, e.g., because of the addictiveness of shallow social media. People that see and understand this trend can benefit tremendously. In a free market, the prices of scarce and demanded resources rise. Because of this, surgeons, lawyers, and software developers earn $100,000 per year and more. Their work cannot easily be replaced or outsourced to unskilled workers. If you are able to do deep work, to focus your attention on a challenging problem, society pays you generously.

adult, Asian, bald

What if we could marry the concepts of microcontent and deep work?

This is the promise of puzzle-based learning. Finxter offers a stream of self-contained microcontent in the form of hundreds of small code puzzles. But instead of just being unrelated microcontent, each puzzle is a tiny stimulus that teaches a coding concept or language feature. Hence, each puzzle pushes your knowledge in the same direction.

Puzzle-based learning breaks the bold goal, i.e., reach the mastery level in Python, into tiny actionable steps: solve and understand one code puzzle per day. While solving the smaller tasks, you progress toward your larger goal.
You take one step at a time to eventually reach the mastery level.

A clear path to success.

8. Active Beats Passive Learning

Robust scientific evidence shows that active learning doubles students’ learning performance. In a study on that matter, test scores of active learners improve by more than one grade compared to their passive learning fellow students. Not using active learning techniques wastes your time and hinders you in reaching your full potential in any area of life. Switching to active learning is a simple tweak that will instantly improve your performance when learning any subject.

Girls on Desk Looking at Notebook

How does active learning work?

Active learning requires the student to interact with the material, rather than simply consuming it. It is student- rather than teacher-centric. Great active learning techniques are asking and answering questions, self-testing, teaching, and summarizing. A popular study shows that one of the best learning techniques is practice testing. In this learning technique, you test your knowledge even if you have not learned everything yet. Rather than “learning by doing”, it’s “learning by testing”.

However, the study argues that students must feel safe during these tests. Therefore, the tests must be low-stake, i.e., students have little to lose. After the test, students get feedback about the correctness of the tests. The study shows that practice testing boosts long-term retention of the material by almost a factor of 10. As it turns out, solving a daily code puzzle is not just another learning technique–it is one of the best.

Although active learning is twice as effective, most books focus on passive learning. The author delivers information; the student passively consumes the information. Some programming books include active learning elements by adding tests or by asking the reader to try out the code examples. Yet, I always found this impracticable while reading on the train, on the bus, or in bed. But if these active elements drop out, learning becomes 100% passive again.

Fixing this mismatch between research and common practice drove me to write this book about puzzle-based learning. In contrast to other books, our programming textbook makes active learning a first-class citizen. Solving code puzzles is an inherent active learning technique. You must develop the solution yourself, in every single puzzle. The teacher is as much in the background as possible–they only explain the correct solution if you couldn’t work it out yourself. But before telling you the correct solution, your knowledge gap is already ripped wide open. Thus, you are mentally ready to digest new material.

To drive this point home, let me emphasize this argument again: puzzle-based learning is a variant of the active learning technique named practice testing. Practice testing is scientifically proven to teach you more in less time.

9. Make Source Code a First-class Citizen

Each grandmaster of chess has spent tens of thousands of hours looking into a near infinite number of chess positions. Over time, they develop a powerful skill: the intuition of the expert. When presented with a new position, they are able to name a small number of strong candidate moves within seconds. They operate on a higher level than normal people. For normal people, the position of a single chess piece is one chunk of information. Hence they can only memorize the position of about six chess pieces. But chess grand masters view a whole position or a sequence of moves as a single chunk of information. The extensive training and experience has burned strong patterns into their biological neural networks. Their brain is able to hold much more information–a result of the good learning environment they have put themselves in.

What are some principles of good learning?

Let us dive into another example of a great learning environment–this time for machines. Recently, Google’s artificial intelligence AlphaZero has proven to be the best chess playing entity in the world. AlphaZero uses artificial neural networks. An artificial neural network is the digital twin of the human brain with artificial neurons and synapses. It learns by example much like a grandmaster of chess. It presents itself a position, predicts a move, and adapts its prediction to the extent the prediction was incorrect.

Chess and machine learning exemplify principles of good learning that are valid in any field you want to master. First, transform the object to learn into a stimulus that you present to yourself over and over again. In chess, study as many chess positions as you can. In math, make reading mathematical papers with theorems and proofs a habit. In coding, expose yourself to lots of code. Second, seek feedback. Immediate feedback is better than delayed feedback. However, delayed feedback is still much better than no feedback at all. Third, take your time to learn and understand thoroughly. Although it is possible to learn on-the-go, you will cut corners. The person who prepares beforehand always has an edge. In the world of coding, some people recommend learning by coding practical projects and doing nothing more. Chess grandmasters, sports stars, and intelligent machines do not follow this advice. They learn by practicing isolated stimuli again and again until they have mastered them. Then they move on to more complex stimuli.

Grayscale Photo of Computer Laptop Near White Notebook and Ceramic Mug on Table

Puzzle-based learning is code-centric. You will find yourself staring at the code for a long time until the insight strikes. This creates new synapses in your brain that help you understand, write, and read code fast. Placing code in the center of the whole learning process creates an environment in which you will develop the powerful intuition of the expert.

Maximize the learning time you spend looking at code rather than at other stimuli.

10. What You See is All There is

My professor of theoretical computer science used to tell us that if we only stare long enough at a proof, the meaning will transfer into our brains by osmosis. This fosters deep thinking, a state of mind where learning is more productive. In my experience, his staring method works—but only if the proof contains everything you need to know to solve it. It must be self-contained.

A good code puzzle beyond the most basic level is self-contained. You can solve it purely by staring at it until your mind follows your eyes—your mind develops a solution based on rational thinking. There is no need to look things up. If you are a great programmer, you will find the solution quickly. If not, it will take more time but you can still find the solution—it is just more challenging.

My gold standard was to design each puzzle such that it is mostly self-contained. However, to deliver on the book’s promise of training your understanding of the Python basics, puzzles must introduce syntactical language elements as well. But even if the syntax in a puzzle challenges you, you should still develop your own solutions based on your imperfect knowledge. This probabilistic thinking opens the knowledge gap and prepares your brain to receive and digest the explained solution. After all, your goal is long-term retention of the material.

Coffee Break Python

What do you think of puzzle-based learning? Please share your thoughts and leave a comment below.

2 thoughts on “10 Reasons Why Solving Code Puzzles Makes You Smarter”

    • Thanks for commenting. Project Euler is a great resource as well. But their code challenges are more open tests like “generate a list with 10 subsequent elements”, etc. Finxter focuses on code puzzles where you have to read and understand source code.

Comments are closed.