Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
8 user(s) are online (5 user(s) are browsing encyclopedia)

Members: 0
Guests: 8

more...
partner

Procedural programming

Procedural programming is a programming paradigm based upon the concept of the procedure call . Procedures, also known as routines, Subroutines, methods, or functions (not to be confused with mathematical functions, but similar to those used in functional programming) simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program s execution, including by other procedures or itself.

Procedural programming is often a better choice than simple sequential or unstructured programming in many situations which involve moderate complexity or which require significant ease of maintainability. Possible benefits:

  • The ability to re-use the same code at different places in the program without copying it.
  • An easier way to keep track of program flow than a collection of GOTO or JUMP statements. (Which can turn a large, complicated program into so-called spaghetti code .)
  • The ability to be strongly modular or structured programming.
  • =Procedures and modularity=

    Especially in large, complicated programs, Modularity (programming) is often a desirable property. It can be implemented using procedures that have strictly defined channels for input and output, and usually also clear rules about what types of input and output are allowed or expected. Inputs are usually specified syntactically in the form of arguments and the outputs delivered as return values .

    Scope (programming) is another technique that helps keep procedures strongly modular. It prevents the procedure from accessing the variables of other procedures (and vice-versa), including previous instances of itself, without explicit authorization. This helps prevent confusion between variables with the same name being used in different places, and prevents procedures from stepping on each other s feet.

    Less modular procedures, often used in small or quickly written programs tend to interact with a large number of Variables in the execution system platform, which other procedures might also modify. The fact that lots of variables act as points of contact between various parts of the program are what make it less modular.

    Because of the ability to specify a simple interface, to be self-contained, and to be reused, procedures are a convenient vehicle for making pieces of code written by different people or different groups, including through code library.

    (See Module (programming) and Software package.) It s very easy to understand.

    =Comparison with imperative programming=

    Most or all extant procedural programming languages are also imperative programming languages, because they make explicit references to the state of the execution environment. This could be anything from variables (which may correspond to processor registers) to something like the position of the turtle in the Logo programming language (which could be anything from a cursor on the screen to an actual device which moves around on the floor of a room).

    Some imperative programming forms, such as object-oriented programming, are not necessarily procedural.

    =Comparison with object-oriented programming=

    More sophisticated forms of modularity are possible with object-oriented programming, which is a more recent invention. Instead of dealing with procedures, inputs, and outputs, object-oriented programs pass around objects . Computation is accomplished by asking an object to execute one of its internal procedures (or one it has inherited), possibly drawing on some of its internal state.

    Procedural programs are generally more computationally efficient than object-oriented programs, because there is less overhead to handle abstractions and the data structures more closely resemble the hardware that must manipulate them. Indeed, many operating systems and CPUs are designed with specific mechanisms to facilitate the efficient implementation of procedure calls.

    =Procedural programming languages=

    Procedural programming languages facilitate the programmer s task in following a procedural programming approach. The canonical example of a procedural programming language is ALGOL (programming language). Others include Fortran, PL/I (programming language), Modula-2 (programming language), and Ada (programming language). Note that this list includes some languages that aren t exclusively procedural, such as Java, which was designed specifically for object oriented programming.

  • Ada programming language - (multi-purpose language)
  • BASIC programming language - (these have little modularity in (especially) versions prior to about 1990)
  • C programming language
  • C plus plus - (C with objects + much else)
  • C Sharp - (developed by Microsoft, essentially as a Microsoft .NET counterpart to Java programming language)
  • ColdFusion
  • COBOL
  • Component Pascal - (an Oberon-2 variant)
  • D programming language
  • Delphi programming language
  • ECMAScript a.k.a. ActionScript, DMDScript, JavaScript, JScript
  • Forth programming language
  • Fortran - (better modularity in later Standards)
  • FPC Pascal - (Pascal dialect)
  • Lisp programming language
  • Mathematica
  • Modula-2 - (fundamentally based on modules)
  • Oberon programming language and Oberon-2 - (improved, smaller, faster, safer follow-ons for Modula-2)
  • M - (more modular in its first release than a language of the time should have been; the standard has become still more modular since then)
  • Pascal programming language - (successor to Algol60 and predecessor of Modula-2)
  • Perl
  • PL/C
  • PL/1 - (large general purpose language, originally for IBM mainframes)
  • Rapira
  • VBScript
  • Visual Basic
  • ==See also==

  • Functional programming (contrast)
  • Imperative programming
  • Programming paradigms
  • Programming language
  • Procedural generation
  • =External link=

  • [http://dmoz.org/Computers/Programming/Languages/Procedural/ Procedural programming languages]