0

I'm working on a large team of programmers on a Java System. The library LamdbaJ is in the working library, but many of the developers are skeptical of the benefits of functional programming.

(My background is that I'm a big fan of Clojure).

I want to articulate the benefits of higher order functions over Java idioms.

The two that come to mind are:

  • function composition (can plug them together)
  • functions as values (you can replace a function with value and it will work the same)

But when I compare the map operation to simply walking a list with the for (x : y) in Java - function composition and functions as values don't seem to make a huge difference to the verbosity or robustness of the code.

I want to articulate some reasons (in this environment) why a functional approach is similar.

My question is: In Java, what are the reasons for Higher Order Functions (via lambdaj) over for (x:y) loops?

Assumptions:

  • Running Java 7 due to Websphere limitations.
hawkeye
  • 34,745
  • 30
  • 150
  • 304
  • Google "[functional vs imperative programming](https://www.google.com/search?q=functional+programming&ie=utf-8&oe=utf-8#q=functional+vs+imperative+programming)". A good one might be: [The Downfall of Imperative Programming](https://www.fpcomplete.com/blog/2012/04/the-downfall-of-imperative-programming). – Andreas Sep 20 '15 at 04:25
  • http://www.lambdafaq.org/why-are-lambda-expressions-being-added-to-java/ Maurice Naftalin isn't just another blogger: Java Guru and all that. – laune Sep 20 '15 at 04:30
  • get off websphere and upgrade to java 8 :P – leeor Sep 20 '15 at 08:58
  • You can't do that until they really understand the idea of model of computation using Turing machine and Lambda calculus. – Ankur Sep 20 '15 at 12:00

0 Answers0