by koreth1 on 10/18/2024, 10:01:06 PM
by swatcoder on 10/18/2024, 5:27:25 PM
I think the title by itself suggests a different question than the article raises.
The idea of the article is that certain visualizations can help think through certain problems. Maybe you can hold these visualizations in your head, or maybe you can't (because your aphantasic, they're too complex, you're tired, whatever), but they're just as available to you on paper or in diagramming tools if you need them. It's trying to start a discussion about what helpful visualizations people turn to in specific problem contexts.
It's separately interesting to hear people try to characterize what they visualize in some generic/universal way, but I think it's causing a lot of people to self-diagnose as aphantasic when it's not indicated. You're not obliged to have some vague generalized visualization going on in your head when programming any more than you would be when speaking, or writing, or playing music. More commonly, one might draw on specific visualizations here and there as they enrich and relate to what you're expressing in your art.
by n0n0n4t0r on 10/18/2024, 7:13:49 PM
I personally have aphantasia, and, funny enough, I don't visualize anything when I'm coding, or reading code: I just understand the concept more or less deeply, but always without any images: It's just the "concept" that I understand. It's really like if I had an interpreter in my head when reading and when coding, I do the opposite: I know the required sequence and I reverse engineer it to the programming language version.
Do you guys really have schema in mind??
by JohnFen on 10/17/2024, 1:43:46 PM
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.
by sinuhe69 on 10/18/2024, 4:52:35 PM
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.
by etc-hosts on 10/18/2024, 4:41:20 PM
I visualize the tent my family will live in if I get layed off.
by illwrks on 10/18/2024, 8:05:58 PM
I'm a designer by trade, programming is largely a hobby for me. By default I see things as pictures in my mind, I always have.
When I read something and it doesn't make absolute sense to me, I need to learn more about the context so that I can 'see' the whole picture and how it fits together. This means I can take a while to grasp something, but once I do I seem to have a better understanding of it than my peers - likely because I have that wider context.
I also have a tendency and desire to simplify the complex - which I think is a combination of my need to learn the detail in order to build that picture in my mind - and with my design background I can represent that well in reality.
In my corporate day job it means that I can take complex stuff and make sense of it. And provided I've got support to be brutal in cutting down information, I can simplify it for others to grasp also.
by f7b5 on 10/18/2024, 7:35:36 PM
When I was first introduced to mental visualization, I thought I couldn't do it because I struggled to clearly picture something as simple as an apple - or any other familiar object - in my mind. But with practice, the images slowly became clearer and more stable. Through continued practice, I was able to visualize more complex things, like text and even music sheets - which is kind of a cheat code, because you can memorize what you can visualize.
Something else I learned is that mental imagery[1] isn’t limited to just visual experiences. As a musician, I use it to hear intervals, hear the strong beat, hear chords, different timber / sound textures etc. You can also "visualize" smells, physical sensations, and more. I clearly see it as a skill that improves with time and effort.
One nice trick is being able to visualize conversations, dialogues, interviews etc. I believe it dramatically helped me overcome stress in those situations, as well as in performance.
by bfung on 10/18/2024, 4:38:12 PM
Layers of directed graphs where:
* 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
by mcfunley on 10/18/2024, 9:43:22 PM
In an extended chapter of Mythical Man Month, Fred Brooks described his practice of screening candidates for number-form synesthesia by asking “where is November?”
I have number form so when I was young and originally read this I thought it was pretty neat. But as evidenced in the rest of this thread, it’s an absolutely crazy practice since the majority of great programmers don’t have it. And I assume it’d be illegal these days anyway.
by corysama on 10/18/2024, 4:59:33 PM
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.
by pilgrim0 on 10/18/2024, 5:31:00 PM
I see nothing. I just select a scope and do a mental step-by-step simulation. I do one pass for expected inputs, and then a lot of passes for unexpected inputs. If anything I hold a stack of intermediate values in short term memory, but it's formless. It feels like a story. Since I stare at the code while doing it, you could say that some characters in the story are the relevant slices of code on the screen. If there's no code to stare at, like a planning thing, I write pseudo code or ascii diagrams regardless.
by patterns on 10/18/2024, 7:09:39 PM
I picture clusters of information as they move through the computer. Sometimes they look like ships or motorcycles. :-)
Usually, I don't visualize anything in particular. I use tools for visualization, but I prefer to think algebraically. If I work on a complicated system, programming to me feels like like moving through a landscape, with points of interest that I memorize or lay out spatially in a tool, and going through the motions like patching things together, flicking switches, plugging things in and out etc.
by JohnDeHope on 10/18/2024, 5:53:49 PM
I never thought about it before, but I think I visualize stack frames. Local variables are registers or just memory in the stack frame. Objects are pointers. "Where I've been" is prior frames on the stack. "Where is this going" is branch prediction guesses the CPU is making. It's like having a sort of mishmash of Von Neuman architecture and algorithms and data structures rolling around.
by RaftPeople on 10/18/2024, 5:17:42 PM
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.)
by neilv on 10/18/2024, 6:12:03 PM
This article starts talking about visualizations in head, but then the article becomes about common paper/screen visualizations from CS classes and programming tools.
There are visualizations in your head, and visualizations that you can look at and read and write. Unless you have a photographic memory, IME they're not used the same way.
For example, take their database schema diagram. The graph layout doesn't even make a lot of visual sense, and the visual language doesn't show the connections between columns and relations. But you can "read" through the column names (including the keys they put at top), and trace through the arrows, to see how to navigate to the information you need. And it summarizes important information in a small amount of space. All useful. But that's probably not how you see it in your head, and that's good.
by itohihiyt on 10/18/2024, 7:51:22 PM
Nothing, I'm too busy swearing at the computer and threatening to break it in various ways, until I realise I was missing a semi-colon, or I've misspelled a keyword, or any number of other reasons that make me a bad programmer.
by dekhn on 10/18/2024, 11:41:48 PM
I don't visualize anything while programming, most of the time, but once when I was learning how to do recursion, an entire program popped into my head while I was falling asleep, I could see it floating there in front of me.
This happens when I get really OCD about things. I start to visualize fully-formed solutions to problerms. For a while I thought this was a superpower, but after experiencing it a few times, I noticed that when I got OCD, I couldn't be around other people, and my physical health dropped noticeably as I ignored food. I suspect a number of well-known mathematicians experience this.
by rubyfan on 10/19/2024, 12:14:56 AM
I used to be a ruby developer and was almost 100% in auditory mode - never visualizing anything other than a UX and how I thought they’d be used.
Later in my career I became a solution architect and it was a struggle early. I think something like 99% of people in corporate are visual and literally could not understand the solutions I’d vocalize even when I’d talk to them like they were 5 years old. A more seasoned architect told me taught me sequence diagrams and abstractions. I got good at Powerpoint and my programming skills suffered as a result of using different parts of my brain more and less.
by fizlebit on 10/18/2024, 11:05:52 PM
There seem to be a bunch of folks for whom shaking the legs is an important part of the process. Can be a bit distracting to others in a team workspace. It makes me wonder whether they should have bicycle desks.
by deskr on 10/18/2024, 11:46:14 PM
I don't think I visualize anything when programming. It's more like I'm assembling a factory, conveyor belts, cogs, switches and stuff. I just know where everything is.
I'm still not sure if I have aphantasia or not. I can't "see" things/scene/items in my minds eye. What does it mean to "see" thing in your mind? I'd say for me it's much more like imagining smells, texture and taste.
How strong is this "seeing" part. Can people actually close their eyes and all but SEE whatever item/scenery they want?!
by supportengineer on 10/18/2024, 10:07:58 PM
I will draw or doodle on a notepad next to the computer. Then I will refer to it as I'm coding. I'm very visual, I need to SEE the diagram to model it, but even more so to communicate any ideas with others. I much prefer to DRAW an explanation than to use words. I get tripped up with names of things. If I create any non-trivial Java class name, I forget it immediately. In my head they are represented in a way I can't describe. There is no name or picture. It simply is and it related to other things which are.
by mikehollinger on 10/18/2024, 11:28:54 PM
Relationships and sequences.
But if you want to talk about REAL complex systems talk to a microprocessor logic owner or architect trying to shoot a bug.
A while ago we found a bug that could crash a system (fixed in a new RIT of the chip) if we did X then Y in state … we didn’t know.
Listening to the various leads for the sub-units on a phone call trying to reason about what was happening I found myself visualizing this increasingly complicated steam powered machine, with parts sprawling, tiny gears whirring, and bits zipping about whenever X happened.
It was humbling.
by djbusby on 10/19/2024, 2:24:22 AM
I don't visualize while writing the code. I do scribble written notes about bits to rework, ideas, notes on other parts I'm adjacent to but won't touch on this cycle.
When I'm designing a data-schema or some systems integration I'm in my head with blocks (different shapes/colour) wired together. Then document with PlantUML, C4, Mermaid or whatever the gig calls for. Back in the day it was Visio.
Different modes for different tasks.
And manager mode, ugh. It's lists and checkboxen floating on board game (Risk?)
by 4ad on 10/18/2024, 4:55:22 PM
I don't visualize anything when I am thinking.
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.
by kevin_thibedeau on 10/18/2024, 5:23:09 PM
Arranging deck chairs on the Titanic.
by pizza on 10/18/2024, 11:55:38 PM
I visualize way more things when daydreaming about machine learning theory than I do code. Possibly the main time I visualize code has to do with data structures. What I do notice, though, is that once I’ve iterated for too long on spaghetti code and it’s way past the point of comfortable familiarity, it does feel more explicitly like a “/not/ being able to see through the fog any more” feeling.
by AnimalMuppet on 10/18/2024, 5:07:21 PM
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.
by assimpleaspossi on 10/18/2024, 7:55:50 PM
I grew up as an electronic engineer designing actual computer hardware from the TTL level and beyond. Depending on what I'm programming, particularly with hardware interfaces and assembly or C, I think about the flow of the address and data lines as the code accesses chips and hardware interfaces. I see the address lines accessing a particular chip or port. I see the data going into and out of them.
by bee_rider on 10/18/2024, 7:58:36 PM
I try to visualize the dependency graph for my variables. I figure OoO cores and optimizing compilers are good enough nowadays that, as long as I don’t really mess things up too badly, the computer should figure out how to extract that ilp.
Or, as a special case if I am writing an MPI code, I try to imagine what in the heck the slowest process is doing while everybody else waits at the barrier.
by dokyun on 10/18/2024, 8:32:28 PM
It depends a lot on the problem, but I tend to visualize the /processes/ of the programs that I am working on, rather than the code itself: for example, if I'm writing a function that parses a string, I try to imagine it going over the string, finding the positions of individual characters and capturing substrings between them. If I'm working with asynchronous or network code, I try to visualize how the processes (or hosts) should be working at different times, and how they might send messages to each other.
I find it very necessary and useful a lot of the time to draw diagrams, or even just written notes on the problem I am dealing with. A lot of my mental visualizations are very clear, but it is difficult to retain several at a time.
And like someone else in this thread shared, I often have to get away from the problem and do something else for my mind to garbage-collect itself and have enough room to clearly think up new angles. For me only a matter of even a few minutes away from the computer helps a lot.
by mmcdermott on 10/18/2024, 5:07:17 PM
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.
by KentBeck on 10/18/2024, 9:59:42 PM
I tend to visualize call trees. Much of my refactoring is manipulating the call tree--flattening it, re-extracting subroutines, moving expressions up & down.
Another non-symbolic style of thinking I use is kinesthetic synesthesia. I "feel" the design "lean" in one direction or another, then refactor in that direction.
by analog31 on 10/18/2024, 5:05:10 PM
Maybe because programming per se isn't my occupation... I think about the problem that I'm trying to solve.
by ericmcer on 10/18/2024, 5:40:48 PM
Article focuses a bit too much on specific task visualizations (recursive loop, performance optimizing, etc.) I don't usually spend much time doing that though. Real work to me involves more holding a ton of less complex visualizations in your head simultaneously.
I am usually visualizing how data flows through 5+ functions that are strung together until it ultimately updates the UI/Database/whatever. Each function is a bit of context I need to store in my head, If I can hold all the context's in my head simultaneously then I can easily manipulate the code.
I always felt like a great engineer can hold more contexts at one time, but good code means you shouldn't need to.
by ahartmetz on 10/18/2024, 4:41:44 PM
Nothing except when I'm working with graph-like data, which isn't that rare.
by syngrog66 on 10/18/2024, 10:36:32 PM
My ability to paint & animate images (2D and pseudo-3D) in my mind's eye has been a strength of mine from childhood on. I believe it helps me to be more effective.
One downside however is its power can be addicting. If I let it!
by doublerabbit on 10/18/2024, 8:50:23 PM
What would happen if I do the opposite of what I am doing.
For example, if I am using a switch case, how would this application work in the if statement universe?
Both can achieve the same result but one enables the other to function in a different way.
by samatman on 10/18/2024, 9:05:45 PM
The last time a programming task called for the use of my spacial visualization capability (not that long ago, a couple of weeks perhaps), it went like this. I was working on a system with two priority queues, and three stacks, which were all working together to affect a stream. The goal was to try and come up with counterexamples where the code I needed to work out would fail.
Ended up pulling out an iPad, and using Procreate to draw a bunch of overlapping boxes, and determined that strict stacks weren't going to work here and I was going to have to look for the actual value in the stack and remove it. But that most of the time it would be the top element, so this would be fine.
I don't mostly visualize when coding, and when I need to, most of my capacity is already taken up by something complex. So I have a growing collection of these sort of squiggly impressionistic diagrams, which I sketch out so I can fix the visual component of what I'm working on, to free up some capacity for the real work, which is just, thinking.
Pen and paper are not nearly so good for this as Procreate, I've found, because I can undo marks, and rather frequently do so, in a way which is much more fluid than erasing pencil marks. I can even try several approaches, by making new layers, and cacheing them by setting them invisible, trying again, juxtaposing, and so on.
I agree with the sibling comment that the intellectual work of programming is primarily verbal in character, although it can certainly draw on spacial reasoning at times. This, along with arguments from density, leaves me broadly pessimistic that "visual coding" will ever prove itself as a useful tool, and very skeptical indeed that it could ever be a durable replacement for syntax-based programming.
It also calls for a fair amount of arithmetic, for which I keep a Julia REPL open at all times, and a smaller but significant amount of higher maths, for which said REPL is also a treasured resource. But surprise surprise, it's mostly logic, and while the validity of logic is amenable to mathematics, its soundness cannot be resolved that way, but only through reasoning in an irreducibly verbal fashion. Or experiment, which is of value in programming, but the logic of programs is not nearly so empirical as that of real life.
by groone on 10/18/2024, 5:23:09 PM
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.
by audidude on 10/18/2024, 4:32:48 PM
Nothing, I have aphantasia.
by empath75 on 10/18/2024, 4:48:47 PM
I can visualize stuff just fine in general but I never visualize _anything_ when I'm programming, and I don't know what it would add if I did.
by LiamPrevelige on 10/18/2024, 9:47:53 PM
For me it’s usually some context-specific, low-level DAG of functions/data flow. Maybe a higher level of C4 model depending on the scope of my work.
I’ve been studying this to build a VS code extension that visualizes my codebase as I work. Similar to Feynman’s point, there are many ways of visualizing the same task/section of code, but I’ve found some are more universally interpretable than others.
by dekhn on 10/18/2024, 4:47:56 PM
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.
by stolenmerch on 10/18/2024, 9:43:00 PM
I visualize some geographic location either in my home town where I grew up or in my current city. It's so vivid that I actually drive through some neighborhoods and can instantly recall what I was working on. I have a map with pins in each location I've visualized and what problem I was working on.
by aDyslecticCrow on 10/18/2024, 10:39:59 PM
my arithmetic and algebraic skill, improved after trying to learn drawing.
- Doing multiple operations at once without writing down the intermediate reault.
- Operations on larger expressions with more terms.
- Basic operations on more digits.
I basically didn't do much maths for a year, but improved by a 40%+ by practicing something seemingly unrelated.
by omani on 10/18/2024, 7:39:10 PM
what is this new trend lately of having aphantasia?
never read/heard this before from the HN audience.
bots are increasing on HN it seems.
by danjl on 10/19/2024, 1:45:42 AM
When I'm debugging, I imagine that there is a huge cartoon style 2000lb weight supported by a mish mash of random toothpicks and I have to stick my arm waaay underneath to remove a bit from the middle and replace it with a new, clean and sturdy toothpick.
by hackeraccount on 10/18/2024, 4:32:19 PM
A boulder at the bottom of a hill that I'm pushing up but the G.D. thing keeps falling down.
by tjalfi on 10/18/2024, 11:55:23 PM
I usually see a control flow graph with blocks of three-address code instructions.
by weard_beard on 10/18/2024, 4:50:51 PM
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.
by m463 on 10/18/2024, 11:24:42 PM
This reminds me of Temple Grandin's paper:
by dmead on 10/18/2024, 5:25:07 PM
I squishy spheres connected with tubes of its oo. If it's functional with combinator style I don't see anything but the characters because there are so few I don't need to imagine anything.
by ilrwbwrkhv on 10/18/2024, 4:32:47 PM
I don't see any charts or 2d stuff. I see 3d globs and cities.
by arnonejoe on 10/18/2024, 5:05:14 PM
Where I am at in the call stack. Esp for back end api dev.
by jareklupinski on 10/18/2024, 4:32:12 PM
i visualize a little version of a former manager sitting in my head
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
by entaloneralie on 10/18/2024, 8:04:58 PM
I program with stack machines directly, so I visualize plates with numbers, names or things on them.
by wturner on 10/18/2024, 5:22:42 PM
Reading about ML, I can't help but visualize dynamic pin art as being analogous.
by Log_out_ on 10/19/2024, 4:25:35 PM
its particless falling filtered, combined,redirected inwards and then rube goldberged ourwards..the flow is a given but some marble madness contraptions are more elegant and continuous
by jmorenoamor on 10/19/2024, 12:15:56 PM
The function that calls the function I'm currently working in
by copperroof on 10/18/2024, 5:05:46 PM
Nothing.
by cherryteastain on 10/18/2024, 4:40:58 PM
Tensors
by alphadang on 10/19/2024, 2:40:58 AM
Big booty Latinas
by JoeyBananas on 10/18/2024, 7:26:49 PM
Trees
by not_wyoming on 10/18/2024, 6:41:52 PM
Retirement
by dboreham on 10/18/2024, 6:38:12 PM
Money
by psychoslave on 10/18/2024, 7:41:30 PM
All I see now is blonde, brunette, redhead.
by ocular-rockular on 10/18/2024, 10:01:07 PM
Your mom. But seriously, nothing. Just the problem at hand. What's there to visualize when working on a job? It's not exactly an art and it's a lot closer to mathematics in regards to problem solving.
by cyberax on 10/18/2024, 5:59:43 PM
Nothing. For complex algorithms, I prefer to think in invariants: "this condition should hold here, so this variable must be that".
I guess, for me the only exception is the dynamic programming algorithms. I re-discovered the wave algorithm (aka Dijkstra's algorithm) for solving mazes while writing in BASIC at school, and since then, I tend to reformulate any dynamic programming task as a path search in a maze.
by joelignaatius on 10/19/2024, 6:28:02 PM
I'd be interested to know if code visualization were more useful for certain languages than others, specifically functional languages like elixir that specifically target data immutability.
I don't have aphantasia (I can picture people and things if I want to) but unless I'm building a user interface, my thinking is completely non-visual when I'm programming or thinking about systems or data.
When someone asks me to draw an architecture diagram or a diagram of our production infrastructure or whatever, I am very slow at it and the result is usually middling at best, because my mental model of those things has no geometric or spatial component at all.
To the article's point, I've can't recall ever finding a visualization of my actual code or architecture that helped me work through a problem. When I've tried, it has always just slowed me down because I constantly have to map back and forth between the picture and the native non-geometric version in my head.
That's not to say I never use any kind of visualization. Graphical representations of things like profiling results are convenient and useful to me. But they tend to be more like representations of numeric data than representations of systems or code.