Technology & Leadership
Rakia Ben Sassi
Freelance Senior Software Engineer | Google Developer Expert (Angular) | Speaker & Content Creator
3 Tips To Solve Coding Problems Like an Expert
Ask the questions, do root cause analysis, and more
“How can I get better at solving problems? I understand?JavaScript?now, but I can’t really solve problems or understand any complicated?JavaScript code,” asked me recently young developer on my contact list.
Problem-solving is a critical element of our careers because writing great code is a creative art, and to be a great developer, you need to be a creative problem solver.
“The biggest mistake I see new programmers make is focusing on learning syntax instead of learning how to solve problems.” - V. Anton Spraul
Sometimes we get afraid or uncomfortable when faced with a difficult challenge and wish it would go away. We may feel that we have to come up with an answer and get frustrated when we’re not sure how to find it.
Being confronted with a problem is an opportunity to improve ourselves, rather than a problem in itself. And although I see that this skill comes with time and practice, I’ve also a firm belief that we don’t need to wait for years to master it. I’ve worked with many junior developers who were better problems solver than their older fellows.
Luckily for us, there are plenty of methods available to solve whatever difficulties come at us. In this article, I’ll break down three techniques that help us untangle any complication like an expert. But before we start, let’s see the differences between how an expert and a novice tackle problems.
Expert Thinking vs. Novice Thinking
“Most people avoid problems or deal with them haphazardly.?Great thinkers and leaders look for problems and have frameworks that help them solve problems better.”?—?Michael Simmons
In his article “Thought,” professor Robert J. Sternberg explained the secret — according to research by the American psychologists Herbert A. Simon, Robert Glaser, and Micheline Chi, among others — that makes experts more effective than novices in problem-solving endeavors.
Experts
Novices
“… way of working backward is to start with straight with a hypothesis. If your problem is to increase profitability, you might decide that you’ll want to look at ways to increase revenues. Because increasing revenues can lead to higher profitability. Fine.?But what about decreasing costs? Shouldn’t you understand the various ways that you can achieve your goal before deciding on the way to do so?” — Arnaud Chevallier, “Work forward in solving problems, not backward”
Below are some techniques used by experts to have a good problem definition and effectively apply a working-forward strategy to solve?it.
1.?Asking Questions
If you’ve tried this method before, then you may have noticed that sometimes the?problem is not the problem itself but the absence of the right question.
In her book,?The Architecture of All Abundance, author Lenedra J. Carroll introduced a simple technique called “The 12 What Elses” for getting out of a problem:
When?brainstorming solutions,?ask yourself a question and generate 12 answers to that problem.?Then take one answer, turn it into a question, and generate 12 more answers. Repeat until you can see a clear solution.
By following this way, you can generate a questions-answers map, which is helpful to test your hypotheses and structure how to solve complex problems:
Let’s practice and see examples of striking questions that could put you on the right path toward a solution:
领英推荐
2. Root Cause Analysis
Before starting to solve a problem,?we need to understand the root cause first. Often we find out after many trials that the cause differs from what we’ve expected.
By eliminating the false reasons, we’ll have a?better definition?of our problem and become closer to the solution.?The root cause analysis methods help to avoid wasting time and energy in trying to make a fix in the wrong place.
In programming, we use the following practices, among others, as root cause analysis when we have to fix a bug:
3. Use Spectrum Thinking Instead of Binary Thinking
Binary thinking?is always putting things in terms of two alternatives?that are usually mutually exclusive. Sometimes this is valid; other times, though, it is a mistaken simplification.
The antithesis of binary thinking is?spectrum thinking. It considers?multiple options, alternatives, and possibilities. It allows us to switch from operating in just a state of either/or, to a realm where both, between, other, or neither exist.
By cultivating spectrum thinking in yourself, you’ll be much more?creative, and you’ll be amazed by the number of different approaches and solutions you could apply to fix a bug, a conflict, or to come out with an implementation or with a?design?that satisfies the end client.
Here is an example:
Binary and spectrum thinking have their pros and cons and can be paired together. More details about these two patterns and many examples about how to apply them are available in this article: “How Spectrum Thinking Improves Our Communication, Decision-Making, and Problem-Solving Skills.”
Final Thought
Problem-solving is an issue that reaches outside the narrow context of?software development.?This skill highly depends on our mindset and attitude, and to get better at it, the first step to start with is to be more curious than frustrated about the challenge facing us.
“A problem is like a curve in the road. Take it right and you’ll find yourself in good shape for the straightaway that follows. Take it too fast and you may not be in as good shape.” —?Tim Hicks
Originally published at Better Programming.
Want more?
???? I write about engineering, technology, and leadership for a community of smart, curious people.?Join my email newsletter for exclusive access?or sign up for Medium?here.
Did you know?
You can get my Udemy video course FOR FREE with the following link (available until October 23, 2022, Coupon: 4443E48C99E79CB072FB): How to Identify, Diagnose, and Fix Memory Leaks in Web Apps