zlacker

[return to "What do you visualize while programming?"]
1. sinuhe+273[view] [source] 2024-10-18 16:52:35
>>dillon+(OP)
When working on a hard problem, I often had to visualize how the algorithm works, data moving there, changing this, replacing that. When I debug a tricky problem and I still have not figured it out yet, I have two options: either systematically note down what the code is going through, or keep the problem in the back of my head and sleep over it. More often than not, the solution will present itself after a while if I still bother with the problem. I reckon I can not solve all problems like that, but when my mind refuses to dig in, that is often the only effective way to solve the problem. Pushing harder only wastes time and risks saturation.
◧◩
2. ljdtt+l83[view] [source] 2024-10-18 16:59:50
>>sinuhe+273
That really resonates with me! I’ve found that when I’m up against a tricky problem, the solution often pops into my head when I’m not actively thinking about it—whether I’m sleeping, going for a walk, or just doing something completely different. It’s like the answer appears out of nowhere after I’ve stepped away.

I’ve always wondered why this happens. Is it just how our brains work in problem-solving mode? Does anyone know of any articles or studies that dive into this? I imagine it’s not just a programming thing, but a general part of solving complex problems.

◧◩◪
3. wormlo+Wj3[view] [source] 2024-10-18 18:15:59
>>ljdtt+l83
Julian Jaynes[1] makes a pretty compelling argument that our unconscious mind does pretty much all of the heavy lifting with regards to problem-solving. The conscious mind just steers us and lets us remember what we are doing.

If I recall correctly an example he gives is looking at a math problem. Looking at 2+2 as an adult you instinctively know it to be 4. As a child you may have had to count on your fingers or write out the problem until the abstraction of numbers was solidified for you, and now it is just a black box that your unconscious has added to a "tool belt" of sorts.

For me I would describe the process of learning/problem solving as my conscious mind navigating some solution/problem space and figuring out the general shape of it. Once I have figured out the shape of the problem, the answer either:

1. Immediately looks like the shape of another, solved problem. In which case I just use that solution.

2. Is not immediately apparent.

In the case of #2 I just play around with different strategies that mostly don't work, but it helps me build a mental model of the problem. Then I wake up in the middle of the night with a solution, or figure it out while I am showering/eating/driving/etc.

[1] https://en.wikipedia.org/wiki/The_Origin_of_Consciousness_in...

[go to top]