Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Scala for the Impatient: Should i learn Scala now?

 
Ranch Hand
Posts: 106
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome Cay,

   Fundamental question , What would convince some one like me if i have already been coding in Java 8 in all its glory
   I found it to be lot more interesting than the previous versions it initially took lot of time and some unlearning to grasp the
   Functional aspects  of the Lamda and the Stream API.
   

   What would be some of the advantages if i had Scala in my kitty.I would sincerely hope that you can clear this for me.

Thanks and Regards
Sathya
   
 
author
Posts: 254
31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is a really good question. Java 8 has lambdas and streams, and Java 9 has jshell. So why bother with Scala? I give you three reasons.

1) If you use something like Play or Spark, you'll find the Scala API more powerful and convenient. Run and learn Scala.

2) In Scala, the functional features aren't obscured by backwards compatibility

Java has lambda expressions, but there are no types for them. A lambda turns into a functional interface, and that makes it really awkward to express certain patterns that should be natural. I found it easy to understand and use lambdas because I know how to use, compose, and generate functions in Scala. My students who learn lambdas have a significantly harder time with functional styles in Java because they don't. So, you may become a better Java programmer by knowing the basics of Scala.

3) Scala shows you what you can do beyond Java

Java 8 is nice, and Kotlin is a bit nicer (more regular, less boilerplate), but they don't expand your mind a lot. Scala teaches you a whole slew of new techniques, particularly when you get to the more advanced topics, that give you a glimpse of what the next big thing in mainstream programming languages might be.

Cheers,

Cay
 
satya Priya Sundar
Ranch Hand
Posts: 106
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


           If you use something like Play or Spark, you'll find the Scala API more powerful and convenient. Run and learn Scala



           Personally i see the need for learning Spark given the nature of the work that we will do,we were doing some bit of exploration on
           the pySpark package.
           Since Scala has lot of native support in the Spark World,we will have to extend our scope of exploration...

Java has lambda expressions, but there are no types for them. A lambda turns into a functional interface, and that makes it really awkward to express certain patterns that should be natural.


          This is 100% correct i really had a tough time wrapping my head around the relationship between Functional interface and Lambda Expression.


          My students who learn lambdas have a significantly harder time with functional styles in Java



          I totally agree with this comments , i had a first hand experience on this.

Thanks
Sathya
 
Liar, liar, pants on fire! refreshing plug:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic