Functional programming: A step backward

Functional programming languages will have a place in general application development when we can read their code at a glance

By Andrew Oliver, InfoWorld |  Software, Programming APIs Libraries

Unless you've been living under a rock, you know functional programming is all the rage among the so-called alpha geeks. Perhaps you already use a functional programming language. If you use a more conventional language like Java or C#, you're probably aware it has functional programming features in store. While this brave new world is upon us, and before we take things too far, it might be a good time to pause and reflect on the appropriateness of functional programming for everyday application development.

What is functional programming? The simple answer: Everything is a mathematical function. Functional programming languages can have objects, but generally those objects are immutable -- either arguments or return values to functions. There are no for/next loops, as those imply state changes. Instead, that type of looping is performed with recursion and by passing functions as arguments.

[ Andrew Oliver compares Ruby, Clojure, and Ceylon, which share the same goal, but reach varying results. | Learn how to work smarter, not harder with InfoWorld's roundup of all the tips and trends programmers need to know in the Developers' Survival Guide. Download the PDF today! | Keep up with the latest developer news with InfoWorld's Developer World newsletter. ]

What is a functional programming language? The answer to that question is more complicated and subject to seemingly endless debate. Some languages attempt to box you into the functional programming style, while others encourage but don't force the issue. Then there are the more traditional imperative languages that allow you to program in the functional style. Indeed, people are hard at work adding support for functional programming constructs to Java and C#.


Originally published on InfoWorld |  Click here to read the original story.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness