DEV Community

Discussion on: What do you do, when you are stuck?

Collapse
 
matthewbdaly profile image
Matthew Daly • Edited

Going for a walk is my personal favourite. Or if I can't do that, make a cup of tea. Something that gives me a chance to stop actively thinking about the problem.

I highly recommend the book Pragmatic Thinking and Learning for more details, but essentially there are two "modes" of thought you need to engage. One is the linear mode, essentially your inner monologue, which is useful for working through problems logically. The other, referred to in the book as R-mode, is more unconscious, and works like an asynchronous search engine in that it will work away in the background unnoticed and then suddenly return ideas.

Actively using the linear mode stops R-mode from working, but if you go do something else and switch off your l-mode, it has a chance to run.

Very often I've been stuck on a problem, then gone home or out to the shops to buy lunch, and very quickly been hit by the answer, or at least a new idea.

Rubber duck debugging is another good one. Explaining the problem to a colleague will often lead me to the answer even without any input from them.

Collapse
 
dowenb profile image
Ben Dowen

Thanks Matthew, lots to think about there! When I get a chance I like to work in a pair, but it isn't always easy as I'm primarily remote.

Collapse
 
matthewbdaly profile image
Matthew Daly

Rubber duck debugging can work with pets or inanimate objects (it helps if it's something you can anthropomorphize, such as a stuffed toy), or a non-programmer. It's the act of explaining it that gets your brain working.

Thread Thread
 
dowenb profile image
Ben Dowen

I really should give this a go. I spend a lot of time alone in my home office. I could speak with an inanimate object quite easily without being interrupted.