which is not of programming consturct
Answers
Answered by
0
PROGRAM CONSTRUCTS
CONTENTS
All programming language utilise program constructs. In imperative languages they are used to control the order (flow) in which statements are executed (or not executed). There are a number of recognised basic programming constructs that can be classified as follows:
Sequences (First Floor)
Selection (Second Floor)
Repetition (Third Floor)
To which we can also add routine invocation (Fourth Floor). Note also that each of the above constructs are all also program statements in their own right.
SEQUENCES
A sequence construct tells the processor which statement is to be executed next. By default, in imperative languages, this is the statement following the current statement (or the first statement in the program). If we wish to "jump" to some other statement we can use a goto statement. This was popular in the early days of computer programming (1950's to early 1960's). Example BASIC goto statement:
GOTO 400
This tells the processor to "jump" to line 400 and to then continue processing from this point in the program. The use of goto statements was also encouraged by languages such as Fortran and Cobol.
GOTO STATEMENT CONSIDERED HARMFUL (Dijkstra 1968)
Goto statements make it difficult to "trace" a program's execution and to determine the state of variables at a given point during processing. As a result errors are often obscure and difficult to locate. For this reason some more modern (post mid 1960's) imperative languages, for example Modula-2 and Pascal, have abandoned the goto statement all together. However, there are some legitimate reasons why a goto may be desirable, for example to facilitate error handling or to terminate a deeply nested sequence of loops. Both Ada and C support a goto statement but it is best avoided.
CONTENTS
All programming language utilise program constructs. In imperative languages they are used to control the order (flow) in which statements are executed (or not executed). There are a number of recognised basic programming constructs that can be classified as follows:
Sequences (First Floor)
Selection (Second Floor)
Repetition (Third Floor)
To which we can also add routine invocation (Fourth Floor). Note also that each of the above constructs are all also program statements in their own right.
SEQUENCES
A sequence construct tells the processor which statement is to be executed next. By default, in imperative languages, this is the statement following the current statement (or the first statement in the program). If we wish to "jump" to some other statement we can use a goto statement. This was popular in the early days of computer programming (1950's to early 1960's). Example BASIC goto statement:
GOTO 400
This tells the processor to "jump" to line 400 and to then continue processing from this point in the program. The use of goto statements was also encouraged by languages such as Fortran and Cobol.
GOTO STATEMENT CONSIDERED HARMFUL (Dijkstra 1968)
Goto statements make it difficult to "trace" a program's execution and to determine the state of variables at a given point during processing. As a result errors are often obscure and difficult to locate. For this reason some more modern (post mid 1960's) imperative languages, for example Modula-2 and Pascal, have abandoned the goto statement all together. However, there are some legitimate reasons why a goto may be desirable, for example to facilitate error handling or to terminate a deeply nested sequence of loops. Both Ada and C support a goto statement but it is best avoided.
Similar questions