News for hackers. Stuff that matters.
Re:We need visual programming. No, not like that by jampekka on Sunday July 14, 2024 @07:59PM (#40964184)
The fundamental problem in visual programming is that it limits you to geometry (practically to 2D euclidian space). Most non-trivial programming problems are spaghetti by nature in such spaces.
Re:We need visual programming. No, not like that by hackit2 on Sunday July 14, 2024 @08:17PM (#40964289)
Mapping to a plane doesn't help you understand how state changes occur over time, or what is the over-all state of the state-machine is.

The only time I've seen visual programming work is when the state is immutable. How-ever it requires a major paradigm shift how one design, develop and test their programs.

Re:We need visual programming. No, not like that by RogerL on Sunday July 14, 2024 @10:22PM (#40964799)
it's pretty basic topology - embedding versus immersion. you cannot embed anything but the simplest software in a 2d plane. you end up having to endlessly try to structure things to minimize line crossings, make multiple diagrams of the same code to capture different aspects of it, or otherwise perform perversions just so it fits on a page.

And I live through this. most of my early career was DoD related in the early '90s, when things like functional analysis was all the rage. endless pages of circles and lines which were more confusing than helpful, and certainly didn't actually capture what the software had to do. Bever again.

Re:We need visual programming. No, not like that by hackit2 on Monday July 15, 2024 @12:10AM (#40965214)
I agree with you how-ever the elephant in the room is a image or topology doesn't predicate anything (A predicate is seen as a property that a subject has or is characterized by). That is the main delineation between them, and why SPO (subject predicate object) is used universality by all modern languages - abet some have different svo ordering but I digress.

The next major draw-back with visual programming is they don't explicitly convey time. You have to infer it via lines or sequence of diagram blocks. Were in a programming language you have sequential order of execution eg. left to right, top to down of of the program flow and stage change. If you attempt to achieve the same with a stateless event driven bus or message queue, you end up having to embed the sequential control flow into the event payload itself.

Re:We need visual programming. No, not like that by mapcars on Sunday July 14, 2024 @08:13PM (#40964268)
That is not a problem, and for sure not a fundamental one. The textual representation is very limited, it's actually 1D with a line breaks helping us read it. 2D gives a lot more possibilities of organising code similar to how we draw diagrams on a whiteboard.
Re:We need visual programming. No, not like that by jampekka on Sunday July 14, 2024 @08:23PM (#40964318)
Power of text or other symbols is that they aren't spatially bounded. That's why it works even in "1D".

There are probably some possible usability gains from adding dimensions. E.g. node-type "programming" in Blender is quite nice. But for general purpose progamming it's hard to see how we'd get rid of symbolic representation.

Re:We need visual programming. No, not like that by andrewflnr on Sunday July 14, 2024 @08:28PM (#40964336)
Specifically, textual programs use symbols to build a graph of references between computations, where the average visual language tries to use explicit lines between blocks. But the reference graphs of non-trivial programs are often decidedly non-planar, which only becomes a problem when you try to lay them out on a plane.
Re:We need visual programming. No, not like that by lolinder on Sunday July 14, 2024 @08:39PM (#40964401)
Why does laying out code on a line not cause a problem with spatial reasoning but a plane would? Are we somehow incapable of applying spatial abstractions when we move up into a higher dimension than 1?
Re:We need visual programming. No, not like that by dimask on Sunday July 14, 2024 @09:42PM (#40964650)
The spatial reasoning on reading code does not happen on the dimensions of the literal text, at least not only on these. It happens in how we interpret the code and build relations in our minds while doing so. So I think that the problem is not about the spatial reasoning of what we literally see per se, but if the specific representation helps in something. I like visual representations for the explanatory value they can offer, but if one tries to work rigorously on a kind of spatial algebra of these, then this explanatory power can be lost after some point of complexity. I guess there may be contexts where a visual language may be working well. But in the contexts I have encountered I have not found them helpful. If anything, the more complex a problem is, the more cluttered the visual language form ends up being, and feels overloading my visual memory. I do not think it is a geometric feature or advantage per se, but about how brains of some people work. I like visual representations and I am in general a quite visual thinker, but I do not want to see all these miniscule details in there, I want to them to represent what I want to understand. Text, on the other hand, serves better as a form of (human-related) compression of information, imo, which makes it better for working on these details there.
Re:We need visual programming. No, not like that by mapcars on Monday July 15, 2024 @07:03AM (#40966760)
> If anything, the more complex a problem is, the more cluttered the visual language form ends up being, and feels overloading my visual memory

I feel like you are more concerned about implementation than the idea itself. For me it's the opposite - I find it's easier to understand small pieces of text, but making sense of hundreds of 1k lines files is super hard.

Visual programming in my understanding should allow us to "zoom" in and out on any level and have a digestible overview of the system.

Here is an example of visual-first platform that I know is used for large industrial systems, and it allows viewing different flows separately and zooming into details of any specific piece of logic, I think it's a good example of how visual programming can be: https://youtu.be/CTZeKQ1ypPI?si=DX3bQSiDLew5wvqF&t=953

Re:We need visual programming. No, not like that by andrewflnr on Sunday July 14, 2024 @11:11PM (#40964981)
As jampekka put it, text isn't trying to use spatial abstractions, it's using the (arguably more powerful) abstraction of named values/computations. Hard to think about? Yes, there's a learning curve to say the least. But it seems to be worth it for a lot of cases.
Re:We need visual programming. No, not like that by jampekka on Sunday July 14, 2024 @08:54PM (#40964452)
Text doesn't use spatial abstractions.

The problem with spatializing complex relationsips becomes very apparent when one tries to lay out graphs (as in nodes-and-edges) graphically. Unless the relationships are somehow greatly restricted (e.g. a family tree), the layouts become a total mess, as the connectedness of the nodes can't be mapped to distances and the edges by necessity have to make a lot of crossings on top of each other.

Re:We need visual programming. No, not like that by mapcars on Monday July 15, 2024 @07:10AM (#40966790)
I think you are limiting visual programming to some sort of a single graph that has everything together, but similar to how we split code into modules and files, visual systems can do the same, here's an example I keep showing in this thread of a visual programming system that works pretty well: https://youtu.be/CTZeKQ1ypPI?si=DX3bQSiDLew5wvqF&t=953
Re:We need visual programming. No, not like that by edflsafoiewq on Sunday July 14, 2024 @08:51PM (#40964441)
Writing is based on speech, which is one-dimensional. Most programming is actually already highly two-dimensional thanks to its heavy line orientation.

But most visual programming isn't trying to be a kind of "2D orthography" for language, it is trying to be a "picture" of a physical mechanism.

Re:We need visual programming. No, not like that by eimrine on Tuesday July 16, 2024 @11:14AM (#40977349)
That 2D orthography idea is my pipe dream. Any time I am writing several similar lines of code but with variables having different length I always want my IDE to be acknowledged that some 1-symbol operators would be looking so nice if aligned in one vertical line.
Re:We need visual programming. No, not like that by lolinder on Sunday July 14, 2024 @08:38PM (#40964388)
So why not do 2D visual programming with access to symbols that are not spatially bound? Is there any reason why a 2D plane forces the programmer to think in terms of a plane that doesn't also apply to a 1D line of text?

It seems to me that reducing the frequency with which programmers have to drop into non-spatial symbols would be beneficial even if there are still use cases where they have to.

Re:We need visual programming. No, not like that by edflsafoiewq on Sunday July 14, 2024 @08:40PM (#40964403)
The problem with visual programming is it abandons the fundamental principle of language, whereby to connect two objects it is necessary only to speak their names, in favor of the principle of physicality, whereby to connect two objects it is necessary that they be in physical contact, ie. to be joined by a wire.
Re:We need visual programming. No, not like that by lolinder on Sunday July 14, 2024 @09:51PM (#40964681)
Is that an inherent problem of the medium or the result of people trying too hard to completely change the paradigm?
Re:We need visual programming. No, not like that by mapcars on Monday July 15, 2024 @06:50AM (#40966703)
> only to speak their names

> in physical contact, ie. to be joined by a wire.

I don't really see how that is different, in any given language the name alone is not enough to refer to the object, in general case you have to import it. For me the process of name resolution and connecting by a wire is the same thing with different representations.

Re:We need visual programming. No, not like that by lioeters on Monday July 15, 2024 @12:39PM (#40969375)
> to connect two objects it is necessary that they be in physical contact

I can imagine a way to connect an object to another by selecting the latter's name from a drop-down menu of defined objects. A visual equivalent of a function call.

Re:We need visual programming. No, not like that by ozim on Monday July 15, 2024 @01:53AM (#40965583)
With text/symbolic representation I can describe any amount of dimensions in a super dense way and physicist/mathematicians are doing that, software devs as well because most software is multidimensional.

You do have graphs in mathematics but all the maths I see is about describing reality in really dense couple of symbols, compressing as much of the universe as possible to something like E=mc^2.

Graphical programming representations go the other way - it actually tries to use more bits to describe something that can be described in less bits - many more bits.

Re:We need visual programming. No, not like that by lukev on Sunday July 14, 2024 @08:12PM (#40964260)
I got the Apple Vision Pro with the hope to tinker with such things. Is one more dimension enough to "unlock" visual programming? I don't know, and unfortunately not many seem interested in exploring it.
Re:We need visual programming. No, not like that by jampekka on Sunday July 14, 2024 @08:18PM (#40964295)
I don't think extra dimensions help. Even simple functions have easily tens of interconnected references and representing these spatially is gonna be a mess even in higher dimensions.
Re:We need visual programming. No, not like that by beefnugs on Sunday July 14, 2024 @10:56PM (#40964929)
I personally wont ever be interested in VR until it has "generic computing" as a major feature.

like automatically creating a 3d world showing pipes as your internet connections, some kind of switches and buttons and things as every single thing you can do with your computer including complicated ass command line and GUI windows.

And all the tools necessary to reduce or increase the complexity of it as I see fit as a user

Re:We need visual programming. No, not like that by vbezhenar on Sunday July 14, 2024 @08:06PM (#40964220)
But program code is 2D as well. And quite limited 2D, with 80 characters width max (or similar, but never unlimited).
Re:We need visual programming. No, not like that by lukev on Sunday July 14, 2024 @08:15PM (#40964275)
You could argue it's 1d, actually, since sequence is fundamental, not positioning on the x axis.

At any rate it's (mostly+) categorically different from what visual programming attempts. Code must be read, comprehended, and a mental model built. Visual programming is designed to give a gestalt spatial intuition for code structure -- a different kind of comprehension.

+Indent and spacing between functions/methods does count as a tiny bit of visual programming IMO

Re:We need visual programming. No, not like that by scialex on Sunday July 14, 2024 @08:16PM (#40964282)
The fact you can give things names means that there is rarely a need to follow the edges so the visualization is much less cluttered
Re:We need visual programming. No, not like that by mapcars on Sunday July 14, 2024 @08:14PM (#40964270)
Nah, code is 1D with line breaks for visual comfort
Re:We need visual programming. No, not like that by SonOfLilit on Sunday July 14, 2024 @08:20PM (#40964307)
Code is 1d with named links.

Visual languages trade named links for global wiring, which is very cluttered for serious problem solving.

Re:We need visual programming. No, not like that by whstl on Sunday July 14, 2024 @09:02PM (#40964484)
> Visual languages trade named links for global wiring

Existing visual programming langs can definitely do "named links". A lot support named function-like blocks which are another form of avoiding wires.

> which is very cluttered for serious problem solving

This clutter is also problematic in textual programming, and is the reason abstractions and programming structures are used. Perhaps the hint here is that we need better ways of representing abstraction in visual programming.

Re:We need visual programming. No, not like that by Nathanba on Sunday July 14, 2024 @08:43PM (#40964412)
Code is not 1d, a single if() already creates another line that makes it 2d
Re:We need visual programming. No, not like that by mapcars on Monday July 15, 2024 @09:09AM (#40967572)
How is `if` related with creating a new line? And how does new line make something 2D? If code was 2D you could write code anywhere in your document without juggling around spaces and newlines
Re:We need visual programming. No, not like that by SonOfLilit on Tuesday July 16, 2024 @03:20PM (#40979427)
Mathematicians like to use parametrizations to measure "how |any dimensions" something has. If you need two indexes to traverse it (x and y), it's 2d, if a single index works best to describe it, it's 1d.

Another way to think of it is "there is semantic meaning to 'the character to the right/left of this one', but is there to 'the character above/below this one'?" In most programming languages, there isn't at all.

Re:We need visual programming. No, not like that by mdaniel on Sunday July 14, 2024 @08:21PM (#40964311)
And yet IDA and Ghidra use that same 2d representation structure for basic blocks (e.g. https://byte.how/images/ghidra-overview/graph-edges.png ) showing code flow between the blocks

I have had better-than-average success representing the high level sequence of computer-y actions using sequence diagrams, and suspect strongly my audience would not have the same comprehension if I used pseudocode or python or C++

Where I think the anti-visual programming audience and I can agree is the idea of a standard library, since a bunch of diagrams showing a "length" message being sent to a String object is for sure the wrong level of abstraction. In that way, I'd guess the DSL crowd would pipe up and say that is the same problem a DSL is trying to solve: express the code flow in terms of business nouns and verbs, and let the underlying framework deal with String.length nonsense

I've seen a hybrid approach to this in a few testing frameworks, such as Robot Framework <https://robotframework.org/robotframework/latest/RobotFramew...>

Re:We need visual programming. No, not like that by Jtsummers on Sunday July 14, 2024 @08:36PM (#40964372)
The reason it works out so well (contrary to many people's intuition) is that most programming is done in structured languages or in a structured-style these days. This significantly reduces the number of entry points (typically down to 1) for any block of code, though it can still have many exit points. Unless someone abuses something like Duff's device or uses goto's to jump into a block (and the language permits it), the flow diagrams like in the linked image end up being pretty tidy in practice.
Re:We need visual programming. No, not like that by jayd16 on Sunday July 14, 2024 @10:12PM (#40964766)
By this logic its strictly better than a linear textual document, no? In a graph you can explicitly draw lines between connections.
Re:We need visual programming. No, not like that by pjmlp on Monday July 15, 2024 @02:38AM (#40965734)
I would vouch a different take, visual programming makes it quite clear the mess of programs some people create when they don't follow modular programming.

Complex flows can be packaged into functions and modules representations, instead of dummping everything into a single screen.

Re:We need visual programming. No, not like that by frou_dh on Monday July 15, 2024 @04:19AM (#40966095)
Much like designing Integrated Circuit chips, vs. only doing basic breadboard-ing.
Re:We need visual programming. No, not like that by jampekka on Monday July 15, 2024 @06:39AM (#40966658)
The spatial (usually largely 2D in IC) constraints are a huge limitation for circuit design. I'm quite sure chips (or breadboards) wouldn't be designed like this if the physical world wouldn't force the geometry.
Re:We need visual programming. No, not like that by frou_dh on Monday July 15, 2024 @06:50AM (#40966704)
I meant more that the very concept of an IC is a good idea, and like a good abstraction in programming.

I think pjmlp was getting at is that when using visual programming, a lot of people seem to turn off (or not cultivate) the part of the thought process concerned with creating good abstractions, despite it at least being possible to do so.

Re:We need visual programming. No, not like that by pjmlp on Monday July 15, 2024 @09:07AM (#40967551)
Exactly, packaging transitors into IC Modules, so to speak.
Re:We need visual programming. No, not like that by pjmlp on Monday July 15, 2024 @05:19AM (#40966345)
Yes, very much so.