The connections between the abstract entities are the connections between the source code elements. That thing goes to `match` which gives me either this or that. It's more that the program is sort of graph-shaped (all about connections) than that I have linear grammar sentences in my head.
I could "serialize" the same mental model into various alternate syntaxes, e.g. assign to temporary variables or not, based on what feels right and has a good amount of things to think of at once (the good old no more than 7 rule).
I could write it out in multiple different orders, as long as data dependencies are fulfilled.
I definitely don't write programs as sentences like how I am writing this text right now. For example, I might first decide that I assign a placeholder `todo!()` to a local variable of a specific type (I know the "shape" it will be, no more), then use that value and return from the function, and then go back and figure out where that "something" could come from. Sometimes I have a couple of such sections and I "search" for the connections between them. My prose is much more linear.
I don't think I have much better means of expressing what goes inside my head than what that gives me. After all, language is the tool we're learned to communicate with. IDE-level helpers like rename all instances of this variable (now that I understand how I intend to use it) are useful, so I can literally name things a, b, c to describe a chain of processing and once I understand what I need to do, go back and easily rename them to something more descriptive.
Better code navigation and on-screen layout would be great. Like, what if functions aren't just sequentially in a file, but each one lives separately and can be opened in neighboring panes easily, to pick what you're looking at, instead of jumping around a "file". IDE "jump to definition" and API doc hints are related but not quite the same.
Outside of programming, being able to point at things to manipulate things and make connections is really powerful, but very hard to invent great UX for. I could see that sort of stuff being useful. Even in a text editor, I often wonder why exactly can't I drag a paragraph or a Markdown section (heading+everything under it) to move it. In gg the VCS GUI, you can drag commits between histories and changes between commits: https://www.youtube.com/watch?v=cD9L3Mi1Vy4 . In general, structural editing can be a great way to munge source code, there's definitely ways to improve over emacs paredit. I feel like there's some sort of untapped power in the combo of structural editing and a touchpad with haptic feedback, but maybe it'll take AR to make it intuitive enough. Think "gesture intents" popping up from the trackpad like long press pops up character variants on phone keyboards. Think swipe left/right and more for blocks of content, with UI feedback to confirm the action before release.