What Is Functional Programming?

Here’s a nice intro to functional programming on Dr. Dobbs.

In any functional programming language, you are likely to encounter these features:

* First-class functions, or higher-order functions: Functions can serve as arguments and results of functions.
* Recursion as the primary tool for iteration.
* Heavy use of pattern matching, although technically it is not a defining feature of FP.
* Lazy evaluation, which makes possible the creation of infinite sequences and other data structures.

At the end of the article on page 2 you get a nice discussion of Mathematica as a functional programming language.

It’s been noted a lot lately in technical publications that functional programming will continue to grow in importance due in large part to the need for parallel computing.  Functional programming is well suited for massive parrallel computation for a variety of reasons and the article does a good job highlighting some of those.  Of course, it comes at a price to developers – the learning curve.

It’s not a trivial exercise to switch from OO and imperative styles into functional.  And the lack of huge repositories of free code makes doing a quick commercial application fairly challenging.

This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

Gravatar
WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s