Introduction to OpenDX

2.5 The Visual Programming Paradigm
Visual programming is derived from a concept of programming called "data-flow". In data-flow programming, one conceptually puts data in at the top of the "pipe", and as the data flows down through the "network" of pipes, operations are performed on it at each stage. The modified results then flow down the next set of pipes to other functional modules where more operations are performed, and so on to the conclusion, where some form of output is created. While the concepts of data-flow may have originated earlier, the expression of it required interactive graphics capable displays (I first saw a data-flow program on a Mac in the late '80s).

 

Optional: View this Technical Aside if you want more detail on this subject; the information is not required to understand the upcoming material.

In data-flow visual programming, the programmer physically "draws" the program on the screen with the mouse cursor and employs only a small amount of keyboard entry of specific values. A DX program looks like this:

 

Sample DX program
By contrast, in traditional text-based programming systems like FORTRAN, C, Pascal, BASIC, etc., the programmer types the program on a keyboard. You've probably seen an example, like this:

/**********************************************************************
 *
 * File name: pad_number.c
 * Date:  07/24/92
 * Author: Chris Pelkie 
 * Description: Pads input to specified places with leading zeros
 * Add features:
 * Input: 
 * Output: 
 * Usage: pad_number N P  (where N is the number; P is the places)
 *
 *********************************************************************/

#include <stdio.h>
#include <string.h>


main( argc, argv )
int argc;
char **argv;
{
    fprintf( stdout, "%0*.*d\n",
    atoi(argv[2]), atoi(argv[2]), atoi(argv[1]) );
}

Visual programming isn't necessarily easier or harder than text-based programming, just different. Personally, I find it much faster to "sketch" a program out in DX, execute to get a quick result, then elaborate the program, thereby building up the output image with more features like colorbars, legends, axes, etc. In contrast, usually one must do a fair amount of typing to get even the first answer back from a traditional language, by setting up input and output, calling various libraries and so on, then (often) compiling, running, and entering inputs.