UP | HOME
../../

Programming Paradims for Software Engineering

1 Programming Paradigms

  1. "The notion of programming paradigms is a way to classify programming languages," – Wikipedia
    1. This is a wrong view.
    2. It is a way to classify programming "styles."
  2. Some PLs have multiple paradigms.
  3. rosettacode.org Solutions to the same task in different languages.
  4. rosetta.alhur.es Compare any two PLs solutions

1.1 Procedural Paradigm

  1. Examples: C/C++, Java, Python, Scala
  2. AKA Imperative/ Operational Paradigm
  3. (Almost all) OOP languages belong here.
  4. Process/Program State is operated on by statements
  5. Changes made are globally visible.
  6. RosettaCode.org:: Quick Sort in Java, Scala.

1.2 Functional Programming

  1. Examples: ML/ OCaml, Haskell, Scala (hybrid)
  2. No state; functions and expressions have no side-effects
  3. Obviously, IO and environment changes are needed – handled in an ad hoc way.
  4. Functions etc. are "first class" values. (i.e., computable within the PL)
  5. Compute a value, and return it as a result.
  6. RosettaCode.org:: Bubble Sort in Haskell; Quick Sort in Haskell, OCaml

1.3 Logic Programming.

  1. Examples: Prolog, Datalog
  2. AKA Declarative Paradigm
  3. Based on mathematical logic. But, not full scale, but highly studied subsets in the context of implementations.
  4. State is a collection of "facts" (axioms + inference rules + deduced).
  5. Queries: (Program execution) systematic search in the state
  6. Queries may have unbound variables. The answer then yields all possible value that make the query true.
  7. RosettaCode.org:: Quick Sort in Prolog

Copyright © 2016 pmateti@wright.edu www.wright.edu/~pmateti 2016-01-11