We all want to improve our coding skills. By learning and practicing more, we accumulate more experience in problem-solving. When facing a familiar problem in the future, we can easily solve it because we have prior experience in handling similar issues.
Many people rely on years of experience to judge whether someone is a good coder or not. This is a reasonable approach when there is limited time to evaluate someone or when there is a lack of expertise to make the assessment. However, there are still young individuals who possess excellent problem-solving skills despite having fewer years of experience. Therefore, the number of years of experience is only a reference, and there is no certainty that more years of coding will make someone better than those with fewer years of experience.
As Malcolm Gladwell wrote in his book "Outliers: The Story of Success," "10,000 hours is the magic number of greatness." This means that you become truly skilled in something after spending at least 10,000 hours working on it. However, the concept of the 10,000-hour rule is still debatable. Is it necessary to reach this specific milestone to become excellent, or are there other ways to surpass the obsession with this number?
Simply put, it is the ability to effectively solve the problems you encounter. But what does it mean to solve a problem effectively? It depends on each individual's knowledge and experience.
Imagine you are given three tools: a fork, scissors, and a shovel to open a snack package. Which one would you choose? You would probably choose the scissors because you know that they are the simplest tool to open the package. However, would a child know which tool is best among the three? In essence, all three tools can open the snack package, but you are more familiar with them, so you know how to use them effectively.
In the world of programmers, knowing how to apply a tool or method to solve a problem in the most appropriate and accurate way is your programming mindset.
A common mistake that beginners make in coding is focusing solely on learning (memorizing) the syntax without cultivating problem-solving skills. There are many programming languages, each with its own syntax that can be overwhelming to remember. However, problem-solving skills are a continuous process that exists across languages.
To achieve this, you need to dedicate hours to explore and practice all aspects of programming. This will develop your programming mindset. The 10,000-hour rule is only a reference point to help you prioritize where to focus your efforts to reach your goals more efficiently.
Programmers with a strong programming mindset often think similarly when it comes to problem-solving. As interns, when you listen to experienced programmers discuss how to solve a particular problem, you may find it difficult to understand their smooth exchange. This is simply because you have not reached the level of programming mindset that they possess.
Advice: Keep doing and experimenting until you find the best way to solve a problem. Never settle for one solution because each solution has its pros and cons.
To achieve this, there are four steps to simulate this process:
First, you need to understand the requirements accurately. Most difficult problems arise from a lack of understanding. How can you understand them? Try explaining them. This is also part of the famous "rubber duck" method. The key idea is to explain the problem to a rubber duck, and if it works, you will discover gaps in your knowledge.
A rubber duck is a famous method in the programming world. Basically, when you explain the problem to a rubber duck, it becomes a way to test if you truly understand the problem, because only when you understand can you explain it. Moreover, during the explanation, you may discover new issues that need to be addressed and find ways to solve them.
There is a famous saying in this case: "If you can't explain something in simple terms, you don't understand it." When receiving a requirement, take the time to "understand" it before starting to work on it. This is also the content of the next step.
Don't rush to code immediately. Take the time to plan how to solve the problem. Although you may understand the problem, writing out the steps of solutions will help you have a clearer understanding and discover unexpected cases.
Repeat the question "With input X, what steps are necessary to return output Y?" while planning. Identifying each input and output means you know what you need and how to solve them.
Divide the problem into smaller pieces, the smaller the better. A large problem may seem complex, but when broken down into smaller parts, it becomes simpler, to the point where you may already be familiar with the individual components. If you encounter a problem you have never faced before, it is an opportunity for you to learn.
Ultimately, when you solve all the smaller problems, the original problem will be resolved. Remember that the divide-and-conquer method is effective in all aspects of life.
Sometimes, you may not fully master the smaller problems. Don't worry; everyone experiences this. The difference between a good problem solver and an average one is curiosity about the occurrence of errors rather than frustration. Essentially, during this stage, you need to practice your debugging skills to gain experience when facing similar errors. Understanding the nature of an error also means understanding how to avoid it.
Getting out of a deadlock is not the end. Apply the "evaluate and retreat" method, which means going back to a previous step to see if there is a faster way to solve the problem. Even if you have solved the problem, take the time to evaluate whether the solution is truly effective. Is there anything you can do differently to improve the outcome?
The programming mindset exists within all of us. You can truly master it through daily practice and training. Understanding the importance of a programming mindset helps you focus on your personal and professional development.
5 profound lessons
Every product comes with stories. The success of others is an inspiration for many to follow. 5 lessons learned have changed me forever. How about you? Click now!
Subscribe to receive new article notifications
Hello, my name is Hoai - a developer who tells stories through writing ✍️ and creating products 🚀. With many years of programming experience, I have contributed to various products that bring value to users at my workplace as well as to myself. My hobbies include reading, writing, and researching... I created this blog with the mission of delivering quality articles to the readers of 2coffee.dev.Follow me through these channels LinkedIn, Facebook, Instagram, Telegram.
Comments (2)