Win a copy of Getting started with Java on the Raspberry Pi this week in the Raspberry Pi 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Scala for the Impatient: Should i learn Scala now?

 
Ranch Hand
Posts: 119
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 284
35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 119
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
There's a way to do it better - find it. -Edison. A better tiny ad:
Low Tech Laboratory
https://www.kickstarter.com/projects/paulwheaton/low-tech-0
reply
    Bookmark Topic Watch Topic
  • New Topic