I’ve played sports my entire life and I find certain sports for me it’s easier to find that inner calm. When your head is clear and only exactly what you are about to do matters. This is always when I’m at my best. Everything around me slows down, if I’m aiming at something, the target becomes clearer – almost as if I’m pulling the target to me – and there is no way I can miss it.
I wish I could say this statement is true when I’m writing code like a CASE Statement in SQL. Oftentimes, my mind is racing with needing to get something done and having a thousand more things to do. At times it can take me a little while before I realize that I’m actual moving slower because my mind isn’t focused.
I’ve found a great technique that I’ve learned by playing golf that helps me focus better!
- Keep your head down and eye on the ball.
- Do I need to adjust for the wind? This alone requires further thought because if yes, which direction? If it’s coming towards me, I probably need a different club than normal. If it’s going with me, I need less club. Etc…
- Do I need to adjust for being in the rough versus the fairway? If I’m in the rough, the ball typically will not travel as far. How thick is the rough? If it’s too thick, certain clubs will not be able to hit the ball well, e.g. a wood. Etc…
- Is there some water in front of me? Perhaps I should aim away from it.
- Is there a sand trap in front of the green? Should I aim more to the middle of the green leaving a longer putt?
- On my last shot I sliced the ball, perhaps I should adjust in case I do this again.
The list can go on and on. More importantly, with each shot, the list may get larger because your brain is pushing each swing onto your mental stack where they may affect future shots.
This is very similar to a coding task. Seldom does a task allow us to travel in a straight line to solve the problem. Often times we will start in one class, create some functions, then travel to another class. Oh wait, this class doesn’t solve my exact issue. Perhaps it requires refactoring or a new sub class, etc…
We now have a lot of different moving pieces to deal with it – much like with each golf swing.
Here is the trick I found to find the inner calm when it comes to my golf swing. When I was younger (and more agile) I used to swing really fast and hard (thinking this somehow generated more power). Oftentimes this would hurt my back. Ironically making me have to slow down my swing.
When I would do this, each shot hurt – and it hurt a lot. Given that I paid my hard earned money to play, I wasn’t going to pack it up and leave. Instead I found that I had to alter my focus. The only thing that mattered was making this ONE shot. Nothing else at all mattered. I’ve already had to adjust my swing, so this would magically wipe away all of my previous bad shot memory.
Miraculously, even with my hurt back, my game would get better. It was one shot at a time and it was forced upon me because the pain was so bad that I had to mentally block everything around me just to be able to take this shot. Immediately after the shot, the pain would come bursting back through my mental block.
While golfing and coding don’t have much relation, this notion of mentally blocking my surroundings plays a drastic role in helping me find my inner calm and solve the task at end.
I need to forget the 1001 things on my to-do list. I’ve already wrote them all done and prioritized them thanks to Slowing Down Before You Speed Up so I know what I’m working on is the only thing that’s important right now. Next I need to block out other distractions, whether it’s noise around me – both physical, but more importantly noise in the code and focus on the immediate path in my task (not just the task, but the lower level piece).
By finding that inner calm and mentally blocking everything else out, the solution (or problem when debugging) will often jump right out at me. I find this eerily similar to how it feels like “I’m pulling the target to me” when I find this same mental focus in sports.