What are the benefits of computer programming

Visual programming languages


Most of us have learned to program with "textual" programming languages ​​like Basic, C / C ++, and Java. I think it's more natural and efficient for humans to think visually. Visual programming enables developers to write programs by manipulating graphical elements. I think visual programming should improve the quality of the code and reduce programming errors. I know some visual languages ​​like App Inventor, Scratch and LabView.

Why are there no general visual languages ​​for developers? What are the pros and cons of visual programming?






Reply:


In general, there is a tradeoff between ease of use and expressiveness (performance) when designing programming languages. Writing a simple "Hello, world" program in a beginner language like Scratch or App Inventor is generally easier than writing in a universal programming language like Java or C ++, where you might have multiple streams of output to different character sets , the ability to change syntax, dynamic types, etc.

When creating App Inventor (which I was involved in) our design philosophy was to make programming easier for beginners. A trivial example was setting our array indexes to 1 instead of 0, although this makes the calculations seem a little more complex to advanced programmers.

The main way visual programming languages ​​are usually developed for beginners is to eliminate the possibility of syntax errors by making it impossible to create syntactically invalid programs. For example, in the block languages ​​you cannot make an r-value the target of an assignment statement. This philosophy tends to lead to simpler grammars and languages.

When users start creating more complex programs in a block language, they find that dragging and dropping blocks is slower than typing them. Would you rather enter "a * x ^ 2 + b * x + c" or create with blocks?

This topic cannot do justice (at least from me) in some paragraphs, but some of the main reasons are:

  1. Block languages ​​are usually intended for beginners and therefore not as powerful.
  2. There isn't a nice visual way of expressing some of the complex concepts like type systems that you find in common programming languages.
  3. The use of blocks is unwieldy for complex programs.






Why are there no general visual languages ​​for developers? What are the pros and cons of visual programming?

Visual languages ​​tend to break through three broad categories:

  1. Tools that aren't programmers to perform basic automation tasks. Think Automator on Mac.
  2. Learning environments where it is not practical to type a lot or where the structure of the program, which shows the logic of the flow, is important. Think of Scratch, Alice, etc.
  3. The problem raised is a data flow problem, and the solution to the problem is well modeled by some kind of data flow between self-contained boxes that mimic the physical world. LabView and Ableton both come to mind.

The advantage of visual programming is that it gives you a comprehensive overview of the system structure. This leads to the immediate problem that when detailed, your spaghetti code really does look like spaghetti. A common component of visual languages ​​is some type of code block or configuration component for the visual element. The problem is that the programmer needs to understand separate blocks of code that can be interconnected in strange ways.

While there is nothing wrong with visual programming, it just might not be a good approach for most tasks.




There were numerous visual programming languages, as the following two bibliographies will show: vlib.org and oregonstate.edu.

IMHO they failed to gain a foothold because while they're good for toy samples, they can't manage the various levels of abstraction, representation, and granularity required for large projects. You need to look at a system like AutoDesk Revit (a building information management system used by architects and engineers) to see how complex visual information management can get.

Rather than dealing with general programming, visual programming is most likely to succeed as a configuration tool in specific areas.


text is visually.

We use all kinds of visual cues in our code. Any use of spaces (indentation, new lines, blank lines, line spacing) is aimed at providing visual cues as to the functionality of the code. We use all kinds of syntax to provide visual information about what code is doing. Our editors color our code to make it stand out.

Math is textual. There are all kinds of notations, but in the end it's basically text. You've been doing it for hundreds of years.

My point: The textual representation of code uses the visual abilities that humans have. We can probably make better use of it, but not by giving up text.




[For the PDF version of this answer, the figures or diagrams are interactive and dynamic.]

Network Elements and Annotations: A general-purpose visual programming language

I use graphics to organize JavaScript ™ programs that use the Acrobat® / JavaScript API. Each graphic object represents a Petri net element (location, transition, input or output) or represents more than one Petri net element. Each graphic object is actually an annotation of the corresponding network element. However, if each graphic object is assigned to one and only one network element, it can be used to generate the network element. If a graphic object is mapped to more than one network element and the mapping is precisely defined, it can also be used to generate the network elements. Standard Petri-Net elements are represented by certain types of graphics: a circle is a place, a square or a rectangle or a line is a transition, an arrow from a circle to a square is an input, and an arrow is from a square to a circle an input is output. in addition,

[For the types of annotations in a "Standard Petri Net", see the PDF version of this answer.]

