answersLogoWhite

0

Structured programming introduced structured loops such as for, while and do-while loops, combined with continue and break statements to adjust the flow of execution within a loop. switch/case (and break) was also introduced to provide more efficient branching than was possible with if...elseif alone. Subroutines were also introduced with the gosub keyword.

The structured programming style (or paradigm) was introduced primarily to reduce the use of the goto keyword which tended to produce "spaghetti code" which is difficult to read (and thus difficult to maintain). Of course, the resultant machine code is still spaghetti in nature (that is unavoidable), however applying structure to the source code makes it much easier to reason about the code and thus reduces the maintenance burden.

Procedural programming extends structured programming through the introduction of the procedure call (or function call). A function is similar to a subroutine (which always returns to its caller) except a function can also (optionally) accept arguments from the caller as well as (again optionally) return values to the caller. This makes it possible to write code in a more functional style, but primarily allows us to name our code blocks. With well-named functions, code is largely self-documenting, reducing the need for user-comments which are often a distraction to humans and completely ignored by compilers.

Object-oriented programming extends procedural programming further through the introduction of classes which encapsulate data and the functions that operate upon that data, and from which objects can be instantiated. This in turn allows ideas such as class invariants and concepts to be expressed directly in code rather than relying on user-comments that may be incorrect (because the compiler can't check them) or simply ignored by the reader. Given the compiler can perform many checks that would otherwise have to be done at runtime, the resultant code is smaller and more efficient.

Template-metaprogramming extends the notion further by allowing classes to be generalised to the extent the compiler can generate classes according to a template its specialisations, thus passing the responsibility for code duplication to the compiler, rather than the programmer. Furthermore, template code not used by a given specialisation need not be generated at all, reducing the need for otherwise redundant code.

User Avatar

Denis Block

Lvl 10
2y ago

What else can I help you with?

Related Questions

When was The Elements of Programming Style created?

The Elements of Programming Style was created in 1974.


Why goto is not a good structured programming style?

goto is a statement, not a programming style.


What is difference between poor programming style and good programming style?

Good programming style is consistent and self-documenting, making it easy to both read and maintain.


What is theobject oriented programming style?

When a programming language is "object-oriented" it means that the code is based (or oriented) around Objects as opposed to executing line by line. An object is any value, variable, function, or data structure.


Object-oriented software is another name for structured software?

Object-oriented programming is a more recent subset of structured programming. Structured programming emphasized the need to align data structures with program structure, a concept that is formalized and carried much further in object-oriented programming. However, structured programming advocated hierarchical constraints on program structure that are incompatible with the event-driven, message-passing software architectures commonly implemented in the object-oriented style, today.


What is the message structure in windows programming?

No.


What is selection structure in programming?

2


You need to understand a subroutine's in order to use it?

You need to understand a subroutine's ____ in order to use it. a. internal structure b. local variables c. programming style d. interface


What is desktop programming?

programming used to develop software applications ,they focus on the procedural style of processing systems


Who is the best programming author?

There is no 'best' programming author; everyone has their own opinion based on the style of the writer of the code.


What is the structure of the ots keyword in the programming language you are using?

In the programming language I am using, the structure of the "ots" keyword is typically used for object-oriented programming and stands for "object to string." It is used to convert an object into a string representation.


What is structured programming in generally?

It means using only three structure when programming: sequence, selection, repetition.