Is Scala The Language Of 2022? 10 Developers Share Their Scala Projects Experiences
So… is Scala the language of 2022?
No programming language is the ultimate answer to all IT needs, even though we all love to argue over their benefits, and use cases. The project fit is always the only real thing that matters. Having said that, we understand you still need to make choices, like choosing your first, second or sixth programming language.
To help you find the answer, we’ve collected insights from 11 developers with different Scala experiences and opinions. We asked them questions about the challenges, adoption processes as well as the plain old; “ Why Scala?”.
What’s the internet saying about Scala projects?
First off, we have some interesting Scala news for you; using sentiment analysis we found comments that tell the story of what it’s like using Scala in a project/ implementing a Scala projects. The main concept was to find out how people feel about a specific mention. More about sentiment analysis here.
What are developers saying about Scala projects?
If you’re here then you’re surely looking for some answers when it comes to Scala. These short stories may help you discover some aspects that will help you to define your position on this matter. This is a space where you can collate different opinions, experiences, and conclusions. I guess we can call it the Scala projects Mind map – with organized thoughts and worthwhile stories – in short, Scala projects through the eyes of professionals.
This article is the second we’ve created in cooperation with specialists from both inside and outside our company, willing to bring a variety of viewpoints to the table.
In our first article, we asked 7 experts why they chose ZIO. If you’re familiar with Scala you might have already heard about the ZIO library. Either way, we recommend you check out the article and stay tuned for the next.
Not only that but if you want to know more about what people are saying about Scala on the web, go to Functional Programming Languages Sentiment Ranking and see how its sentiment compares to other functional languages.
But for now, let’s jump over to our developers and their opinions!
Who shared their experiences with us?
- Carlos Costa
- Emmett Boudreau
- Matija Han
- Juliano Alves
- Ari Joury
- Benson Ma
- Matt Gross
- Marcin Gorczynski (Scalac)
- Piotr Holda (Scalac)
- Simun Karacic (Scalac)
What questions did we ask them?
- How was the adoption of the language in the company you work/used to work for?
- What were the biggest challenges with adopting Scala?
- Why are you using Scala for the projects?
- What were the biggest challenges with Scala, and how did you overcome them?
- Why do you think it is worth learning Scala? What reasons are there to use Scala?
How was the adoption of the language in the company you work/used to work for?
When I first started my career as a Data Scientist, Scala was pretty much the language to do big-data statistics in… I think this has changed today. It was integrated across most businesses at the time I believe, and I worked at one of them — although I was mostly writing R.
As an example, a lot of R/Python/Julia stuff is really simple to grasp, and it works in the way that we would expect a high-level scientific language to work. However, Scala is certainly apt in what it can do in terms of the size of data. This is especially true if we are comparing it to languages like R and Python.
I’ve been using Scala only in the Context of distributed data processing applications with Spark. So my idea of Scala as a programming language may be limited. To me I liked Scala due to its feeling of a hybrid between python and Java, two languages which I was used to. It presents itself as a language which is easy to read, but all the syntactic sugar and variations of ways of writing code makes it very hard to jump in between projects which in my opinion of the Scala projects don’t adhere to the same standards. Lately, we found PySpark to be much more comprehensible, easy to read and online with what other data scientists already use and understand.
What were the biggest challenges with adopting Scala?
In the past, functional languages were seen as very complex or academic, therefore not appropriate to everyday projects. I believe it is not the case anymore, the functional aspects are everywhere now, so more and more people are giving Scala a new chance
When it comes to challenges, I’ll list the main ones that I can see:
- The Scala language specification is quite large compared to other mainstream languages, and it is, therefore, hard to know a big portion of it. Even Java is hard to know exhaustively these days and a dev must read at least a few good classic books or do some courses to earn the right to boast extensive Java knowledge, but Scala takes this to a whole new level.
- Finding developers with relevant Scala experience is hard.
- On-boarding new hires, as well as interns onto Scala takes a lot of time compared to simpler and more commonly used mainstream languages.
- SBT is a pain to work with compared to other build tools such as Gradle. It gets slow (granted, we do have a large Scala codebase), and it’s sometimes archaic and inscrutable.
- There are less resources available online (though granted, for a persistent searcher, you can eventually find the answers you are looking for).
I read the Staircase book by Martin Odersky over ten years ago and that was a good resource, but it took quite some time to go through at the time. The following book was a very good resource for me to refresh my memory and prepare for Coursera.
The fact that not many people in my community are familiar with Scala. I use it sometimes for side things but it’s hard to share my code with people from my everyday work.
JVM math in general can be very tricky when you are working with complex dimensions. It is just fundamentally different in the way that everything is done from the start.
The biggest challenge I see is a very limited number of experienced Scala devs on the market. There is a belief that the learning curve of functional languages is higher than the imperative ones but in my opinion, it is not entirely true. The problem is that the education system is focused on “classic” programming paradigms and there is a lack of FP mindset among alumni. That leads to the longer time required for the newcomers to be productive using Scala (or any other functional language).
Why are you using Scala for the projects?
Scala’s strong type system is very good at eliminating the most common bugs in software development. In addition, its testing frameworks (we use ScalaTest) are superb and make writing tests as easy and succinct as writing code (I have not found this assertion to be true with any of the other programming languages I have worked with previously). The combination of these two features enable for software correctness by construction, which has been a huge productivity booster for us.
In both syntax and semantics, the language presents itself as very similar to Java (as opposed to a pure functional programming language like Haskell or Ocaml), so it lowers the learning curve for existing Java developers. But at the same time, the language features scale with the needs and proficiency levels of the developers (e.g. higher kinded types, implicits, etc), while at the same time, these features are consistent with each other (as opposed to a language like C++, where developers need to learn as many exceptions to a rule as there are rules).
A big plus for using Scala is that it runs on the JVM. You get a ton of baked-in goodies from that alone.
I like the fact that Scala provides a pretty seamless introduction to functional programming. Having a scientific background, I really appreciate functional programming. All functional code is mathematically provable, which makes it a lot easier to test and scale. Scala provides enough object-oriented programming to make novices comfortable, but functional programming comes much more naturally in Scala than in, say, Python.
There are many reasons for this, but especially I appreciate Scala macros and compiler plugins. I think it allows the community to build amazing tools and libraries which makes programming in Scala even more enjoyable. Writing boilerplate code is reduced.
There are a few reasons:
- the strong type system makes it easy to reason about errors that could happen
- the focus on immutability mitigates many problems I had in the past, especially related to concurrency. Those are more present than one can imagine, any web app is intrinsically speaking a concurrent environment.
- ZIO is the effects system we use at Broad, and it brings many tools to handle the problem mentioned above, making it very easy to write concurrent/parallel programs.
I’m using it because it offers me a great type system and the ability to use FP where applicable. Additionally, a great advantage to it is the ability to use Java libraries so we’re covered dependency-wise in almost all areas
The added type safety and concurrency tools allow me to sleep better at night when I’m on call
What were the biggest challenges with Scala, and how did you overcome them?
My biggest challenge isn’t the language itself, but the fact that the community is relatively small and underrepresented where I work. I see myself “overcoming” that challenge by building something bigger with Scala or working somewhere where they already use it. (That being said, that’s not the only consideration I’d do for a future workplace!)
Probably the biggest challenge is for people to change their mindset on how they develop code, especially when it comes to going in the more FP direction. In the beginning, a lot of people will simply write something that resembles very much your typical OO Java code so you’ll need to guide them that Scala offers an alternative approach that brings many benefits that in the long run will make everyone’s lives easier.
When I decided to start learning, I was coming from a OO background, it took me a while to understand the functional paradigm and such a strong type-system. Focusing on writing Scala the functional way, not trying to make it “a better Java” brought me the insights I needed to change the way I think about abstractions and composition, allowing me to write code that’s easier to reuse and extend.
Hiring Scala developers. There are plenty of Java developers, and despite having a team of ~10 BE developers using Scala (most of which had a background in Java), we had issues getting developers to even apply for positions, let alone take them.
Why do you think it is worth learning Scala?
It is worth learning Scala because it combines the worlds of OOP and FP. It could be used as “a JAVA without semicolons” or in a purely functional manner. This duality of the Scala nature causes you don’t need to understand everything from day one. You could learn FP concepts and gradually introduce them to the code. For people, without prior FP exposure, it could be an eye-opening experience.
Scala, and functional programming in general, is worth learning because it helps you compartmentalize, chain, and manipulate computations. This is especially useful when it comes to multithreaded environments. It’s easier to develop, read, and debug.
Functional programming! You could go straight to the harder-to-learn languages like Haskell, Rust, or other die-hard functional programming languages. But I think it’s easier to use Scala as a stepping stone. Or as a comfortable middle ground, because object-oriented programming is still pretty awesome at the end of the day but difficult to implement with Haskell for example
Because it will change the way one thinks, especially if they are not familiar with functional programming. Besides, I recommend learning Scala so one can see how much heavy-lifting the compiler can do, and how much easier it can be to reason their code.
Hiring Scala developers might be a challenge for some companies, and the legendary learning curve – even if debatable – still seems to raise some doubts about whether it’s worthwhile.
However, If you’re going to work on a data processing project, or/and you need to scale your project quickly or… to quote Simun Karacic you just want to “sleep better at night”, then you should consider giving Scala a try. Besides Scala projects may just be plain fun. Just as Daniel Ciocirlan from Rock the JVM showed in Scala isn’t Hard: How to Master Scala Step By Step, you can read the key takeaways from this article on our Instagram profile:
So… let’s raise the question again: is Scala YOUR language of 2022? Are you planning a project using its functional powers?
Already a Scala programmer? Scalac would love to meet you. On our Instagram page, Facebook, Twitter, and LinkedIn, you can find out more about upcoming events, the community, and Scalac culture. You can check out some inspiring events and conferences where we actively operate, share our knowledge, and give sponsorship. These include Scala World, Functional World, Scale By The Bay, Scala Days,and Zio World.
This link will help you to stay up to date with our open positions. And remember, we are always open for a chat, so feel free to contact us!