Carl Adam Petri described most of these ideas (including the types of annotations in a "Standard Petri Net" in his dissertation (Petri, 1966). He also applied the network elements and annotations to the description of several logic circuits, such as 6.

Advantages and challenges

A visual programming language can help a computer programmer develop computer programs (Menzies, 2002).

I have at least three reasons why I find web elements and comments useful (advantages?).

Reason enough. The process logic can be created one element at a time. This means that a network can be expanded by adding elements to the existing network (Petri, 1966). For example, a model of a controller can be divided into internal and external components. The internal component regulates the system. The external component is connected to the environment by accepting input from the environment. Figure 1 shows a Petri-Net model of the internal component. You can add a Petri-Net model of the external component to the Petri-Net model of the internal component by adding the appropriate locations and transitions (Figure 2).

Figure 1 A Petri net model of an internal component of a controller (Halloway, Krogh and Giua, 1997)

Figure 2 A Petri net model of an internal and external component of a controller (Halloway, Krogh and Giua, 1997)

Second reason. The codes assigned to each network element can come from more than one “programming language” (Petri, 1973). They can come from a computer language such as JavaScript, COBOL, ADA, and an assembly language. They can come from a mathematical language such as algebraic symbols. They can come from prose encoded in English, German, French, Greek, Tagalog, Chinese, etc. They can therefore be used as a basis for communication and collaboration during the entire life cycle of software or systems development. and among various users, developers, and stakeholders (Petri, 1973).

Third reason. It is possible to concentrate on certain graphic objects in the network and to write the code or logic notes for the associated graphic objects. Consider a Petri net model of a card game in Figure 3. If the arrow for input P7  T4 is a standard graphic for an input in a location / transition network, and if m_7 is the marker for location P7, then the logical annotation for updating the mark of the input location is m_7 = m_7-1. If s_9 ^ - is the status of the input, the logical note to update the status of the input is s_9 ^ - = ((m_7 <1)? False: true).

Figure 3 A Petri Net model of a deck of cards

I have at least three reasons why I find Petri nets difficult to use (disadvantages?)

If there are too many graphic objects, it will be difficult to create or read the mesh. The difficulty can be reduced by taking a subset of the graphics and displaying them with one, two, or three graphic symbols (Noe, 1973; Petri, 1966). For example, if the Petri-Net model of a card game in Figure 3 contains too many graphic objects in the diagram, some of the graphics can be combined and there will still be enough information to map the diagram into a computer program. Consider Figure 4, a Petri-Net model of the same game from Figure 3 with high-level graphics (Chionglo, 2016a).

Figure 4 A Petri net model of a card game with high-level graphics (Chionglo, 2016a)

In another example, the external components of the controller in Figure 2 can be combined to create a cleaner graphical representation, as shown in Figure 5.

Figure 5 A Petri network model of a controller with high-level graphics for external components

Finally, a mutually exclusive set of locations or a mutually exclusive set of transitions can also be represented using a high-level graphic object (Chionglo, 2015).

Second reason. Even with standard graphics, graphics can be difficult to draw and position, especially if the final diagram is expected to be user or reader friendly. Decisions for creating a user-friendly or reader-friendly diagram include: the correct arrangement of graphic objects, the appropriate dimensions of the drawing area and shapes, the curvature of the arrows, the type of arrowheads, the size and font of the text, and the choice of Colors for graphics and text.

Third reason. Annotating network elements in an orderly fashion is easy because each annotation is directly or indirectly related to a network element. However, it may not be a good idea to display each annotation with the graphs of all network elements because the graph may contain too much information. For example, consider a diagram of a Petri-Net model of a logic circuit with references to all property and logic annotations (Figure 6). [The original model contained a test condition for the status of for each output (Figure 31 on page 78 of (Petri, 1966)); The test condition has been omitted here as it corresponds to the original model for the specified initial designation. Thus, each output has a logical annotation for calculating the marking of the output location.]

Figure 6 A local / transition network with annotations - based on Figure 31, page 78 of an English translation of Petri's dissertation (1966)

One way to mitigate this challenge is to identify the types of annotations used in the model and to define graphic objects that contain annotations of these types (Petri, 1966). If a Petri-Net diagram is composed of graphic objects from the definitions, the interpretation of these objects should include the "invisible" annotations. Figure 7 should be interpreted as a standard Petri net (see notes on a standard Petri net for definitions). therefore, the logical note in the diagram can be omitted.

Figure 7 A local / transition network - based on Figure 31, page 78 of an English translation of Petri's dissertation (1966)

Another way to alleviate this challenge is to use form views of the annotations to add to or add to the diagrams (Chionglo, 2016b; 2014). The views can be further broken down into smaller views, and each view can be shown and hidden.

References

Chionglo, JF (2016a). One response to "How do I design a state flow for a reaction / redux card game?" On Stack Overflow. Available at https://www.academia.edu/34059934/A_Reply_to_How_to_design_a_state_flow_for_a_react_redux_flashcard_game_at_Stack_Overflow.

Chionglo, JF (2016b). Two form views of a Petri net. Available at http://www.aespen.ca/AEnswers/CAPDissF31P78-form.pdf.

Chionglo, JF (2015). Using high-level graphics to reduce the number of network element graphics in a Petri network diagram. Available at http://www.aespen.ca/AEnswers/WjTpY1429533268.

Chionglo, JF (2014). Network elements and annotations for computer programming: calculations and interactions in PDF. Available at https://www.academia.edu/26906314/Net_Elements_and_Annotations_for_Computer_Programming_Computations_and_Interactions_in_PDF.

Halloway, LE; Krogh, BH and Giua, A. (1997). An overview of Petri-Net methods for controlled discrete event systems [electronic version]. Discrete Event Dynamics Systems: Theory and Applications. 7. Boston: Kluwer Academic Publishers, pp. 151-190.

Menzies, T. (2002). Evaluation problems for visual programming languages. In SK Chang (ed.). Software Engineering & Knowledge Engineering Handbook, Vol. 2 New Technologies. World Scientific Publishing co. Pte. Ltd., pp. 93-101.

Noe, JD and Nutt, GJ (1973). "Macro-E-Networks for Representing Parallel Systems", IEEE Transactions on Computers, vol. C-22, No. 8, August 1973, pp. 718-727.

Petri, CA (1973). Network Theory Concepts. In mathematical foundations of computer science: Proc. of Symposium and Summer School, High Tatras, September 3 - 8, 1973, pp. 137 - 146. Math. Inst. of the Slovak Acad. of Sciences, 1973.

Petri, CA (1966). Communication with Automota [trans. CF Greene, Jr.]. Appendix I to the Technical Report RADC-TR-65-377 (Volume I). Griffiss Air Force Base, New York: Rome Air Development Center, Research and Technology Department, Air Force Systems Command, Griffiss Air Force Base. Retrieved on August 31, 2011 from http://www.informatik.uni-hamburg.de/TGI/mitarbeiter/profs/petri/doc/Petri-diss-engl.pdf.


Johne Percival Hackworth:

While there is nothing wrong with visual programming, it just might not be a good approach for most tasks.

Maybe the previous visual programming languages ​​were just too immature? The notion that advanced visualizations cannot be applied to software artifacts and that it is entirely up to any designer's "imagination" to create their own visualizations could be a false assumption. A uniform and automated increase in the level of abstraction is obvious, as long as the ability to execute low-level abstractions and high execution performance are not impaired. This could ultimately lead to a "programming" by domain experts that is not much different from the way spreadsheets have automated COBOL programmers' job of manipulating numbers. The main difference is replacing numbers with the manipulation of "general systems".


You can look at Programming Without Coding Technology (PWCT).

PWCT is a general purpose visual programming language that enables systems and applications to be developed by generating interactive steps rather than writing code.

Here's a good starting point and it's open source.



a tricky question. Visual or flow-based programming, while more commonly used, is not widely used compared to any programming language. Maintenance and standardization are essential factors. Computer code can be printed on pages. It is not always as clear as to how to print a visual program.

Contrary to the current top answer, I would argue that there is definitely no inherent theoretical limitation in visual programming performance versus text languages.In fact, visual programming can be considered simpler if it can one day be sustained based on a faster human conceptualization of the many levels of abstraction. so there seems to be an unmistakable element of social / cultural indolence / conservatism in its inclusion.

The visual editors are probably much more complex in their code, and this is impressive considering that even text-based IDEs can be very complex, e.g. B. Eclipse. Note that some IDEs, such as. B. Eciplse, plugins for visual programming included. Visual programming for GUI creation has become quite common.

It seems to me that the use of visual programming is increasing in selected areas and that it will become more common in the foreseeable future.

Let's not forget that visual programming has been inherent in the design of EE chips for decades, where it is not an abstraction and (sub) systems are arranged exactly as intended in 2D designs.

The Lego Mindstorms kit, which has been in use for over a decade, has always had development software that was based on visual programming and has now been considerably optimized in many versions.

Here's an interesting recent article that analyzes the story and perspectives, and suggests that this is more common in web-based programming. The dynamic layout of controls / widgets on a page is a variant of visual programming.

Another key / emerging area where it is widely used in many tools is BPM (Business Process Modeling).


I suspect the reason these solutions are not so popular is because in most cases they can be unwieldy and can become a mess.

Almost all of the visual programming tools available today are part of larger applications and are used for a specific purpose (e.g. blueprint in UE4).

Anyway, Korduene is a new program I recently got to know for general programming. It's really not a general purpose as it is more of a Windows application building.




I think @Raphael and others are wrong when they say a program is text. Is not it. There are many things. It tells the computer what to do or how to do it. (imperactive, declarative programming) The association of programming with text processing is a historical and counterproductive dogma. Which was caused by the limited text input / output of early computers. People are not text parsers!

While I think people are right that a fully visual language (where you do everything visually by connecting elements with your mouse and so on) is impractical for a general purpose language, I think all current languages ​​are at an intermediate level could and should be shifted level. Where language elements have a visual representation that is stored in a binary language file. The programmer would not write crazy text or live under the spell of lines and indentations.

However, inserts items using the most productive combination of keyboard shortcuts / commands / UI elements. And only enter strings and other data and identifiers. This would make syntax errors impossible and make languages ​​more productive in terms of security and correctness (e.g. ADA). And would also make others safer and less error-prone by making entire classes more frequent errors impossible. (Like the one that ADA prevents by being awkward)

To some extent, things went in that direction. With automatic indentation and syntax coloring. Unfortunately, no one realized (or cared enough) that the core concept of the "human text parser" is what it is. The arguments between Emacs and Vim are funny because both are wrong. They are "solutions" to an artificially created problem.






We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By continuing, you consent to our use of cookies and other tracking technologies and affirm you're at least 16 years old or have consent from a parent or guardian.

You can read details in our Cookie policy and Privacy policy.