Java 8: What is a Lambda?
This functional programming topic is trending in the corporate world. Anonymous functions were named after Church’s system, initially adopted by the LISP language, which gave rise to the family of functional languages.
Definition: An anonymous function is an expression that represents an “in-line” method definition. It has no value or type of its own, but can be converted to a compatible delegate or expression tree type. For historical reasons, there are two syntactic types of anonymous functions: lambda expressions and anonymous method expressions. The “->” operator has the same precedence as assignment (=) and is right-associative.
Some examples of functional languages are: Javascript, Python, and Ruby, which make it possible to balance functional and imperative languages. In the new version of Java 8, this “functional language„ feature will be incorporated through lambda expressions. Routines such as sorting lists, selecting elements based on a pre-established criterion, or even extracting values from an object property within a list are currently repetitive tasks in a Java programmer’s daily life.
In short, in the near future, the new version will allow us to implement code more concisely without losing readability. Today, there are libraries that implement such features (Guava and LambdaJ). If you are eager to use it, you can implement your code by adding them. Oracle plans to release it in September of this year.
For those who want to learn more about the subject, some examples are available here and on the Oracle website.
Andre Meirelles de Rezende
Software Architect at Teclógica

