Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is Java Evolving into a Functional Programming Language? Should it?  RSS feed

 
Stevens Miller
Bartender
Posts: 1444
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dr. Subramaniam: When lambda expressions first appeared, I didn't see them as much more than a convenience. Your book shows them in a new light, as a vehicle for employing FP methodologies in Java. Do you think Java is, or should be, in the process of evolving into a genuine functional programming language? The FP/IP dichotomy is one of those that seems to endure, with proponents and critics in large numbers on both sides. Do you think one language can successfully embrace both methodologies? Can Java?

Thanks, and good luck with the book.
 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not to pre-empt what the author might say, but just my opinion:

I wouldn't say that Java was evolving into a functional programming language. I think that FP is just another tool which has been tossed into the Java toolbox.

There's a natural tendency for programming languages to become more complicated as time passes, and that's what is happening here. At some point a language crosses over the line where it can be described as a "Frankenstein monster", but I'd say it's a matter of opinion whether FP pushed Java over that line.
 
Venkat Subramaniam
Author
Ranch Hand
Posts: 109
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stevens,

Java will never be or become a true functional programming language. The imperative style and mutability is far too engrained in it.
It certainly has another style to program and the onus is on us to use that style judiciously in ways we can gain.

Several languages have done this. Smalltalk, Ruby, Scala,... there is a long list of languages that support both imperative and functional style.
I like having that flexibility and the wisdom to choose.
 
Stevens Miller
Bartender
Posts: 1444
30
C++ Java Netbeans IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess what I'm concerned about is Paul's point that a language can become a monstrosity if it amalgamates too many mechanisms. Java's vast API libraries already make it hard to say one has ever fully "learned" Java (folks here still help me out every so often by letting me know that some set of classes I've just mastered is actually better replaced by a more recent one I hadn't heard of). Now, with lambda expressions, I'm worried that the language may sort of "split" into two forms. That is, suppose a talented (and perhaps somewhat overenthusiastic) devotee of FP were to write a Java application that became the maintenance responsibility of someone less familiar with FP (but who was otherwise a competent Java programmer). Do you see any danger that the second coder might end up feeling that the first one had written the application in a language that the second did not understand? Does your book offer guidance on avoiding this sort of "diglossia?"
 
Venkat Subramaniam
Author
Ranch Hand
Posts: 109
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The book does not get into this discussion.

This is certainly a concern if we create a divide in team where some people stays stagnant and others learn and move forward.

Given that almost all mainstream languages now support functional style, it is to great disadvantage to developers if they do not
become familiar with the style. It will largely limit there ability to program effectively in just about any language moving forward.

Over time, as we all get more familiar with the style, we will transition. In my observation, most programmers are fairly good at such
transition, when a language evolves. C# has gone through exactly this cycle, only a few years ahead.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!