Cats

07/01/2022

The next must have for your coder's toolbox: cats. Well, maybe not cats. It's ok if you don't like cats, I promise. However, it is a good idea to have something that is completely unrelated to programming that you can go to when you get stuck on a problem. Pick something that's not too distracting so you don't end up absorbed for several hours. But it must be something that is entirely unrelated to code. 


It is easy to work on a problem for several hours trying the same things in slightly different ways while growing increasingly frustrated as the problem seems to get more tangled by the second. The funny thing is that sometimes the solution is something simple. The issue is that when you focus on the same bit of code for way too long you might get stuck looking at the problem from one angle.  No matter how many "different" things you are trying you're really just walking in circles. The simple solution might be right in front of you, but you're just looking at it wrong. What's often needed is a change in perspective.


This is where cats [or insert other non-coding related topic or activity here] can help. Grab whatever non-coding topic or activity you have ready and can spend a few minutes on and forget about code. Cats are great because they're easy to find on the Internet. Many people agree cat videos are funny even if they don't agree that actual cats are "pawsome". Do a quick search for "cat videos make you more productive" - you will find research has been done to prove this point. Obviously, I'm not advocating watching cat videos all day rather than working (unless you can find a way to get paid to watch cat videos... cat video debugger?). But when you are absolutely genuinely stuck you are better off spending 5 minutes watching a cat video and 10 minutes finding a solution rather than spending 5 hours throwing things at code and getting frustrated that nothing's working. 


Maybe you will need to get away from the screen altogether. In that case, maybe what you have in your toolbox is an activity. The activity can be as simple as going to the breakroom to get coffee (or wherever you get your coffee while working). Or you could draw something - even if it's awful. The idea is to step away in order to come back with a new perspective. 


Getting away from a problem allows you to let go of some of the stress that built up while you were getting frustrated with that bit of code. Less stress == clearer thinking == easier to see the problem. Stepping away also encourages creativity - another important element to problem solving. Sometimes that short break can put enough space between you and the problem that you see it from an entirely new angle. You're no longer walking in circles. Your previously hidden solution is often right in your face. At the very least, this method usually helps you to see alternate paths you can pursue in order to find the ultimate solution. 


Disclaimer time! I'm not sure if the idea of "step away from a problem if you're stuck" has been scientifically proven to be effective, but personal experience of over 22 years programming (about 17 of those being professional at time of writing) tells me that it is. If it works for you, it is a useful tool. If it doesn't, there are other ways to get unstuck such as breaking the problems into smaller pieces, brainstorming possible solutions (even ones that don't make sense), or using the rubber duck method (https://rubberduckdebugging.com/) .  Try different methods, find what helps you to get unstuck, and put that in your toolbox - even if it's cats.

© 2020 Coder's Toolbox blog. All rights reserved.
Powered by Webnode
Create your website for free! This website was made with Webnode. Create your own for free today! Get started