Name: Pratik

Posts by Pratik Garg

    Functional Programming in Java Using “lambdaj”

    The new JVM based Post Modern Functional Languages (as creator of Scala, Martin Ordesky named them) like Scala and JRuby which are influenced from both Object Oriented and Functional programming languages  have gone far ahead in the terms of functionality that they offer as compared to Java.

    Apart from the object richness, these languages are loaded with most characteristics of a FL like (first class functions, closures, traits static/dynamic type inference, lazy evaluation, etc) which helps in bringing more modularity to the code and from aesthetics perspective these languages are less verbose and more readable as compared to java.

    Few people have put efforts and wrote libraries which can help in leveraging some of these features in Java too. The motivation is not to compete with scala or ruby as they are far ahead. It’s like if you don’t have the option to switch over to these languages (especially scala) or you are still waiting for the Java7 release.

    The ones which I have been using are lambdaj written by Mario Fusco and Enumerable written by Hakan Raberg. Others I am aware of but not used are FunctionalJ and FunctionalJava .Most of them provide a similar set of features and differ bit in syntax , it only like the one to which you get accustomed too.
    Read more »