I ask my local tech community for tips on problem solving for aspiring developers. The advice came in two flavors: developing software and hand on keyboard coding.
- Ensure that you understand the problem. This could mean asking clarifying questions to someone, getting users feedback on an idea or issue, or re-reading the written problem. You want to know as much as possible about the problem being solved. Afterward, brainstorm possible solutions.
- Break down the problem into logical steps that can be solved one at a time. An example is to build a login screen for an application. That can be further broken down into designing it, researching the technologies involved to ensure its secure, and then how the data will flow into other parts of the app. Another example is a code problem. Can you code multiple smaller focused functions that will be used in a bigger function to get the desired outcome.
- Don’t reinvent the wheel. Use established conventions and libraries to solve known industry issues so you can focus on learning and building. An example is authentication of users. While you could build your own system, it may be more secure (for your users) to use battle tested libraries like Auth0. Another example is sorting data. There are established techniques to do this veres you spending hours inventing something unnecessary.
- Write pseudocode before writing any logic code.
- Take time to learn and practice using the debugger. This allows you to work your way through your code one logical operation at a time. You can monitor how the data is changing and where it's being manipulated.
- A brute force approach is to print everything as you code. This includes the inputs and outputs so you know exactly how data is flowing within the app. Write a line of code, then test that line. It takes longer, but you will know that everything previous written works.
- If stuck on a problem for 15 minutes to 1 hour, take a break and try again later. This could mean physically walking away from the computer to go for a walk, get a snack, take a nap, or work on something totally different. It's amazing how a short break allows your mind to think of possible solutions. This applies also to longer breaks like a good night of rest.
- If you are still stuck, there is a boat worth of people willing to help you:
- Boot-camp or classroom teacher or TA
- A fellow learner
- A mentor
- Facebook tech group
- Slack tech community
- Twitter tech community
- Reddit tech community
- Stack Overflow and other websites similar to it
- Use your Google-fu to search for blog posts, YouTube videos, and tutorials for help.
A final thoughts is to write good variable names. This can help avoid creating bugs and help you understand the logic flow of your code.
I hope you get the gist that there is help out there. There is an entire community waving their hands and screaming that they want to assist you with your problem.