Functional Programming
Functional programming, also known as applicative programming, is a form of programming in which functions can be manipulated in arbitrary ways. The evaluation of expressions is emphasized, rather than the execution of commands. Using the various functions forms the expressions. Programming languages such as XML, Perl, XML and Python incorporate some functional programming-inspired features.
Another way of describing functional programming, in computer terminology, is that it is a declarative language--a language that specifies what ought to be done, rather than in what order things are to occur. This descriptive programming is different in approach from the more normal imperative programming. Instead of giving commands to the computer, objects are described. Each object is either a "primitive" object--like a number--or is created by applying some function to another object.
The declarative nature of functional programming means that the compiler, which translates source code into object code, has some freedom as to how to evaluate a program. Three evaluative strategies can be used. These are termed strict, eager and lazy. In strict evaluation, everything that the programmer has written is evaluated, and is done so in a well-defined order. This is similar to the way ordinary programming languages operate. Examples of strict functional programming languages are Scheme and ML. Eager also evaluates everything the programmer has written, but in no particular order. Example languages are Id and pH. Finally, and in contrast to the previous two strategies, lazy evaluates only what is needed to produce a functional result. The best example of lazy evaluation is the Haskell programming language. The biggest obstacle to the popularity and use of the lazy evaluative strategy has been determining what does and does not need to be done to produce the functional result, a process that may be time-consuming. Current technological improvements are reducing the time required by compilers to swiftly sort out the necessary from the unnecessary.
Functional programming offers a number of potential advantages over other programming languages. First, because the different evaluation strategies allow for computation in any order, the use of multiple processors allows computations to be performed simultaneously. In computing terminology, this is described as parallel operation. Second, the focus on function-oriented expressions rather the commands allows compilers to analyze and transform information in complex ways. This greater degree of analytical depth can extract more meaning from the information. Third, the executable parts of programs can be described, tested and modified if necessary more easily and quickly than with imperative programs. Finally, functional languages are relatively easy for a programmer to write code in, especially when the data is more abstract.
While offering a number of powerful features, relative to conventional programming, the abstract nature of functional programming requires considerable effort on the part of a programmer to master these potentials. Nontheless, the potential advantages combined with research advancements could propel functional programming more into the mainstream.
This is the complete article, containing 473 words
(approx. 2 pages at 300 words per page).