Our goal is to try and make writing functions as easy as possible, and allow them to be curried, composed, and passed as arguments to other functions. Functions, as used in this article, are not just any old Java method. They are Java instance methods which are pure-functional, that is, without side-effects, and do not reference any object fields or non-static variables. Essentially, they are non-mutating static functions declared without a static qualifier.In the essential read Why Functional Programming Matters, John Hughes argues that functional programming significantly improves modularity, which is a key to successful programming. FP creates a natural framework for developing small and simple modules which are then glued together.
IBM DeveloperWorks also published an article a couple of years ago showing how to do FP in Java, and Joel Spolsky of 'Joel on Software' has lamented the fact that all-Java universities these days are not preparing programmers by teaching them a functional language "Without understanding functional programming, you can't invent MapReduce, the algorithm that makes Google so massively scalable. The terms Map and Reduce come from Lisp and functional programming."
Community comments
FunctionalJ
by Michael Neale,
Functional Programming
by Billy Newport,
wallflower
by Joost de Vries,
FunctionalJ
by Michael Neale,
Your message is awaiting moderation. Thank you for participating in the discussion.
functionalj.sourceforge.net/ is worth checking out for those interested.
If you statically import its helper class, you can have things like map(), filter() etc etc...
Functional Programming
by Billy Newport,
Your message is awaiting moderation. Thank you for participating in the discussion.
should be taught to everyone as should logic based programming. One of the best books on this stuff is "Structure and Interpretation of Programming Languages" by Abelson and Sussman. You can't know enough techniques.
wallflower
by Joost de Vries,
Your message is awaiting moderation. Thank you for participating in the discussion.
What's up with functional programming forever sitting at the edge of the party moping about being superior while the other languages are having all the fun.
I'm wary of supposedly superior technologies that never make it.
Has anybody made an information system using FP? I'm really curious what that would look like. It seems to me information systems are all about side effects.
Oh, and if you want to FP on JVM look into the Martin Odersky's language Scala.