A Scala journey: from Java POJOs to case classes and Akka Streams
Discover how one of our seasoned developers got into Scala – how he started, how he grew into an expert, which tools he likes best, and more!
In today’s episode of our special series for Scala’s 20th anniversary, a seasoned Software Developer, architect, and advisor who works with us tells his Scala story!
How did you first come across Scala, and what was your impression?
I began my adventure with Scala roughly 10 years ago, when I became part of the company. In the beginning, I worked mostly with Java, even on my first project there. Over time, though, I saw Scala showing up more and more often, so I decided to try it out in one of my projects. Scala felt like magic at first, but it gradually became much easier for me to understand.
Describe the moment when you thought, “Aha! Scala is awesome!” Which Scala features and capabilities gave you that feeling?
Little things count. I was once on a project where Java POJOs ran to hundreds of lines, and then I came across Scala case classes, which changed everything. I discovered more advanced features later on, but at the start it was these little things that made life a lot easier for our programmers.
Which tools and libraries do you reach for first as a software developer?
For sure IntelliJ, cats or zio (not pure Scala), and chimney.
Share a situation in which Scala turned out to be a game-changer in a real-world project
Akka Streams, together with the reactive programming approach as a whole, changed the game. We rewrote a project that had tried to do parallel processing in PHP. The Akka Streams-based code was simpler and easier to follow, and it cut processing time by hours.
Were there any funny or embarrassing moments while you were learning Scala?
Oh, definitely. A long time ago I made a mistake where we used map rather than flatMap, so a Future[Future[Unit]] ended up assigned to Future[Unit]. This led to unpredictable behavior at runtime.
What would you recommend to someone who is just getting started with Scala?
Keep things simple. With great power comes great responsibility – Scala is capable of amazing things, but that doesn’t mean you need to use all of them in every project.
Where do you see Scala heading over the next ten years?
In my view, Scala is shifting more toward the enterprise. The LTS release is an early sign of that. At the moment, the emphasis isn’t so much on new, exciting features as on wider adoption and guaranteed stability.