Krzysztof Ciesielski - My Scala Story

Krzysztof Ciesielski

19 Mar 2024.4 minutes read

Krzysztof Ciesielski - My Scala Story webp image

Scala is celebrating its 20th anniversary in 2024, so we invited Scala experts to share their Scala Stories. One of the experts is Krzysztof Ciesielski, Senior Software Engineer at SoftwareMill. You can follow him on X: @kpciesielski

How did you first get introduced to Scala, and what did you think about it?

It was Venkat Subramaniam’s “Scala for the intrigued” talk, presented at the 33rd Degree conference in 2012. I was much more than intrigued. I thought it would be great to still live in the JVM ecosystem and use a language with so many improvements, and I was eager to introduce it in my Java project, at least in tests.

Tell us about a moment when you realized, "Aha! Scala is awesome!"

What Scala's features and capabilities made you feel that way?
At first, it was the concise syntax, collection library, immutability, and trait linearization - features that would make my object-oriented programming much more convenient. The next big realization was how Scala allows us to deal with concurrency, especially when Akka and Akka Streams appeared. Thinking in streams and functional/declarative ways was one of the more significant changes in my coding mindset.

How has Scala influenced your approach to solving programming problems?

With Scala, I experienced a paradigm shift from mutable, object-oriented imperative design with lots of uncertainty around concurrency into a functional and declarative immutable style. I also adopted the “follow the types” approach to a great extent. I want types to express, guide, and constrain wherever it makes sense. Another critical shift was starting to think in expressions and values when it comes to concurrency, thanks to effect monads like IO. My default approach is to build programs with referential transparency and local reasoning as priorities.

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

In the language itself, I’m looking forward to the project of NamedTuples, which should make working with tuples much more elegant and safer. I also heard about the idea of “best-effort compilation,” which could allow continuing compilation even if some errors occur. It’s a promising improvement for developer experience.

What are your go-to tools and libraries when working as a software developer?

I switched to Metals almost a year ago, and it’s now my default language server. I have also become a keen user of scala-cli for fast and convenient experimentation and producing buildable snippets. As for libraries, my stack of favorites very strongly matches the libs recommended by Vlad Pekker here. For example, I often use quicklens for deep case class manipulations. As for concurrency, I prefer Cats Effect with fs2.

Tell us about a time when Scala proved to be a game-changer in a real-world project.

I remember a project where the business case was a perfect match for event sourcing, requiring high scalability at the same time. Our team built it with Akka stack, using akka cluster, akka persistence, and akka-streams-kafka. All the pieces fit together impressively elegantly, and we managed to ship a robust system. Besides, a lot of the core business logic was contained in a nicely isolated module expressed as pure functions and leveraging a lot of utilities from the Scala collection library. I can’t imagine building a similarly powerful and elegant solution in another ecosystem.

Did you have any hilarious or embarrassing moments while learning Scala?

I fell into the trap of seeing nails everywhere once I had a hammer in my hand. At the beginning of my Scala experience, I heavily overused traits for multiple inheritance. I also remember how I tried to write my first Akka application, where I forced actors everywhere, making quite an embarrassing mess!

What advice would you give to someone just starting with Scala?

Check out the Scala Toolkit and MOOCs from EPFL at Coursera. This should get you well-started and fascinated with Scala.

What are your predictions for the future of Scala in the next decade?

We are seeing promising improvement in tooling, which was quite lagged for a while. I hope we will see sbt 2.0, metals, and IDE integrations improve a lot. I like the idea of getting the Scala tooling and fundamental libraries to a state where the developer experience is much simpler, and newcomers can quickly start to work with it efficiently, getting advanced with a gentle learning curve. I also look forward to the full maturity of Scala Native, especially for serverless systems.

SCALA is celebrating its 20th anniversary!

We're excited to celebrate this big milestone, and we would love for you to join us. You can keep up with all the festivities by following #scalaversary on X and Mastodon. Don't miss out on the Scalar Conference 2024 – it's going to be a Scala Fiesta! This two-day event will immerse you in functional programming insights shared by a vibrant community of IT professionals. It's an excellent opportunity to network with like-minded individuals, gain expert knowledge, and make new friends.

Secure your spot now, and we can't wait to see you in Warsaw!


Blog Comments powered by Disqus.