by andybak · 3y ago · 0 comments
I think the core problem is that - unlike text-based programming - the editor is intimitely tied to the rest of the authoring environment and runtime. Sometimes it is the entire authoring environment.
Text coding benefits from standardised tools that are decoupled from the applications they serve and interoperability. You want to write your Rust in nano? Go right ahead? Want to write some lua that does bulk edits to your COBOL library. Fab.
More importantly is that we learn the tools and keyboard shortcuts and those skills transfer to new languages and environments.
The main issues would be mitigated by:
a) some standardized UI conventions
b) all visual programming tools offering lossless round-tripping to textual representation (it doesn't have to be tuned for human writability - it just needs to be sane)
B also helps with the other big flaw with visual programming - the way it breaks version control workflows. I heard from an Unreal dev that even opening a blueprint and highlighting a different node will change the file. That must be fun when it comes time to merge...
I could write reams on this topic. I want visual programming to be better - I think it has unique strengths. But currently it has two niches:
1. People that can't bring themselves to learn text-based coding.
2. Tasks where discoverability and immediacy trump all the disadvantages.
After all, we use lots of comments to give some structure to text-based coding.
There was a post about https://github.com/samuelmtimbo/unit recently, which at least uses some kind of hinted auto-layout (besides the more propriety fancy)
I really want to see more graphical coding for years, but node/graph-based and blockly seem to be the only approaches that got sone traction so far. So I like this thread and it seems at the right place.
I'd wish to see more use of 2D and now 3D space for structuring, annotation and overall overview and navigation. Text plus a directory tree view can't be everything, especially since we have so many structural views for coding, runtime, versioning that basically are connected in our mind, but also could be in a space with more dimensions. Not sure if we could find/agree on a common denominator, though. Text is one because it's basically the bottom of common ground. Not sure if that's not just the trivial solution (ok, I am).
Some people write, others draw. Each method has its own strength and problem spaces.
Encoding a complex issue sometimes is just shitty with a visual metaphor. Other times writing code is a really bad idea. If you want to express “flow” or “connections”, filter or stream systems like modular synths, that’s when the visual metaphor shines.
You use whatever metaphor works best at the moment. One cannot replace the other.
The “problem” is that people want to push all of “programming” into the visual metaphor. That’s like pushing all of programming into only functional, only declarative, only imperative or only OOP (or whatever), but worse. That’s not going to work, but I guess people can try.
It could be a failure of my imagination. I’ve designed similar things though, and these weird cases (especially temporal cases) become extremely hard to represent more universally. I suppose you could offer a “timeline” to indicate how things would behave on a time scale, but even that… I just don’t know.
It also seems key to have a node-based editor work with one language or a set which map together extremely well.
There's definitively some hard limitation in dimension, though, so there might be the idea that, if one can only show problems of a certain limited complexity visually, why not do all the lousy (text-based, relational/reference-based way) but universal way that at least can be stored and edited everywhere.
So a central question might be: can we have a universal gain from, let's say, a three dimensional notation that still does not limit the problem space to these dimension.
I suspect it would quickly become too complex, but there's plenty of people smarter than me...
Imagine asking Stackoverflow about a coding problem that involves a visual node structure and code attached to some of them.
So yes, the round tripping is essential, but it also needs people to understand and be able to talk about the code in its textual form.
I came to the conclusion that realistically these tools will always be severely limited unless they focus on being good automated visualisation tools of syntax that is text first.
I'd like to be wrong about that, by the way.
[0]: https://enso.org/
A graph editor is a large undertaking, having a few generic ones would avoid so much duplicate work. Having a generic graph editor would also allow an extension system to develop around it.
Each application would just need to implement the specific server protocol which does game rendering etc...
Does not sound like the core problem to me. Computers used to be like that: everything was tied to the OS and compiler. That didn't stop banks from developing pretty complex systems.
IMO, the problem is that visual programming, despite its name, is visually a mess. You can't read it, you can't orient yourself in it. It's not structured, for starters. And piping an input through a sin function takes up 10 times the screen space of Math.sin(x), especially if you then have to keep that node's output from overlapping other parts. And you always must search back where the input to a node comes from, whereas in textual programs, you can put that information in the variable name. It's just not suitable to our way of thinking in chunks.
Visual programming presents huge challenges.
> Text coding benefits from standardised tools
That's the biggest, IMO. Some degree of text processing is essentially universal to computing after the early 1950's. As you mention, that provides a huge amount of prior art in editors, source code control systems, various kinds of messaging, display tools... the list goes on and on. Textual languages can natively reuse all of this. Graphical languages need some sort of mapping to text in order to use tools that do not quite fit the way they work.
The other challenge is the way visual programming complicates the mechanics of the job. Laying source out in (~) one dimension is hard, laying it out in two dimensions is harder. Naming a function is hard, drawing a representative icon for a function is harder.
You also lose the notion of linear ordering when you move from a list of statements to a 2D graph of nodes. This is useful when you're modeling a data flow graph or a state machine, but harder when you want to express a branch or a loop.
What does an algorithm look like?
Herman Hesse alluded to this in his novel _The Glass Bead Game_, but despite decades of discussion and work, no one has made a convincing pysical representation of that system.
I love the concept, and have made some moderately complex attempts, e.g.,:
https://www.blockscad3d.com/community/projects/1430644
https://github.com/WillAdams/gcodepreview
it always devolves to screen size being out-paced by problem complexity --- one gets something of an inkling of this at:
https://scriptsofanotherdimension.tumblr.com/
Alternately, one can just break a project down into modules, but then the top-level view becomes the wall of text representation (albeit w/ nice lines or captured into pretty boxes) which one is ostensibly trying to escape.
I'd love to see someone succeed in this, and I've been using:
https://github.com/derkork/openscad-graph-editor
quite a bit, and put a bit of money towards:
It helps to think of unix pipes when working with Node-RED, but when working with state machines to think of wiring on a circuit board. I wrote down my ideas in blog[3] - if anyone has more representation, please share!
[1]=https://noisecraft.app/ [2]=https://nodered.org [3]=https://blog.openmindmap.org/blog/pipes-wires-nodes
Imagine I was a consultant who offered to sit and watch over your shoulder and comment only on syntax issues. If you make a syntax mistake, I will help you fix it; "you need a closing paren here". I will also offer syntax tips constantly while you work; "looks like your going to create a list, first choose what you want the first item in the list to be". You should expect to be a little slower in exchange for these consultations I offer. Would you hire me?
These are essentially the tradeoffs offered by visual programming. Slower work for syntax level help. And visual languages often have some premium cost to them.
People doing significant programming don't need syntax level help.
What I learned was that when a problem domain needed a visual representation they had already created it (using pencil and paper, decades ago). Think of schematic diagrams, piping and instrumentation diagrams and such. In those cases we were very successful. In cases where no such diagrams exist, we always failed to create one that stuck with the users. Text is great for code because is is extremely compact and takes advantage of things like visual rhyme. Uml, for example, can never achieve the same results
Most kinds of software don’t need these things but if you’re writing code that generates graphics or audio signals then you do, because you get to manipulate your program and see/hear effects in real-time, and also seeing how different parts of your program connects together is more important than giving names to them (where there may not be a useful name you can give them anyway)
Theoretically you might be able achieve these things with only a textual representation and it could be best of both worlds
I can't imagine a situation where given the choice (and assuming sufficient familiarity to be fluent) I would choose a node-based system over writing code. As I said earlier - the main advantage is discoverability (plus a certain robustness against making errors which arise from the constraints).
Discoverability is cancelled out by familiarity and if I'm going to use a tool seriously then I will become familiar with it.
Every other aspect of visual programming is a disadvantage and in many cases a crippling one. The sheer laboriousness of constructing expressions, the lack of sophisticated refactoring and the amount of busywork tidying up nodes so they aren't a jumble of spaghetti.
I think these are solvable but not until there's a way to avoid reinventing the wheel for every single system.
The textual representation doesn't have to be the primary way of interacting with the program and it doesn't need to be optimal for everyday use - but it should be sane and visually comprehensible when the need arises.