There’s been a lot of times when I feel like I can’t think how to properly implement a solution or understand a code block. Next thing I know, I’ve wasted an hour just wondering where to start.
If writers have writer’s block, software developers have coder’s block. Everyone experiences creative block from time to time. Whether it’s because of lack of inspiration or getting overwhelmed of the code in front of you, there are ways to overcome coder’s block.
1. Take a Break
Most often than not, taking a quick walk outside and getting fresh air is all that you need to get that fresh mind. You can also grab your favorite drink and finish it before going back to your desk. Some workplace have fun or game areas where you can play table tennis or a quick game of FIFA or NBA 2K. Doing meditation is also a good option.
Whatever you do in your break, make sure that you clear your head and get back to your desk with a fresh perspective.
2. Be Comfortable
Working for a while can make you feel a little bit of stress, and feeling uncomfortable while working only makes it worse. Take a quick breath and check what you need to make yourself comfortable.
Decluttering or cleaning your desk will definitely improve your focus. I find preparing a favorite drink or snack available on my desk helps me get comfortable too. Always have water nearby to avoid dehydration.
3. Start Small
Reading, understanding and writing code can sometimes be overwhelming, and will make it difficult for anyone to start doing what needs to be done.
Try breaking down your coding tasks into smaller tasks without losing the bigger picture. Writing and committing that first unit test might just give you the necessary boost to go into your flow.
4. Talk To Your Peers
A lot of us are afraid of asking for help from our fellow developers or any of our team members. However, being able to discuss anything about code or domain with your team is a good thing and is a sign of a healthy team. Don’t be afraid to talk to your peers when you are having a problem.
One thing to remember is to ask if your peers are available for discussion to make sure that you are not interrupting them for your own benefit.
A lot of engineering teams practice pair programming which, almost always, helps in avoiding getting stuck with a problem since you have a partner who you can help you immediately. I understand that this practice isn’t for everyone, so maybe just having a rubber duck session will be enough.
Coder’s block, or whatever it is called in different context, is so common that I might have missed a lot of ways how to get out of it and get things done. So please do let me know if you have solutions that you want to share.