You're at your desk coding and you hit a brick wall. Maybe it's a strange error, or round after round of fruitless debugging. Or maybe you're just trying to understand quaternions. How can you get past the problem when caffeine and staring into the middle distance fail?
Fortunately, programmer Pawel Klimczyk has your back. He offers four approaches, depending on what's available to you and what you've tried before:
- Test different solutions until it feels repetitive
- Look for open-source solutions online
- Ask programmers with more experience than you
- When all else fails, become Hercule Poirot
Those first three are self-explanatory. That last point however, we're going to need some details.
For those unfamiliar with the character, Hercule Poirot is the name of Agatha Christie's fictional detective who had a penchant for sipping tea while pondering or solving a crime. Klimczyk explains the relevancy:
Whenever Hercule Poirot was working a case he would gather all necessary information, twist his fashionable moustache and... go to sleep. Or drink tea. Seems like he was avoiding real work, right? That's where you're heavily mistaken. He was letting his "little grey cells" do the work, instead of obsessing or worrying about a murder case that seems unsolvable.
At its core, figuring out a programming problem is like any puzzle -- studying it for too long narrows your focus, making it hard to see alternative solutions. By giving your brain a break, it's not unusual to subconsciously come to a different conclusion as you unwind.
Heck, it's as good an excuse as any to have a cuppa.
What Do You Do When Programming Sucks? [Pawel Klimczyk]