Ask Slashdot: Is There a Way To Write Working Code By Drawing Flow Charts?
Slashdot reader dryriver writes:
There appear to be two main ways to write code today. One is with text-based languages ranging from BASIC to Python to C++. The other is to use a flow-based or dataflow programming-based visual programming language where you connect boxes or nodes with lines. What I have never (personally) come across is a way to program by drawing classical vertical (top to bottom) flow charts. Is there a programming environment that lets you do this...?
There are software tools that can turn, say, C code into a visual flow chart representation of said C code. Is there any way to do the opposite -- draw a flowchart, and have that flowchart turn into working C code?
Leave your best answers in the comments.
There are software tools that can turn, say, C code into a visual flow chart representation of said C code. Is there any way to do the opposite -- draw a flowchart, and have that flowchart turn into working C code?
Leave your best answers in the comments.
I mean, we have had UML now for going on 15 years. You can CERTAINLY generate code and other artifacts from some types of UML diagrams. None of these is all that much like a flowchart, and frankly flowcharts are essentially dead AFAIK. They really only ever worked well, if they ever did, on fairly straightforward procedural code. Back in the bad old days before Structured Programming and then OOP it wasn't all that uncommon to see people using them, but that was mainly because even fairly straightforward linear code was hard to understand when it was written in FORTRAN or COBOL. Such charts have little relevance in modern OO/functional coding where linear control flow is really not an issue.
"Malo periculosam, libertatem quam quietam servitutem." -- Jefferson
I'm a visually oriented person. For big-picture I can digest flowcharts and data diagrams easier than textual representations. I routinely use Visio. In the MSDOS days I used Interactive EasyFlow from HavenTree of Canada. The copyright notice / license agreement was worth the price of admission.
The Russians have won. They have made the world a cesspool of distrust, greed, fear and hate.
Yes, you absolutely can write code using flowcharts, and I've got two practical examples from my career in videogames. Obviously, both were in specialized sub-domains, as the bulk of our general work is in C++.
First example: I worked at a place that allowed artists to wire up nodes in Maya using a circuit-like logic system. For input, they'd use timers, triggers, environmental sources (time of day), etc. Then they'd connect those inputs to various logic gate nodes (AND, OR, math, branching, delays, etc), and then to various output nodes that would affect the game world in various ways, such as triggering animations, environments, music/sound effects, and so on. This gave artists an incredible amount of power to shape the world if they were clever enough with their wiring skills, and all without programmer support. It was telling, though, that we eventually added a "Lua Script" node, because sometimes complex logic is really hard to do with circuit-type wiring.
Second example: In widespread use today, many game developers generate HLSL shader code using visual tools. Again, the same sort of logical wiring occurs. The connections represents an RGBA color source, or maybe a vector, while the nodes represent methods to transform that data. To blend two color sources together, for example, you pick a particular blending operation node, then just visually connect the sources and output. The visual programming paradigm means that technical artists can use this system rather than programmers, allowing them to tune their materials exactly how they'd like.
This sort of visual programming works really well when dealing with data flow in a fairly constrained environment. Other real-world examples include creation of sophisticated virtual musical instruments using visual programming techniques. Native Instruments has some products that work this way, like Reaktor. Example: https://www.native-instruments...
Irony: Agile development has too much intertia to be abandoned now.
It was telling, though, that we eventually added a "Lua Script" node, because sometimes complex logic is really hard to do with circuit-type wiring.
There's a nice quote by Alan Perlis: "A picture is worth 10K words - but only those to describe the picture. Hardly any sets of 10K words can be adequately described with pictures."
Ezekiel 23:20