Probably the most frustrating thing that happens to me as a developer is getting stuck. It is as if the code is mocking me for not knowing what to do, not to mention all the time it eats up just trying to get past the block. Really bad blocks can hold you up for hours. In that case, any progress you make is not even about the actual task you are working on but the little error that just will not go away. In this post, I’ll go over some helpful tricks that have helped me get from stuck to zooming when working on a task.
The simple yet powerful tip: take a break.
First off: take a break. Yes, take a break. When you are laser-focused on accomplishing a goal, you might not even notice how much time has gone by without making significant progress. This can be incredibly frustrating and anxiety-inducing. Trust me, I know this can really amplify your stress. It is for that exact reason you should probably take a quick five- to 10-minute break.
The stress and anxiety won’t help your brain figure out this problem, so why try and push through? A quick walk outside (or if you live in the American Midwest in the winter, around your office) can do wonders for resetting your brain and reducing your stress. With that added relief, you will have more energy and focus to devote to the problem at hand.
In addition, you can have a snack and grab a drink. That’s because, without proper hydration and fuel, your brain and body can’t function properly. It can be easy to forget to do these things, and that can have some pretty detrimental effects on your ability to function.
Write it down on a list.
This next tip is one that I recently started to use and I have to say that it works wonders. I mainly use it to keep from getting stuck working in the wrong direction. The tip is to write down your problem and the steps to solve it.
Start with the broad goal, for example, of adding a new feature to an app. To do this, you will need to update the UI, and this usually involves adding new visual components. Next, you will most likely need to update the API. In most cases, this means creating a new endpoint and most likely a database query to update the data. Finally, you will have to write tests around the new functionality to ensure that whenever you make new changes, the feature still works as expected. This may differ from person to person, but to me, that looks something like this:
Create New Feature
Update the UI
- Add a new component.
- Use the correct styles.
- Wire it properly to the API (will be created).
Update the API
- Create a new endpoint.
- Add a new query to manipulate the data.
Write tests
- Add unit tests so functionality can be tested and maintained long-term.
- Ideally, include a happy path and sad path test case.
- Implement edge cases.
Now you may be thinking, “Alright, I have written it down. Now what?” The answer? Nothing. That is it, seriously. Sure you can spruce it up with some checkboxes and other things to help with task management. But, just writing out what you need to do on paper or a tablet or sticky notes can help clear your mind and keep you on task. I have found this incredibly helpful when trying to stay on target with my work. Whenever I find myself working on something for a while, I can always refer back to the list of work items I wrote down and gut-check myself to see if what I am currently working on is in service of the items on the list or not.
Of course, things change, but so can your list! Update, delete, and amend all you need to to help to keep you from getting stuck on things that won’t aid in completing your main task. And if what you were getting wrapped up in felt important, you know what you can do? That is right, write out a separate list of things to do when you have a bit more leeway and time for your work!
Ask for help.
This one is difficult because I, like many, do not like asking for help. However, that is mainly because I did not know how to ask for help. It can be really easy to ask for help in the spur of the moment and just braindump on the person you have reached out to for help. They are going to have no context for what you are talking about and it will take up much more time trying to get them up to speed.
So here are some tips on how to ask for help. First, make sure to write out the problem you are facing clearly and simply. If you cannot understand the question based on what you wrote, then neither can the person you’re asking for help.
Next, write down what you have tried so far and what that has resulted in. This will provide the much-needed context for the actual question you need to be answered rather than a broad open-ended question. Additionally, the question receiver will know what you have tried and what has not worked, pointing them in the direction of how best to help you.
Use these tips to get un-stuck.
Getting stuck on something can be a major pain, whether it is not knowing how to fix a problem or getting sucked in the wrong direction, keeping you stuck in the original problem. These are the tips I lean on the heaviest when I am in those situations, and I hope that they help other developers as well.
About the “asking for help” part: In my experience just trying to explain the problem to somebody else will many times result in gaining the understanding that you need to get unstuck.
I’d also add rubber duck talking. Talk your problem out. Tell it to someone, even a rubber duck. In the process of talking the problem out, you often uncover a solution or a clarification you haven’t yet thought of because you too focused on a different area/problem. This is also a pre-cursor to asking someone for help. Doing it will make it so you can ask someone for help clearly with your well defined problem.
When 2pm rolls around I’ll take a short cat-nap, but do so while thinking of the bug, or not sure how to design a new UI component i’m working on, over half the time I’ll come with a solution for the UI or a new direction for the figuring out the bug. One case I quite literally dreamt up a game including the name, which I still hope to write some day.