Jure is a founder of Codequickie and WhistleX. He likes technology, sports, and computer games.
So, what we do? We can’t learn the solution to every problem that exists, but we can learn how to deal with any problem. The same principles of problem-solving can be applied when you are a beginner and when you’re a more experienced programmer.
Although ways to solve coding problems are very similar, every developer has its own techniques that he or she uses. In this article, I’ll show you how I approach and try to solve a problem. Let’s start!
Everything starts with a problem to solve. Let’s say that you need to make a program that asks a user to input 3 numbers, and then the program returns if the number is odd or even, for every number that the user has put in. This specific problem is not complicated to solve for most programmers, but for this purpose it’ll be enough.
So, when I have a problem, the next thing that I do is that I ask myself, can this problem be solved? Of course, this problem that I’ve put out can be easily solved, but there are some problems which can’t be solved, not because they are hard, but because technology isn’t there. You maybe want to make a car that flies, but that problem probably won’t be solved in the near future. When I know that the problem can be solved I begin step two.
It’s very hard to solve one big problem, but it’s a lot easier to solve 3 small problems, that’s why dividing the problem into small parts is so important. That’s the same principle how almost all tools work.
It’s hard to lift a 2000kg car in one take, but it’s easier to lift 20kg 100 times (car jack). In the end, the problem that appeared to be impossible at the beginning is now solved.
So, let’s continue with the problem that I’ve said earlier. How you make that application? You divide it into small functions. I would divide this specific problem into 3 parts. In the first part, I would focus on getting input from the user.
In part two, I would try to find out if a number is odd or even. In the third part, I would try to find out how to repeat that process on three numbers. After I divide the problem I go to the last step.
In the last step I solve those divided problems, and when I have all of them solved I then connect them. That’s it the problem is over. Of course this doesn’t go like this in the real world. I usually spend a lot of time researching on Google for solutions and looking if someone has already solved that problem.
When problems solving, Stack Overflow, Git Hub, and all the other websites, blogs that teach coding are your best friend, not your enemy. Use them as much as you can.
One more thing is to not get frustrated. Every programmer has trouble solving problems, even the more experienced ones. By pushing through those problems you become better, not by giving up. If you want to learn how to solve problems, programming course help a lot, here a couple ones that I personally recommend:
In short, I try to divide a big problem that I can’t solve into smaller problems that I can solve, and when I am done with them, I connect all them into one application.
I hope that I have helped you with this article. If you liked this article, make sure to share it with your friends.
Also, if you think that I have missed something or you have any other questions, be sure to post your questions in the comments or send me an email at firstname.lastname@example.org, I will be happy to answer them.