What actions you should take when you are stuck on a coding problem
Have you ever felt stuck on a coding problem? You have. Getting stuck is part of the job; you solve riddles every day. You signed up for that when you decided to write code, for work or for fun. Even senior engineers run into concepts they don’t know. If you’re in this spot right now, don’t beat yourself up. Don’t start doubting your skills. You don’t need that.
Here are a few tips that helped me in similar situations.
1. Read the documentation
Reading the docs often solves the problem. Even when they’re poorly written, searching the API reference can save you time. Start there before jumping to other sources. Make sure you understand the expected input, processing, and output of the code you’re working on, and how it matches what the docs describe. I’ve started work without reading the docs, assumed I’d figure it out, and ended up wasting time.
2. Break it into smaller chunks
This is the first principle of software engineering. Complex work only moves forward when you break it into smaller tasks. Keep the big picture in mind, then go step by step.
3. Search Google
We definitely can’t neglect the help of the Google search. They say that a good Googler is a good software engineer as well. That’s 100% true but that, only, is not enough by itself. It’s not only the Google search per se but the fact that you have to know exactly what to expect on the results. You’ll become more experienced on that as time goes by. You’ve probably seen that before. You searched for something and you didn’t get back what you expected from, but when you modified your query you finally got the answer to your problem.
4. Ask for help
Don’t be afraid to ask for help. Nobody is born knowing everything. Colleagues, Stack Overflow, Facebook communities, and Slack groups are good places to ask. A second pair of eyes can make the difference. What looks elusive to you can be obvious to someone else. If you need instant support from an experienced software engineer, codementor can help.