What is procedural and non-procedural programming?

8

  • in this answer , but without too much stress, that:

      

    "[...] procedural programming is an evolution of programming   structured [...] "

    And in this answer also:

      

    [...] procedural programming is something that, to some extent,   unavoidable [...]

    And in Wikipedia says that:

      

    [...] sometimes used as a synonym for Imperative Programming [...]

    But what really is procedural and non-procedural programming?

        
  • asked by anonymous 04.04.2017 / 22:16

    1 answer

    4

    Basically it is the programming that structures the execution through watertight routines that are called as needed. Normally we call them functions, but they do not have to be exactly that way .

    Normally these routines have parameters to communicate with the other parts of the code and can return some value, but it is not mandatory, although it is confusing to mix everything or less powerful to not allow any communication.

    What is certainly not programming based on procedures (procedures). Well, it is, but you have to be careful because the procedure is a routine sealing mechanism. One that is rarely used in most modern languages explicitly. Of course, a function that returns nothing (usually void ) is still a procedure. The procedural term is used as a generic form. Just as functional programming is not the one that has functions, even because if it were the case almost any language would be functional.

    The procedural paradigm is secondary and refers more to the organization of the code as a whole, as is object orientation.

    The main one that differs from procedural is object-oriented, which first glorifies procedures, behavior, and the second glorifies object, state.

      

    [...] procedural programming is an evolution of structured programming [...]

    Structure programming is concerned only with code flow and not with compartmentalization.

      

    [...] procedural programming is something that, to some extent, unavoidable [...]

    I do not agree that the use of procedural is inevitable. The imperative is almost inevitable. I speak at What is paradigm? .

      

    [...] sometimes used as a synonym for Imperative Programming [...]

    It is used erroneously as a synonym for imperative.

        
    04.04.2017 / 22:33