Live data from Hacker News

What do you visualize while programming?

dillonshook.com

41–50 of 176 posts

Re: What do you visualize while programming?

#43
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.

Re: What do you visualize while programming?

#44
post #22

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…

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 any…

If you have not seen it I'd recommend watching Rich Hickey's talk on Hammock Driven Development: https://www.youtube.com/watch?v=f84n5oFoZBc

Re: What do you visualize while programming?

#46
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.

Re: What do you visualize while programming?

#48

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.

edit: here's the article that prompted me to reflect on this https://nrkbeta.no/2018/01/01/this-is-what-the-year-actually...

Re: What do you visualize while programming?

#49

A boulder at the bottom of a hill that I'm pushing up but the G.D. thing keeps falling down.

Don't fret — we must imagine you happy.

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.

Re: What do you visualize while programming?

#50
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.

Post reply on HN