It is important to use a modeling technique as it was said before, but is also important to have some language that would allow the programmer to express exactly what he intends to do.
Such a language should be simple, and as closed to the specification of the problem as possible. It must also have high level constructors that allow the definition of structured and complex abstract data types and mathematical operators over them for a language to be close to the specification.
Basically, there are two kinds of programming languages:
1. Imperative languages: the underlying principle or the operational semantics is very similar to the processor’s execution cycle, being necessary to understand its architecture; the kind of avail- able statements is also similar to the machine instructions. The programmer should also know how to manipulate memory elements to store the necessary data;
2. Declarative languages: instead of following the execution principles, those languages have as back- ground a mathematical theory that supports operations over that data and data representation. The explicit memory manipulation is not necessary; the programmer just manipulate, in a high level data, without being necessary to know where this data is stored.
Declarative languages are higher level than imperative languages, more closed to the problem specification. One example to show the difference between this two kind of languages is the file manipulation, that can be done in imperative languages (like C) and in declarative languages (like SQL).
Declarative languages are classified as functional or relational (logic) according to the style. The first group is supported by the principle that a program is just a function mapping the input data into the output results; while the second family relies upon the idea that a program is a set of assertions defining the relations that hold in some world. Typical declarative languages are: ML, Lisp, or Haskell (functional paradigm), and Prolog (logic paradigm).
No comments:
Post a Comment