• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Programming Scala: Scalability = Functional Programming + Objects

 
Ranch Hand
Posts: 531
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Different programming languages have different strengths and weaknesses.
I was wondering what does Scala do or why is it better than other languages like Java or Python ?  

thanks,
Paul
 
Author
Posts: 23
8
Mac OS X Scala Monad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Scala has these pros and cons:

Pros:
1. You can write code on the spectrum from "totally" OOP to FP, using whatever patterns and idioms from each "paradigm" you want. Lot's of FP enthusiasts, who would love to use FP languages like Haskell, use Scala professionally, because it's a viable option for them.
2. Scala is proven in production settings, everything from reliability of Scala's output byte code, libraries, and development tooling.
3. You can use it as a JVM, JS, or natively-compiled language (the latter is newer and less "proven").

Cons:
1. Being general purpose, you might prefer a language like Go for infrastructure (especially in Kubernetes), Typescript for web dev, or Python for data science, which are more tailored to their target environments.
2. Not everyone wants to use the advanced features Scala offers.

Java has improved a lot in the last ~14 years since I started with Scala. I can understand what some teams believe it's "good enough". As someone who works in the data science world, but who isn't doing data science day to day, I would prefer to use Scala for data science, but Python is a more natural choice (even though there are ways to use Python libraries from Scala...).
 
paul nisset
Ranch Hand
Posts: 531
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your perspective. I didn't know Scala had a natively compiled option .
I've been working with Java for ages but it seems like new iterations of it are just trying to mimic features from other languages.
 
Dean Wampler
Author
Posts: 23
8
Mac OS X Scala Monad
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Brian Goetz, who is Java's amazing language architect (amazing because of his brilliant balancing of backwards compatibility vs. the need to evolve), once joked that Scala is the laboratory for new features in Java. That's not too far off ;)
 
paul nisset
Ranch Hand
Posts: 531
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's a good point . There is just so much Java code out there that a lot of businesses would collapse if their code stopped working after a JVM upgrade for hardware or security reasons.
Kind of the same problem as Microsoft had with Windows.
 
Sheriff
Posts: 16964
286
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Dean Wampler wrote:Brian Goetz... once joked that Scala is the laboratory for new features in Java. That's not too far off ;)


Seems like some really useful Scala features like array slicing, destructuring, and tail recursion optimization are still (way?) far off though
 
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic