Tomas Mikula - My Scala Story

Maria Kucharczyk

20 Feb 2024.5 minutes read

Tomas Mikula - My Scala Story webp image

Join us in celebrating Scala's 20th anniversary in 2024! We've gathered a group of Scala experts to share their amazing Scala Stories. Tomas Mikula is a Lead Software Engineer, you can follow him on X, GitHub and LinkedIn.

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

I took the “Functional Programming Principles in Scala” MOOC from EPFL. My general feeling was: “This is fun!”

Tell us about a moment when you realized, "Aha! Scala is awesome!" What Scala's features and capabilities made you feel that way?

Probably when I grokked higher-kinded types, though it certainly took longer than a moment! 🙂

I realized that Java generics, taken to their “logical consequences”, naturally lead to higher-kinded types.

To this day, very few industrial-grade languages support higher-kinded types, making them a distinctive feature of Scala.

How has Scala influenced your approach to solving programming problems?

Coming from Java, my first impulse used to be to start sketching inheritance hierarchies in my head. By doing that, I was artificially constraining the solution space without realizing it.

Scala taught me that, most of the time, thinking in terms of functions and (algebraic) data types is a more productive approach.

Moreover, ever since this learning experience, I have kept an eye out for other things I might be missing. It has also destroyed my naive belief that (statically typed) programming languages are basically all the same and that if a language feature was any good, surely it would have already found its way into the Java language. 😂

When I later came across the following Dijkstra quote, I felt like I knew exactly what he was talking about:

The tools we use have a profound (and devious!) influence on our thinking habits, and, therefore, on our thinking abilities. – Edsger W. Dijkstra

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

Scala has had an influx of new features recently. I think, at this point, it is more important to focus on making the existing features rock solid and scalable to arbitrarily complex scenarios. Be it polymorphic function types, match types and abstracting over arity, kind-polymorphism, meta-programming, or the ever-green GADT pattern matching.

If I could choose one new feature, it would be the compile-time evaluation of arbitrary syntax trees (i.e. TASTy trees). In a sense, this is also just making an existing feature (.valueOrAbort) scale to a complex use case but is substantial enough to call it a new feature. It would significantly broaden the kinds of checks and transformations that can be done in compile-time, preventing even more illegal programs.

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

I have witnessed a small team of 3-4 experienced Scala developers delivering features for several years with a very low bug rate. I have also seen (Java, Node.js) projects of comparable size maintained by a ~3x bigger team, which barely keep the project afloat in maintenance mode, and everyone is afraid to make any changes.

How has the Scala community impacted your programming journey? Any standout interactions or support stories to share?

If, as a beginner, you ask an earnest, if silly, question, you are taken seriously.

When you open your first humble pull request to an OSS project, you are taken seriously.

It gives you the sense that what you do matters.

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

Coming from Java, I already knew generic programming, right? Then I came across this library, shapeless, calling itself a “generic programming library for Scala”. I was thinking, surely this was tongue-in-cheek. I don’t need a library to do generic programming! Then, I dug deeper. And boy, had I been missing out!

I already knew functional programming, right? I had completed the MOOC! Then I came across this library, scalaz, calling itself a “Scala library for functional programming.” Indeed, this was tongue-in-cheek. I don’t need a library to do functional programming! Then, I dug deeper. And boy, had I been missing out!

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

Learning Scala only on the job is unlikely to be the most efficient way. Scala is a pluralistic language, able to accommodate many different styles, idioms, levels of type safety, and levels of abstraction. It is Scala’s unique strength. On the other hand, making sense of a codebase with a mixture of styles, reflecting the team's own stages of growth can be too much to chew at once unless your mentor tailors and polishes the tasks to basically provide you with a custom-made tutorial. As that is unlikely, look for a polished tutorial elsewhere (e.g., the above-mentioned MOOC or a plethora of other introductory resources) to get you started. Then, feed your own curiosity.

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

I expect a renewed focus on Scala’s core strength, which is being a scalable language.

Scala can grow with the complexity of your project, from a throwaway script to a complex distributed system.

Scala can grow with the increasing needs of static guarantees, from “let’s run it and see” to “it compiles, ship it!”

Scala can grow with the level of abstraction, from moving bytes around to faithfully representing the domain.

Scala can grow with your learning experience, making it easy for beginners to enter (given a suitable initiation), but without putting a low ceiling on your growth or infantilizing the experts.

There will always be hype cycles and turbulent times in the industry, but even then, or especially then, scalability remains a universally desirable property of a language.

Celebrate Scala's 20th anniversary at Scalar 2024!

If you're interested in Scala programming and want to keep up with the latest news, you can follow the hashtag #scalaversary on X and Mastodon. Additionally, don't miss the Scala Fiesta at the Scalar Conference 2024, a two-day event that connects you with a fantastic community of functional programming enthusiasts. You'll also get the chance to learn from experienced IT experts and gain valuable insights. So, mark your calendar and join us for this exciting opportunity.


Blog Comments powered by Disqus.