Non-structured programming
Encyclopedia
Non-structured programming is the historically earliest programming paradigm
Programming paradigm
A programming paradigm is a fundamental style of computer programming. Paradigms differ in the concepts and abstractions used to represent the elements of a program and the steps that compose a computation A programming paradigm is a fundamental style of computer programming. (Compare with a...

 capable of creating Turing-complete algorithms. It has been followed historically by procedural
Procedural programming
Procedural programming can sometimes be used as a synonym for imperative programming , but can also refer to a programming paradigm, derived from structured programming, based upon the concept of the procedure call...

 programming and then object-oriented programming
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

, both of them considered as structured programming
Structured programming
Structured programming is a programming paradigm aimed on improving the clarity, quality, and development time of a computer program by making extensive use of subroutines, block structures and for and while loops - in contrast to using simple tests and jumps such as the goto statement which could...

.

Unstructured programming has been heavily criticized for producing hardly-readable ("spaghetti") code and is sometimes considered a bad approach for creating major projects, but had been praised for the freedom it offers to programmers and has been compared to how Mozart
Wolfgang Amadeus Mozart
Wolfgang Amadeus Mozart , baptismal name Johannes Chrysostomus Wolfgangus Theophilus Mozart , was a prolific and influential composer of the Classical era. He composed over 600 works, many acknowledged as pinnacles of symphonic, concertante, chamber, piano, operatic, and choral music...

 wrote music.

There are both high and low level programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

s that use non-structured programming. These include early versions of BASIC
BASIC
BASIC is a family of general-purpose, high-level programming languages whose design philosophy emphasizes ease of use - the name is an acronym from Beginner's All-purpose Symbolic Instruction Code....

 (such as MSX BASIC
MSX BASIC
MSX BASIC is a dialect of the BASIC programming language. It is an extended version of Microsoft Standard BASIC Version 4.5, and includes support for graphic, music, and various peripherals attached to MSX Personal Computers. Generally, MSX-BASIC is designed to follow GW-BASIC, which is one of the...

 and GW-BASIC
GW-BASIC
GW-BASIC was a dialect of the programming language BASIC developed by Microsoft from BASICA, originally for Compaq. It is compatible with Microsoft/IBM BASICA, but was disk based and did not need the ROM BASIC. It was bundled with MS-DOS operating systems on IBM PC compatibles by Microsoft...

), JOSS
JOSS
JOSS was one of the very first interactive, time sharing programming languages.JOSS I, developed by J. Clifford Shaw at RAND was first implemented, in beta form, on the JOHNNIAC computer in May 1963...

, FOCAL, MUMPS
MUMPS
MUMPS , or alternatively M, is a programming language created in the late 1960s, originally for use in the healthcare industry. It was designed for the production of multi-user database-driven applications...

, TELCOMP
TELCOMP
TELCOMP was a programming language developed at Bolt, Beranek and Newman in about 1965 and in use until at least 1974.It was an interactive, conversational language based on JOSS, developed by BBN after Cliff Shaw from RAND visited the labs in 1964 as part of the NIH survey...

, COBOL
COBOL
COBOL is one of the oldest programming languages. Its name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments....

, machine-level code
First-generation programming language
A first-generation programming language is a machine-level programming language.Originally, no translator was used to compile or assemble the first-generation language. The first-generation programming instructions were entered through the front panel switches of the computer system....

, early assembler systems (without procedural metaoperators), assembler debuggers and some scripting languages such as MS-DOS batch file
Batch file
In DOS, OS/2, and Microsoft Windows, batch file is the name given to a type of script file, a text file containing a series of commands to be executed by the command interpreter....

 language.

Basic concepts

A program in a non-structured language usually consists of sequentially ordered commands, or statements, usually one in each line. The lines are usually numbered or may have labels: this allows the flow of execution to jump to any line in the program.

Non-structured programming introduces basic control flow
Control flow
In computer science, control flow refers to the order in which the individual statements, instructions, or function calls of an imperative or a declarative program are executed or evaluated....

 concepts such as loops, branches and jumps. Although there is no concept of procedures
Subroutine
In computer science, a subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code....

 in the non-structured paradigm, subroutines are allowed. Unlike a procedure, a subroutine may have several entry and exit points, and a direct jump into or out of subroutine is (theoretically) allowed. This flexibility allows realization of coroutine
Coroutine
Coroutines are computer program components that generalize subroutines to allow multiple entry points for suspending and resuming execution at certain locations...

s.

There is no concept of local variables in non-structured programming (although for assembly programs, general purpose registers may serve the same purpose after saving on entry), but labels and variables can have a limited area of effect (For example, a group of lines). This means there is no (automatic) context refresh when calling a subroutine, so all variables might retain their values from the previous call. This makes general recursion
Recursion (computer science)
Recursion in computer science is a method where the solution to a problem depends on solutions to smaller instances of the same problem. The approach can be applied to many types of problems, and is one of the central ideas of computer science....

difficult, but some cases of recursion--where no subroutine state values are needed after the recursive call--are possible if variables dedicated to the recursive subroutine are explicitly cleared (or re-initialized to their original value) on entry to the subroutine. The depth of nesting also may be limited to one or two levels.

Data types

Non-structured languages allow only basic data types, such as numbers, strings and arrays (numbered sets of variables of the same type). The introduction of arrays into non-structured languages was a notable step forward, making stream data processing possible despite the lack of structured data types.

External links

  • BPStruct - A tool to structure concurrent systems (programs, process models)
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK