Procedural programming

from Wikipedia, the free encyclopedia

Procedural programming is a programming paradigm by which computer programs can be developed. The name is not clear; in literature it is used for different meanings:

  • as an extension of the imperative paradigm to include the approach of breaking down algorithms into manageable parts that can be called up using a defined interface.
  • within the imperative paradigm as a counterpart to object-oriented programming

Occasionally, procedural programming is also understood as a synonym for imperative programming per se or for structured programming .

Breakdown into sub-problems

The procedural programming supplements the imperative concept of consecutive commands with the approach of breaking down an algorithm into manageable parts. Depending on the programming language, these parts are called subroutines , routines , procedures or functions . Parameters can be passed and results returned. The "visibility" of the variables can be controlled by local and global variables : While local variables are only known within a procedure, global variables are known in the entire computer program. Together with the control structures of the structured programming procedural programming is a means for the production of clarity. In addition to the clarity, code repetitions can be avoided. The modular programming has a similar purpose, but at a higher level: Larger computer programs are to be developed here in individual modules, compiled separately and tested or are ready libraries are integrated.

For example, the first version of Fortran (around 1960) did not have the procedural approach despite other concepts for structured programming; the procedural approach was incorporated in a later version.

Imperative, not object-oriented programming

The second meaning is as a collective term for the type of programming that prevailed until the 1990s, when object-oriented programming was introduced as a practical further development. “Classical” or “traditional programming” is also used synonymously.

Procedural programming concepts form the basis for object-oriented programming. Since then, procedural programming and object-oriented programming have been considered two main currents within imperative programming. Hybrid languages support both concepts.

The procedural type of development was - due to the range of languages ​​used in early programming languages ​​- the classic type of programming. However, some of the defining properties of procedural development can still be used in newer programming languages.

Features of this type of programming are:

  • Imperative approach : sequence of defined state transitions in which it is specified how these states are to be changed. These compound instructions can be finite (program ends automatically) or also infinite (program waits for events).
  • Control structures (e.g. sequence, loop, branch) to control command execution.
  • Calling subroutines and passing through and returning parameter values ​​(concept of abstraction or procedural programming in the narrower sense). This creates a hierarchy of functions that are each processed sequentially. The grouping and hierarchy can correspond to any logical principle. The starting point of the program is in the main procedure - from which the sub-functions are called.
  • Data values ​​are defined as named variables and addressed by their names.
  • These variables are assigned data types that only allow certain instructions.

The main difference between procedural and object-oriented programming is the relationship between data and functions. While in object-oriented programming data and functions that can be applied to this data are combined in objects , in procedural programming data and functions have no cohesion.

The development of procedural programming languages ​​and techniques is based on the Von Neumann architecture , which began with the assembly languages and was further developed in the high-level languages . While in the procedural approach the program code is similar to the later process on the hardware level and basically defines this, the object-oriented approach is abstract. Thus, procedural programming is viewed as an abstraction level between assembler and object-oriented programming.

Fortran , COBOL , ALGOL , C and Pascal are a selection of procedural programming languages .

Individual evidence

  1. a b c d e Arnd Poetzsch-Heffter: Concepts of object-oriented programming . With an introduction to Java (=  eXamen.press ). Springer, Berlin 2009, ISBN 978-3-540-89470-4 , pp. 10–12 ( limited preview in Google Book search).
  2. ^ Heinrich Müller, Frank Weichert: preliminary course in computer science . The entry into computer science studies. Vieweg + Teubner, Wiesbaden 2011, ISBN 978-3-8348-0959-9 , pp. 208 ( limited preview in Google Book search).
  3. ^ Wolfgang Lassmann: Wirtschaftsinformatik . Gabler Verlag, 2006, ISBN 978-3-409-12725-7 , page 256, books.google.de
  4. Axel Kilian: Programming with Wolfram Mathematica . Springer, 2009, ISBN 978-3-642-04671-1 , page 66, books.google.de
  5. Hans Benker: Engineering Mathematics compact - problem solving with MATLAB . Springer, 2010, ISBN 978-3-642-05452-5 , page 59, books.google.de
  6. ^ Peter A. Henning , Holger Vogelsang: Paperback programming languages . Hanser Verlag, 2007, ISBN 978-3-446-40744-2 , page 34, books.google.de
  7. Sebastian Kübeck: Software renovation . Verlag Hüthig Jehle Rehm, 2009, ISBN 978-3-8266-5072-7 , page 29, books.google.de
  8. ^ Peter A. Henning , Holger Vogelsang: Paperback programming languages . Hanser Verlag, 2007, ISBN 978-3-446-40744-2 , page 51, books.google.de
  9. Ulla Kirch, Peter Prinz: C ++ - learning and using it professionally . Verlag Hüthig Jehle Rehm, 2010 ISBN 978-3-8266-9143-0 , page 25, books.google.de
  10. Helmut Balzert : Java: Object-oriented programming . Verlag W3l, 2010, ISBN 978-3-86834-013-6 , page V, books.google.de
  11. Kurt Badertscher, Johannes Scheuring: Business Information Systems Basics . Compendio Bildungsmedien, 2006, ISBN 978-3-7155-9271-8 , page 126, books.google.de
  12. ^ Christian Silberbauer: Introduction to Java and OOP . Springer, 2009, ISBN 978-3-540-78615-3 , page 130, books.google.de
  13. Oliver Alt: Car Multimedia Systems Model-based testing with SysML . Vieweg + Teubner, 2009, ISBN 978-3-8348-0761-8 , page 44, books.google.de