Just a random thought that has been rattling around in my head while listening through podcast episodes and Ivan’s visual programing points. I am new here so apologies If all this has been said before, or covered in podcasts I haven’t gotten to yet.
I want to propose a slightly different framing for what it means to say that a representation of a program is visual / spatial or not
I think that textual programming is visual. It’s a series of symbols laid out on a screen in rows, and the spatial/visual relationship between the tokens does actually correspond to aspects of the operation of the program. For example an assignment statement has the thing being assigned to on the left, and the value on the right, parentheses group things together spatially on the screen, statements that appear above others within a block (usually) execute before the ones below (goto considered harmful breaks that down which I think you talked about). And good code formatting is mostly about making these visual analogies stronger. Zig plays with this by allowing you to release memory the line below where you have allocated it, which breaks down the time
- up down analogy since the deallocation actually happens after the lines that follow, in favor of being able to spatially group two very semantically related statements in the program. That shows that there’s a lot to be played with within the context of textual programming if you think about in terms of spatial analogies to your program.
To explore this more though, it’s interesting to think about how a program could be represented completely
non-spatially or
non-visually, and how these two things might differ.
You could imagine being read the textual code for some program aloud, without seeing the text at all, that would be a non-spatial, and non-visual representation of the program
You could also imagine seeing a single visual element, like a black circle on a screen or something, blinking on and off in morse code to transmit the code to you. To me that would be a visual representation that is not spatial, since the spatial dimensions of that single visual element don’t matter at all to the information being transmitted. It could be an array of dots or an image of some crazy person’s pure data patch or anything at all blinking on and off and the program being transmitted would be the same.
So what would a representation of a program look like that is
minimally spatial? Maybe you could imagine two dots on the screen that encode a two bit piece of a textual program encoded in unicode, one two bit portion at a time? They flash on with the first two bits for a second, then the second two bits for a second blah blah blah (so practical!) Is this spatial?
There is a lot to explore here actually I think. Technically the particular spatial relationships of the pixels on the screen
does need to be considered in order to decipher the program in the two dots scenario, and that is qualitatively different from the one dot scenario, where no information is gained from examining any spatial relationships.
But I am skeptical of whether or not this is actually minimally spatial. It seems like we should define a spatial representation of a program to mean that some
meaningful part of the program is represented spatially, and I don’t think “a two bit portion of a unicode character making up a textual program” meets that criteria. But Is this “meaningful vs non meaningful part of a program representation” a distinction that can even be clearly drawn? It seems obvious that there is at least a real quantitative difference if not a qualitative difference there. If the difference is only quantitative, then this two bit program would have to be a minimally (if highly unsatisfying) spatial representation of a program, but maybe there is some way to formally filter out non meaningful parts of a a program’s representation that are only essential to the representation of the program and not to the program itself?
But like was pointed out in the No Silver Bullets episode, there are a huge number of different ways to visualize the same program. I think that we are stuck in a single way of visualizing our programs - which is the code, and to me the problem is not that code is bad, but that we are missing out on a huge number of different ways we could visualize and “reason about” (lol) our programs, so I’m not disagreeing with the actual takeaway, it’s more a critique of the hard division between textual and visual programming.