Estimate project
← All posts

A Scala journey: from intrigued Java developer to functional, declarative Scala

A Senior Software Engineer at our company tells how he began programming in Scala, how he got to where he is today, shares his thoughts and more!

4 min read
scala20yearsofscalaFunctional Programming

In 2024 Scala turns 20, so we asked Scala experts to tell us their Scala Stories. Among them is a Senior Software Engineer at our company.

When did you first come across Scala, and what was your impression?

It happened during Venkat Subramaniam’s talk “Scala for the intrigued” at the 33rd Degree conference in 2012. I ended up far more than intrigued. Staying within the JVM ecosystem while using a language with so many improvements sounded great to me, and I couldn’t wait to bring it into my Java project, at least for tests.

Describe a moment when you thought, “Aha! Scala is awesome!”

Which features and capabilities of Scala gave you that feeling?
Initially, it was the compact syntax, the collection library, immutability, and trait linearization – things that made my object-oriented programming a lot more comfortable. The next major insight was the way Scala lets us handle concurrency, particularly once Akka and Akka Streams came along. Thinking in terms of streams and in a functional/declarative manner was one of the bigger shifts in how I approach coding.

In what ways has Scala shaped how you tackle programming problems?

Scala took me through a paradigm shift: from mutable, object-oriented imperative design full of uncertainty about concurrency to a functional, declarative, immutable style. I also embraced the “follow the types” approach to a large degree. I want types to express, guide, and constrain wherever that’s sensible. Another key change was beginning to think about concurrency in terms of expressions and values, thanks to effect monads such as IO. By default, I build programs with referential transparency and local reasoning as the top priorities.

If you could add one new feature to Scala, what would it be, and how would developers benefit?

As far as the language goes, I’m excited about the NamedTuples project, which should make working with tuples a lot more elegant and safe. I’ve also heard about the concept of “best-effort compilation”, which would let compilation carry on even when some errors show up. That looks like a promising boost to developer experience.

Which tools and libraries do you reach for as a software developer?

Nearly a year ago I moved to Metals, and it’s now my default language server. I’ve also grown fond of scala-cli for quick, convenient experiments and for creating buildable snippets. When it comes to libraries, my favorite stack lines up very closely with the libs another guest in this interview series recommends. For instance, I frequently use quicklens for manipulating deeply nested case classes. For concurrency, my choice is Cats Effect with fs2.

Share a time when Scala turned out to be a game-changer in a real-world project.

I recall a project whose business case was an ideal fit for event sourcing while also demanding high scalability. Our team implemented it on the Akka stack, with akka cluster, akka persistence, and akka-streams-kafka. Everything fit together remarkably elegantly, and we delivered a solid system. On top of that, much of the core business logic lived in a neatly isolated module written as pure functions and making heavy use of utilities from the Scala collection library. I can’t picture building an equally powerful and elegant solution in any other ecosystem.

Any funny or embarrassing moments while you were learning Scala?

Once I had a hammer, I fell into the trap of seeing nails everywhere. Early in my Scala journey, I went way overboard with traits for multiple inheritance. I also remember my first attempt at an Akka application, where I crammed actors into every corner and ended up with a rather embarrassing mess!

What would you tell someone who is just getting started with Scala?

Take a look at the Scala Toolkit and the EPFL MOOCs on Coursera. They should give you a good start and get you hooked on Scala.

Where do you see Scala heading over the next decade?

Tooling, which lagged behind for quite some time, is showing encouraging progress. I’m hoping for big improvements in sbt 2.0, metals, and IDE integrations. I like the idea of bringing Scala tooling and core libraries to a point where the developer experience is far simpler, so newcomers can become productive fast and progress to advanced topics along a gentle learning curve. I’m also looking forward to Scala Native reaching full maturity, particularly for serverless systems.