Functional Programming

In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state. Functional programming has its roots in lambda calculus, a formal system developed in the 1930s to investigate function definition, function application, and recursion. Many functional programming languages can be viewed as elaborations on the lambda calculus.

In practice, the difference between a mathematical function and the notion of a function used in imperative programming is that imperative functions can have side effects that may change the value of program state. Because of this, they lack referential transparency, i.e. the same language expression can result in different values at different times depending on the state of the executing program. Conversely, in functional code, the output value of a function depends only on the arguments that are input to the function, so calling a function f twice with the same value for an argument x will produce the same result f(x) both times. Eliminating side effects can make it much easier to understand and predict the behavior of a program, which is one of the key motivations for the development of functional programming.

Functional programming languages, especially purely functional ones such as the pioneering Hope, have largely been emphasized in academia rather than in commercial software development. However, prominent functional programming languages such as Common Lisp, Scheme, ISLISP, Clojure, Racket, Erlang, OCaml, Haskell, Scala and F# have been used in industrial and commercial applications by a wide variety of organizations. Functional programming is also supported in some domain-specific programming languages like R (statistics), Mathematica (symbolic and numeric math), J, K and Q from Kx Systems (financial analysis), XQuery/XSLT (XML) and Opal. Widespread domain-specific declarative languages like SQL and Lex/Yacc use some elements of functional programming, especially in eschewing mutable values.

Programming in a functional style can also be accomplished in languages that aren't specifically designed for functional programming. For example, the imperative Perl programming language has been the subject of a book describing how to apply functional programming concepts. C# 3.0 added constructs to facilitate the functional style as well and even Apple's Objective-c uses blocks to provide a functional support.

Read more about Functional Programming:  History, Concepts, Comparison To Imperative Programming, Use in Industry

Other articles related to "functional programming, programming, functional":

Algebraic Logic Functional Programming Language
... Algebraic Logic Functional programming language also known as ALF is a programming language which combines functional and logic programming techniques ... equality which consists of predicates and Horn clauses for logic programming, and functions and equations for functional programming ... ALF was designed to be genuine integration of both programming paradigms, and thus any functional expression can be used in a goal literal and arbitrary predicates can ...
Functional Programming - Use in Industry
... Functional programming has long been popular in academia, but with few industrial applications ... However, recently several prominent functional programming languages have been used in commercial or industrial systems ... For example, the Erlang programming language, which was developed by the Swedish company Ericsson in the late 1980s, was originally used to implement fault-tolerant ...
Scala (programming Language)
... Scala ( /ˈskɑːlə/ SKAH-lə) is an object-functional programming and scripting language for general software applications, statically typed, designed to concisely express solutions in an elegant ... Scala includes full support for functional programming (including currying, pattern matching, algebraic data types, lazy evaluation, tail recursion, immutability, etc.) ... Compared with Java, Scala adds many features of functional programming languages like Scheme, Standard ML and Haskell, including anonymous functions, type inference, list comprehensions (known in Scala as "for-comprehens ...
FAUST (programming Language) - Overview
... The FAUST programming model combines a functional programming approach with a block-diagram syntax The functional programming approach provides a natural framework for signal ... It actually combines two approaches functional programming and algebraic block-diagrams ...
Scala (programming Language) - Comparison With Other JVM Languages
... Scala is often compared with Groovy and Clojure, two other programming languages also built on top of the JVM ... The primary purpose of Groovy was to make Java programming easier and less verbose, while Scala (in addition to having the same goal) was designed from the ground up to allow for a functional ... from Java and has a strong emphasis on functional programming while de-emphasizing object-oriented programming ...

Famous quotes containing the words programming and/or functional:

    If there is a price to pay for the privilege of spending the early years of child rearing in the driver’s seat, it is our reluctance, our inability, to tolerate being demoted to the backseat. Spurred by our success in programming our children during the preschool years, we may find it difficult to forgo in later states the level of control that once afforded us so much satisfaction.
    Melinda M. Marshall (20th century)

    Well designed, fully functional infant. Provides someone to live for as well as another mouth to feed. Produces cooing, gurgling and other adorable sounds. May cause similar behavior in nearby adults. Cries when hungry, sleepy or just because. Hand Wash with warm water and mild soap, then pat dry with soft cloth and talc. Internal mechanisms are self-cleaning... Two Genders: Male. Female. Five Colors: White. Black. Yellow. Red. Camouflage.
    Alfred Gingold, U.S. humorist. Items From Our Catalogue, “Baby,” Avon Books (1982)