If I'm "in the zone", then I stop being aware of the monitor and keyboard and all I see is what's in my mind's eye: geometric shapes coming in and out of existence and moving in various ways that relate to what I'm doing. Then it feels like the code is just pouring forth on its own without me paying attention to it.
It's seriously an altered state.
Most of the time I'm not in that state[1], though. In those cases, I don't think I really visualize anything. I think my mind is too occupied with egg-juggling to have the cycles to spare on visualizing things.
[1] The older I get, the more difficult the state is to achieve and the more delicate it is when I've achieved it. Which is a shame because my best work is done in that state.
I don't even have to get in the zone for that, spatial relationships with various shapes (they're usually tagged blobs rather than geometric shapes; it's not something that could easily be made into an image to share with people) are just how I think about code in general. I switch from my normal "internal voice" style of thought to something different that usually doesn't use words, except occasionally for things like prepositions to help with relationships.
Really this is the same style of thought I usually have when I'm reading a book. Usually I don't have the entire thing mapped out like you'd see in a movie, just blobs that represent the characters and objects in the setting, but they're moving around and interacting as if it's a movie. If I get in the zone while reading this can temporarily override what I'm seeing so I don't even realize I'm still reading words and turning pages.
This happens to me also.
I have an unfounded, loose theory that this is when my left and right brain are in sync with each other. Some days I'm more creative, others I'm more logical but when I'm in the zone I'm both of those things at once and everything 'clicks' together so easily, regardless of what it is.
To answer TFQ: it depends upon how much I "squint": I normally see DAGs, but include cycles if I'm zooming in, or just linear pipelines if I'm squinting my mind's eye.
Kind of like Drakon, filtered through both Iverson and Dijkstra, but in landscape chunks.
The inner monologue is nice, and I have it, but I believe I've also experienced the opposite. It's more of a "vibe/feeling check" where it just feels right to grab the rice and make a rice dish for dinner, it's not an active conversation in my head like: "What should I make for dinner? Fish? Rice?"
For people without an inner monologue, is that mostly correct or am I way off?
Maybe more block-diagram-ish than directed graph. Depends on the software.
I am not sure how this has evolved since I am doing VHDL/FPGA design, but especially there I have the actual block diagram of what I want to build inside my head and just have to "look at it" and type it out with my hands. When it's software, then it's similar. The path the data flows
This describes my perception as well, I think. Except for me it’s more of a spatial system than a visual one. I recall things by how I got there - whether that’s a reference on a webpage or a variable deep in a callstack, it’s sorted in my head according to the path that brought me there. And then I have some fast lookups for “things nearby,” like maybe I can’t remember the exact file with a definition in it, but I can remember the text around it and know what to search for.
The amount of things you can accomplish with a tarp or two, and knowledge of some knots, is great. Absolutely underrated method of camping if you're not in a place where you'll get eaten alive by bugs.
back in school the best basketball player in our conference was a quirky, affable guy who had little skill, athleticism, and never really exercised or exceeded the bare minimum at practice. he said what made him win was he pretended his entire family was going to be murdered by the opposing team if they won. then hed go out and outcompete everyone
my first set theory class in college ruined me. All I saw were sets. The class was taught using graphs too so it was very visualizable
then I took group theory and became a hippy that believes every problem has multiple perspectives you can see it through that have their own strengths and weaknesses and there's no one true perspective
Are we including the program itself as graph-like data? A well-structured program is usually a directed graph. Blocks are the vertices, control flow the edges.
I can't easily visualize anything ever. When I'm programming, if I truly try hard, I can sort of "feel" my system architecture and bits flowing through it. It sort of resembles a simple computer architecture with multiple threads each with their own stack, building up stacks with function calls. Sort of like what you see when you get a traceback, but dynamic.
You possibly have aphantasia (https://aphantasia.com/study/vviq/). I certainly do, and visualize nothing while programming. I often have to sketch block diagrams on paper to give me a foundation.
The bastard in QA sitting in front of my “finished” program twirling his mustache.
Also, the meeting after launch where the client/users go to use the features I’m making. Their complaints. Their workflow issues. Performance bottlenecks.
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.
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.
Yeah this is me too - which is why I enjoy turn based games while I’m coding, if I get stuck I distract my consciousness with 2-3 turns in Civilisation and the answer pops into my head while I’m playing.
Turn based is excellent because always I’m mid-turn when the answer comes so I alt-tab out and keep going.
My steam shows some ridiculous number of hours in game because it’s always on, nearly 24/7, in a window on my monitor
Very interesting. Any turn-based games you'd recommend for someone who's completely new to them? I have zero knowledge in that area but would love to try it out.
Try Civilisation, probably start with the current one - Civ 6
Then if you like it you can work your way backwards
If you like a more futuristic setting then Endless space 2. Or civilisation beyond earth is really fun to colonise another planet and research futuristic technology and alien biology.
If you like puzzle games with no time pressure SpaceChem.
There must be a connection to how doctors advice to talk to (even unconscious) patients who survived a stroke: the brain of the patient is still actively receiving information and constantly rewires itself while trying to process the data over and over again. In case with a complex programming problem, the person itself is responsible for the 'feedback loop'. Like how you can't stop thinking about the problem under different angles. Thus no need for external stimulus. I'm guessing the best time for that kind of processing is when one is asleep because there is simply not much else for brain to do in that state. Plus, when asleep, some long-term memory mechanisms kick in which make the already processed data more accessible and easier to work with. If there are some studies explaining the why's, I bet the medical ones focusing on brain damage and long-term memory would be the most related.
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.
I have that a lot. It seems my mind needs to try a lot of combinations and suddenly stumbles upon one that makes sense and a light lits up. Browsing through the code or reading the docs only tends to get in the way for that process.
There's the need for some noisy creativity to be able to try to match a lot of combinations including the non obvious ones, where the solution space is.
I don't have aphantasia, I can easily imagine things when I want to, in fact I used to paint, it's just that when I am thinking, or doing any sort of intellectual work, I find visualizations more of a hindrance than helpful.
I also don't have an inner monologue unless I explicitly opt to, which I only very seldom do.
As a side note, I find most diagrams a waste of my time, more often a deterrent to understanding. I have always had great trouble producing diagrams for others, at work.
Pretty sure I have aphantasia. So, I don't visualize anything. But, I do often imagine data structures and algorithms as ambiguous "things" at places and in motion. Can't see them. But, I can move them around and remember where they are. Like, imagining Bubble Sort as a shell game with your eyes closed.
I'm in the same boat. No visual imagery but I do "see" abstract relationships and how they interact. I'm reminded of a case where a man had head trauma-induced blindness. He couldn't see colors, shapes, etc. But it turned out he could still see motion. He described it as black moving on top of black. It's sort of like that, somehow I experience the contours of the abstract relationships, but they feel very insubstantial.
I'd guess few people have much image-like things in their head for data structures or control flows or such. Such can be conjured if one tries to explain something visually by e.g. drawing. But 2D/3D structure is very limited for thinking about abstract stuff like programming.
I don't really have a recollection of or introspective access to what I experience when I focus on something like programming. And I guess many who claim they do are confabulating.
Id argue temporal/spacial reasoning encompasses ALL the reasoning we can do. After all, space time is the fabric of reality and encompasses all possible events
When doing architecture work, I'm generally thinking in terms of data flows and state changes.
Programming seems more verbal to me than visual. It feels very akin to writing, I have an idea and I am talking through it. My editing of code tends to be nonlinear for this reason, drilling into areas as I would expound upon them verbally, rather than in the order the compiler will evaluate them.
I "see" the code, but I'm not sure that I actually see anything. Maybe some kind of shapes, but they don't correspond to UML diagrams or anything. Maybe vaguely 3D blocks? But I'm not really thinking visually, so I'm not really looking at them as shapes. All I can say is that I think there is some spatial thing going on, but I can't tell you what it is.
I see semi-amorphous/semi-geometrical/semi-colored stuff that represent different aspects and components of system.
I think it's similar to people I've talked to about what they see when they think of the year+months+seasons, many friends described similar-ish types of representations that seemed visual (e.g. a circular view of months, or a long ribbon, etc.)
If months are circular for you, in which direction do they progress? A few years ago I realized my mental model of calendar months goes counter-clockwise. No idea why. I'm also aphantasic, so it's a sense of space and movement but I'm not actually seeing a circle. NYE is at 12 o'clock, but January is oddly at 11.
I've never thought about it before but mine is definitely counter clock-wise as well, though NYE can be either at 12 o'clock or 6 o'clock. Brains are weird things.
> If months are circular for you, in which direction do they progress?
It's kind of circular and I'm kind of in the middle with them arranged clockwise. On my left is summer (but during summer I'm kind of more facing them then having them to the side of my vision). Fall is on top (but I don't look up, the whole things shifts down into my primary focus area as we move through oct for example), winter on the right and spring down at the bottom.
For me NYE is approx between 1+2 o-clock, the 4th of July is approx 8 o-clock (it's not exactly symmetrical but close), Halloween is a little past 12.
I visualize the starting state of exposed functionality, the desired end state and the transition. Then implement the transition without forgetting to take note of everything this transition affects.
175 comments
[ 2.8 ms ] story [ 191 ms ] threadIt's seriously an altered state.
Most of the time I'm not in that state[1], though. In those cases, I don't think I really visualize anything. I think my mind is too occupied with egg-juggling to have the cycles to spare on visualizing things.
[1] The older I get, the more difficult the state is to achieve and the more delicate it is when I've achieved it. Which is a shame because my best work is done in that state.
Really this is the same style of thought I usually have when I'm reading a book. Usually I don't have the entire thing mapped out like you'd see in a movie, just blobs that represent the characters and objects in the setting, but they're moving around and interacting as if it's a movie. If I get in the zone while reading this can temporarily override what I'm seeing so I don't even realize I'm still reading words and turning pages.
he asks me questions about the code i'm looking at, and my brain does its best to explain the logic to 'him' in plain english
any time i'm unable to answer something he 'asked', that's exactly where the bug is
To answer TFQ: it depends upon how much I "squint": I normally see DAGs, but include cycles if I'm zooming in, or just linear pipelines if I'm squinting my mind's eye.
Kind of like Drakon, filtered through both Iverson and Dijkstra, but in landscape chunks.
https://www.youtube.com/watch?v=u69YSh-cFXY
For people without an inner monologue, is that mostly correct or am I way off?
* Nodes can represent code units (lines, functions, AST) or some low level thing, even hardware parts.
* Can expand a node which contains other graphs
* Can group graphs into simpler graphs to describe a high level system design
* edges generally mean communications between graphs/nodes
Maybe more block-diagram-ish than directed graph. Depends on the software.
I am not sure how this has evolved since I am doing VHDL/FPGA design, but especially there I have the actual block diagram of what I want to build inside my head and just have to "look at it" and type it out with my hands. When it's software, then it's similar. The path the data flows
/s
then I took group theory and became a hippy that believes every problem has multiple perspectives you can see it through that have their own strengths and weaknesses and there's no one true perspective
If I code too much all day and night and don't unwind before going to sleep, I dream code... just code text scrolling by endlessly in my dreams.
You possibly have aphantasia (https://aphantasia.com/study/vviq/). I certainly do, and visualize nothing while programming. I often have to sketch block diagrams on paper to give me a foundation.
Also, the meeting after launch where the client/users go to use the features I’m making. Their complaints. Their workflow issues. Performance bottlenecks.
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.
Turn based is excellent because always I’m mid-turn when the answer comes so I alt-tab out and keep going.
My steam shows some ridiculous number of hours in game because it’s always on, nearly 24/7, in a window on my monitor
Then if you like it you can work your way backwards
If you like a more futuristic setting then Endless space 2. Or civilisation beyond earth is really fun to colonise another planet and research futuristic technology and alien biology.
If you like puzzle games with no time pressure SpaceChem.
These are my favs
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...
There's the need for some noisy creativity to be able to try to match a lot of combinations including the non obvious ones, where the solution space is.
Here is the link: https://www.coursera.org/learn/learning-how-to-learn/
I don't have aphantasia, I can easily imagine things when I want to, in fact I used to paint, it's just that when I am thinking, or doing any sort of intellectual work, I find visualizations more of a hindrance than helpful.
I also don't have an inner monologue unless I explicitly opt to, which I only very seldom do.
As a side note, I find most diagrams a waste of my time, more often a deterrent to understanding. I have always had great trouble producing diagrams for others, at work.
Motion is separated from shapes and structure and objects changing place very early in visual processing, and it's kind of a sense of its own.
I don't really have a recollection of or introspective access to what I experience when I focus on something like programming. And I guess many who claim they do are confabulating.
Programming seems more verbal to me than visual. It feels very akin to writing, I have an idea and I am talking through it. My editing of code tends to be nonlinear for this reason, drilling into areas as I would expound upon them verbally, rather than in the order the compiler will evaluate them.
Perhaps the git diff helps me visualize what's left to do.
On the other hand, if it is a complex algorithm, I draw diagrams representing the edges cases and I try to give them names before coding them.
I think it's similar to people I've talked to about what they see when they think of the year+months+seasons, many friends described similar-ish types of representations that seemed visual (e.g. a circular view of months, or a long ribbon, etc.)
edit: here's the article that prompted me to reflect on this https://nrkbeta.no/2018/01/01/this-is-what-the-year-actually...
It's kind of circular and I'm kind of in the middle with them arranged clockwise. On my left is summer (but during summer I'm kind of more facing them then having them to the side of my vision). Fall is on top (but I don't look up, the whole things shifts down into my primary focus area as we move through oct for example), winter on the right and spring down at the bottom.
For me NYE is approx between 1+2 o-clock, the 4th of July is approx 8 o-clock (it's not exactly symmetrical but close), Halloween is a little past 12.