If you search for Richard Feynman’s methods, you’ll likely stumble upon the famous Feynman Technique, a brilliant framework for learning new concepts by explaining them to a child.
But there’s another, lesser-known Feynman method. It was jokingly coined by his colleague, physicist Murray Gell-Mann, who said that Feynman’s process for solving problems looked like this:
**1. Write down the problem.
- Think very hard.
- Write down the solution.**
At first glance, this sounds like a meme. "Draw the rest of the owl," right? But if we look closer at this "Feynman Algorithm," it actually perfectly outlines the lifecycle of debugging and writing software.
Let’s break down how this tongue-in-cheek algorithm can actually help you become a better developer.
Step 1: Write down the problem ✍️
Albert Einstein supposedly said, "If I had an hour to solve a problem, I'd spend 55 minutes thinking about the problem and 5 minutes thinking about solutions."
In programming, we often skip this. We see an error log and immediately start changing variables and refreshing the browser. But "writing down the problem" forces you to define exactly what is going wrong.
Bad Problem Definition:
"The login page is broken."
Good Problem Definition:
"When a returning user tries to log in with Google OAuth, the API returns a 500 server error, but only on mobile Safari."
When you write the problem down clearly, the scope narrows. Half the time, simply defining the problem accurately reveals the solution.
Step 2: "Think very hard" 🧠
This is the punchline of the joke. To outsiders, Feynman just stared at a chalkboard and magically found the answer. But "thinking very hard" doesn't mean having a massive IQ; it means engaging in structured, focused analysis.
How do developers "think very hard"?
We Rubber Duck: We explain the code line-by-line to an inanimate object (or a patient coworker).
We Isolate: We comment out chunks of code to see if the bug still happens. We narrow down the variables.
We Step Away: Sometimes, "thinking very hard" means taking a shower or going for a walk. Your brain's "diffuse mode" keeps working on the problem in the background.
"Thinking very hard" means resisting the urge to copy-paste the first Stack Overflow answer you see without understanding why it works.
Step 3: Write down the solution 💡
You figured it out! You fixed the bug! Time to push to production and go home, right? Not quite.
In the context of coding, "writing down the solution" means three things:
Writing clean code: Making sure your solution isn't just a hacky workaround, but a readable, maintainable piece of logic.
Writing tests: Proving that your solution actually works and ensuring it won't break in the future.
Writing documentation: Leaving comments explaining why you did what you did.
Your future self (and your team) will thank you when they read a comment like:
// Using a Set here instead of an Array because checking for duplicates was causing a massive performance bottleneck.
Final Thoughts
The Feynman Algorithm might have started as a joke among Nobel Prize-winning physicists, but it’s remarkably practical for software engineers.
Next time you are stuck on a nasty bug, don't just start mashing the keyboard. Stop. Write the problem down. Take a walk to think very hard. And when you solve it, document it for the next developer.
Let me know in the comments how you practice "thinking very hard" when you are stuck on a tricky coding problem!
Top comments (0)