6 ms·
Trees are graphs with out cycles but you always end up adding cycles. Code is no exception. There have been endless attempts to create coding systems based on
by jcoffland 10y ago
Trees are graphs with out cycles but you always end up adding cycles. Code is no exception. There have been endless attempts to create coding systems based on graphs. These systems promise extraordinary modularity and reusability and an ease of programming which will allow anyone to construct complex software with a few clicks and drags. So far everyone of these systems that I have seen in the last 25 years has fallen short of its promises.
If you pay attention to these characteristics you will begin to notice the regularity with which such systems crop up and die. In my experience there's no use trying to talk enthusiasts out of this idea. I even attempted such a system myself many years ago. It's almost a rite of passage.
The reason tree editors (aka graph editors with out cycles, yet) don't work is similar to why we use relational DBs, instead of more the natural interpretation of data as graphs, boils down to, graph algorithms are slow and complex. In practice the added complexity outweighs the perceived benefits. The way people currently edit code, although not perfect, actually works really well. You have to weigh the costs of moving away from a simple system that works against the benefits and complexity of the new system.
- anigbrowl 10y agoHow do you feel about tools like Reaktor, which I assure you works very well indeed?
- jcoffland 10y agoReaktor is a audio program. There is actually a long history of this type of app working well. PD is an early example. This is indeed a limited type of programming. Above I was referring to attempts to apply this idea to general programming. I'm not saying such systems are impossible just that it's a bad idea to assume it will make the programmer's life easier.
- anigbrowl 10y agoThat's not very responsive. Reaktor's primary purpose is to produce audio, but it also allows one to build sequencers, user interfaces, graphics (eg spectrograms, from DSP primitives by build your own FFT modules) and all sorts of other tools. Besides, why is audio somehow an inferior sort of data processing?
- achamayou 10y agoSometimes not being able to add cycles is a design goal. For example if you're exposing a user-facing DSL and it's in the shared interest of the users and the backend that their scripts always terminate, perhaps even in a bounded amount of time/cycle. Just because a tool can't solve all problems in their generality doesn't make it automatically worthless, there are situations where less is truly more.
- MattRix 10y agoUnreal Engine 4 has Blueprint, which is a powerful node graph programming system. It works great and it's very popular. It's definitely worth looking at for anyone interested in this sort of thing. The "bi-directional flow" (exec nodes "push", data nodes "pull") makes it very flexible for almost any kind of task.