Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Functional Programming in Java: Differences between functional programming in Java and Scala

 
Ranch Hand
Posts: 181
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are there any significant differences between the two approaches these two languages took towards functional programming? The obvious one is collections in Java need to be converted to Stream before using functional programming goodies. Are there any others?
 
Author
Posts: 161
31
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are many differences. Java is missing nearly all functional elements that Scala offers. Scala has pattern matching, for comprehensions, lazy values, tail call elimination, data types, higher kinded types, and much much more. Plus it has many functional types such as Option, Try, immutable collections... They should not be compared from the functional programming point of view. If you want to learn functional programming and you have the choice of the language, my advice would be to select Haskell if you don't need the JVM, and Scala otherwise.
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic