Further on node-based UIs, and actually looking fo...
# present-company
y
Further on node-based UIs, and actually looking for judgement for a change: does anyone else find themselves mainly frustrated by the layout problems, such as... • frequently needing to move sets of nodes around to make the layout more comprehensible/memorable • no easy way to add nodes in the middle of a flow without having to reorganise • zooming out far enough to get a good sense of the overall layout leaves you unable to read any labels ... and how often these UIs just leave these problems as exercises for the user, without any automated assistance? I love the idea of node-based code, but in practice I've yet to see systems like this that are as readable as well laid-out and formatted code. Don't get me wrong, I think most traditional textual code could be laid out and formatted much better too, but in general I find it easier to scan and understand the top-down flow of textual code than nodes. Maybe I just haven't seen the right tools which do this better? Or maybe I'm in a tiny minority? What do folks here think? (And please forgive me if this conversation has been done to death in this Slack already, I've not seen it.)
a
I don't know that I'd say I'm "mainly frustrated by layout problems"... but that's largely because I'm also frustrated by so many other things. 😅
I absolutely do agree with those points though
My interest in the area is driven by the increasing presence of these types of tools in more business systems where I need to interact with them and have learned to deeply resent the general breadth and quality of the tooling
j
Have you listened to @Ivan Reese’s hest podcast? He talks about all these kinds of problems https://ivanish.ca/hest-podcast/
y
@Jimmy Miller I haven't, thanks for the tip! Any particular episode, and is there a transcript?
j
There’s no transcript. I’d definitely recommend starting from the beginning personally. It is definitely a progression of Ivan exploring what he wants out of hest. But I’ll also let him reply since he is currently typing
i
@yoz I'll butt in — I don't remember which episodes contain which thoughts, and yeah there's no transcript, sorry. But this notion that the interfaces to existing visual programming tools are dreadfully lacklustre is a significant motivator of my work. In addition to the podcast, I've done some writing about these things, and would love to dig into this subject with you. One quick hit — you mentioned "these UIs just leave these problems as exercises for the user, without any automated assistance." I'm strongly of the opinion that, say, force-directed layout of nodes is directionally wrong. But I'm also in favor of assistance. Max/MSP has a couple of "clean up my layout for me" tools, for instance, which are fine on principal but (last I used them ~3 years ago) woefully underdeveloped. I long to see someone take the approach to a visual programming interface that, say, Steve Ruiz took with tldraw, or @Elliot took with his carrot editors — sweating every tiny detail of the interactions, trying to make something that feels so right it disappears.
One other quick one — you mentioned "zooming out far enough to get a good sense of the overall layout leaves you unable to read any labels". Yeah, this is baffling. Like, the fact that visual programming (at least of the node-wire style) typically takes place in a zoomable canvas ought to be a superpower! Like, zooming out from text code is pretty useful (eg: minimaps, or stuff like Makepad, or in some sense code folding), and that only leverages the accidental geometry of the syntax. If you're in a graphical canvas, you should be able to do so much more with the sense of scale.
o
In text you also frequently rearrange lines of text, split them to multiple lines extract a function, rename variables etc. All changes that have no effect, just to make it more pleasing, more readable. Arranging nodes is the same. It actually helps me to think and get into the flow. As for zooming out, even if I can't read any labels, I find it easier to read a graph, as I can quickly spot a "neighborhood" and be reminded what I've done there. While a text minimap is less distinct. But you do have to zoom out more often, as nodes are less compact.
y
I'm wary of going deeper into the issues I perceive with VPLs given my lack of experience with them. I'd love to see some examples of really good VPL code that shows the strengths of the format.
o
No it doesn't help with a graph I haven't seen. Different people may prefer different layouts even. Just like in textual code. To understand a graph, live coding is what helps the most. That is really the number one reason nodes and wires even exist and are so popular! Jump into every part of a program and see and edit the data. I take that over any inconveniences of nodes and wires. (for some domains?)
i
@yoz have you played with Max/MSP? It's one of the more polished node-wire GUIs out there. They've done some good work to support lots of different editing interactions.
g
I’m in the minority here, but, FWIW ... I conclude that VPLs are a much better way to program than using text-only programming languages. After all, text-only PLs are, but, 1950’s caveman IDEs for programming. I conclude that auto-layout is downright evil and counter-productive. ... my thoughts ... https://guitarvydas.github.io/2023/11/19/The-Meaning-of-Layout.html
a
I’m in the minority here, but, FWIW ...
I'm not sure about that. I even sympathize with a lot of this from a certain perspective, despite generally disagreeing with most of your conclusions. Not gonna nit-pick everything, but can't resist this one:
text-only PLs are, but, 1950’s caveman IDEs for programming
yeah, like scratching surfaces with pointy sticks is actual caveman's IDE for writing, yet I still do the same thing every day with a just slightly more advanced pointy stick, and it would still be a loss to leave it behind despite all the newer tools available. 😄 There's a lot of "horses for courses" in tool selection. On the overall point; like I said I think I at least understand the thought process when I look at it from the perspective of the art and craft of programming. I feel a lot of The Architect's pride in their craftsmanship coming through in that. But when I look at it from the perspective of the actual trade of writing software... giving the infinite flexibility of The Architect's powerful tools for daily work feels a bit like handing out 12 gauge shotguns to a classroom full of kindergartners to swat a fly. Will they kill it? Sure, but I wouldn't want to see the collateral damage that will come along with that.
j
zooming out from text code is pretty useful (eg: minimaps, or stuff like Makepad, or in some sense code folding)
🤔 You could imagine a few useful “zoom” levels in a text editor: • all text • fold everything that is multiply indented • keep only top-level stuff, current file only • keep top-level stuff, but show all files in directory • show full file hierarchy, with each file associated with its top-of-file comment (if any) Maybe you could even edit the sufficiently “zoomed out” documents to do file renames?
g
• observation: writing prose has a different purpose than writing equations • observation: writing equations has a different purpose from commanding electronic machines • observation: writing for the purposes of explaining the purpose of sequences of commands to other humans is different from the purpose of commanding electronic machines • opinion: electronic machines read and interpret sequential code, people shouldn’t have to • observation: making drawings on cave walls, using pointy sticks on clay tablets, and, using opaque dyes on papyrus were tried; dyes and papyrus won out due to the limitations of the other kinds of media • observation: writing equations became less expressive when the printing press was invented, writing programs became less expressive when EBCDIC and, then, ASCII became the media for expressing sequences of commands (

The Story of the Vinculum (I believe that this was posted to FoC by someone, but I can’t find the post)

) • observation: before the advent of non-overlapping grids of small bitmaps called “characters” coupled with banks of switches called “QWERTY keyboards”, IDEs for commanding machines (aka “programming”) consisted of banks of toggle switches, and/or, soldering stations coupled with various kinds of meters and oscilloscopes ; “programming” - commanding electronics - was around well before the advent of textual programming languages, but, using soft-switches rather than hard-physical-switches turned out to be more convenient • opinion: “programming” consists of two activities, neither of which are the same as other kinds of activities (e.g. writing prose, and, e.g. analysis of phenomena using mathematical equations), i.e. 1. commanding machines, 2. communicating the purpose of the commands to other humans ... conflating the two activities leads to unnecessary hardship
o
I completely agree with your last point @guitarvydas. Programmers seem to be really quick to point out the "single responsibility principle" and SOLID. But fail to see that code serves two different purposes. Trying to make code readable, can be at best a Band-Aid.
I do think that text serves us very well when writing (simple?) expressions. Ever tried to do "node and wire" for example "c = sqrt(a * a + b * b)". You'll need at least 4 nodes and 7 wires.
y
@Ivan Reese I've never used Max/MSP but I've heard about it for years, usually in the same breath as PureData (though that seems to be less popular now). There's a lovely big animation of UI on the Max front page which has so much stuff that I don't see in most VPLs, and at this point I just need to pause for a
warning that I'm about to do a deeply uninformed yet loudly opinionated dive
based on the lightest of first impressions...
• Most obviously: visually distinctive widgets in the node graph. They're gorgeous and useful and aren't just Text But In A Box, which is what most VPLs seem to be made of. a. Even better, those widgets go beyond most VPLs by not just describing what the code should do but showing what it is actually doing during the running of the program. And even better, they give custom controls for manipulation during perfor... sorry, I mean: execution! b. And, OK, that live performance thing is much more for artists, so let's stick with the visualisation part: I'm kind of obsessed with the debugger experience every time I take on a programming tool. Being able to see the data flowing through code, with appropriate visualisation depending on the component, would be bloody amazing. I want more of that. Which VPLs are good at that? (serious question, I'd love to find some)
And then the expand/contract things happen and oh well, there's all the Text But In A Box nodes, life without them was nice while it lasted. But to give them credit, the text there seems to be doing the right job: evaluating expressions that are but easier to type than draw, as @oPOKtdJ4UbTdPaZig6jg just mentioned. So the balance between widget types makes sense. I just wish there was more visual distinctiveness there.
The worst part is that I see all these connecting lines of different textures, and I assume they're unidirectional but I have no clue what those directions are or what order this is all happening in. Also, the layout seems to be completely arbitrary: I assume that what I'm looking at is one person's setup, and they already understand the flow. It feels like a good demonstration of the difference between code that's entirely owned and maintained by one person, and code for a team. (Similar to the point @guitarvydas made about the difference between commanding machines and communicating to humans.)
@guitarvydas Thanks so much for the amazing collection of points in your blog post. There's so much here! Ultimately I feel like we agree on these points (but please correct me): 1. VPLs as a concept have incredible potential 2. We have yet to find tools good enough for programming in them 3. Architects should be able to express structures that, when zoomed out, are readable and understandable (... to visual programmers with some experience of the patterns, at least) a. As you zoom out on a system, the view should maintain a low total number of different objects you need to understand. Sub-structures should appear as a single component/device, hiding their complexity. (I'm thinking of the Eames's famous "

Powers of Ten

" film here.) 4. We don't yet have decent theory or language for how to achieve #3, beyond some basic arrangement ideas
g
a
@guitarvydas, since you mention using drawio for some of your stuff: Do you know of a good source of docs for the file format or an existing library for parsing/working with it? I happen to be dealing with it at work right now, and have just been trial & erroring it so far because nothing obvious came up and this is kind of throwaway code anyway... but would love to lean on something more robust if it exists
g
@abeyer Zac Nowicki is more expert at this than I am. He wrote the code for odin0d. (I can give you a github repo link, if you think that would help). Here is a paraphrased version of Zac’s comments: The general format is an XML encoding of mxGraph. You may be able to use that as key terms to find some resources. The format tends to be mostly straightforward to consume with any off the shelf XML parser, using xpaths, etc. My recommendation for iterating quickly / exploring the output is doing some edits then opening Extras -> Edit Diagram to view the XML for the current page only. drawio tends to stuff a lot of things you might be interested in in the “style” attribute on nodes. Check there if you don’t see a specific attribute.
a
Thanks, yeah, the mxgraph pointer was the trick, turned up some decent docs
Still didn't explain the weird inversion it does when adding properties, but must be just a quirk of the format ¯\_(ツ)_/¯
g
@abeyer I don’t fully understand what this “weird inversion” is. If you can give me more detail (or a screenshot or something), then I will bounce it off of Zac and see if he has any comments…
a
I think I've got it sorted, but the thing I noticed was that normally in mxgraph you would set custom data properties on a vertex in the
mxcell
's
value
and if you haven't set any properties from drawio it includes
value
as an attribute, but as soon as you do it then removes the value attribute completely and wraps the cell in a parent object containing its label and properties
Not how I would have serialized that... But seems to be working once I look at both cells and wrapper objects containing cells+properties