November 18
Java Becoming a Functional Programming Language?
by David Palmer
There is a formal proposal to introduce closures to the Java programming language. For those of us who have been in the Java world for a while (10+ years for yours truly) this could really open up a lot of interesting possibilities to express solutions to really complicated problems, the way the functional programmers have been doing things, which can mean, less and cleaner code.
For example, anonymous functions, and first-class functions would be introduced as well as incorporating some of the more interesting features of languages like ruby (think blocks and yield) and scala will make for more concise code and, as an example, provide the developer with the ability to write your own control structures.
From the (current) specification:
“Modern programming languages provide a mixture of primitives for composing programs. Most notably Scheme, Smaltalk, Ruby, and Scala have direct language support for parameterized delayed-execution blocks of code, variously called lambda, anonymous functions, or closures. These provide a natural way to express some kinds of abstractions that are currently quite awkward to express in Java. For programming in the small, anonymous functions allow one to abstract an algorithm over a piece of code; that is, they allow one to more easily extract the common parts of two almost-identical pieces of code. For programming in the large, anonymous functions support APIs that express an algorithm abstracted over some computational aspect of the algorithm.”
This is pretty exciting for Java, and as a fan of functional programming, this is a real bonus for the Java platform.

The Java Becoming a Functional Programming Language? by Molecular Voices, unless otherwise expressly stated, is licensed under a Creative Commons Attribution 3.0 Unported License.