Marcin Moskala is an experienced developer and Kotlin trainer.

He is an official JetBrains partner for Kotlin training, founder of Kt. Academy and main author on Kt. Academy technical blog . He is a speaker at tech conferences. I met him at KotlinConf 2018 where he had talked about Effective Multiplatform Kotlin Development. He is the author of the book Android Development with Kotlin and recently released Effective Kotlin. We share a common curiosity about everything releated to learning and mentoring, so I asked him to answer a few questions for you.

Who are you?

Marcin, can you first tell us a bit about you personally? Who are you as a person and what makes you tick?

This is an interesting and important question I have been asking myself lately. What I think truly makes me tick is learning. I love learning and I spend a lot of time on that - researching, reading, learning from flashcards, trying new approaches… It makes me feel great and it makes me think. As a result, I am having a lot of ideas and knowledge to share, and when I have them I feel I need to check ideas and share the knowledge. So I write, teach, speak, etc. It is clearly not the only mechanism that drives me, but in retrospection, I think that this one is quite strong and in big part led my last years.

On Training

I feel that most IT companies are under-investing in Training. Sure, there is an infinite amount of information on the internet, and given an infinite amount of time, a developer team can learn everything on its own. But Time is, in fact, our most precious resource. Can you talk about your experience working as a Kotlin trainer?

Yes, training can speed-up the learning process.

What I think is even more important is that it triggers the whole team to start using a new tool. So practically all the teams I trained reported to me that they started using Kotlin everywhere straight after my workshop.

Another thing is that it motivates us to learn things people often forget about. Too often people just copy-paste without understanding.

A simple example: Say that you use Gradle. Learning how it works might probably make your life easier in the long term. It is possible - there are some good fee Gradle courses and materials on the internet. But people generally assume they don’t have time for that. Although if they join a workshop, they have time dedicated for that and they can truly learn that in depth.

How to write a programming book that stays relevant?

You just released your second book: Effective Kotlin. I know some devil advocates that say that programming books are useless because their content gets quickly obsoleted. I think they are wrong for example for beginners’ books, those are really useful. But your book is aimed at experienced developers. What strategy did you choose to make sure your book stays relevant as Kotlin evolves?

I was actually thinking a lot about it as I observed that most Effective Java items are not relevant in Kotlin or could be solved with good warnings instead of developers remembering the best practices.

Though then I noticed that my favorite items are not Java-specific at all:

  • Favor composition over inheritance,
  • Design, and document for an inheritance, or else prohibit it,
  • Minimize the accessibility of classes and members,
  • Minimize mutability.

So I decided to describe more general concepts that are important in Kotlin.

In most items, I am explaining general timeless rules and showing how do they apply in Kotlin.

Those who finished the first chapter on Safety might recognize that I present the idea of explicitly stated preconditions and postconditions and that in Kotlin we express them using require, check and assert.

Or the idea of defensive and offensive programming and how they are applied in Kotlin to eliminate nullability.

It is especially true for chapters 3 and 4 which describe many high-level concepts.

There are some items that might change over time.

For instance, since function interfaces were introduced to Kotlin, we need to rethink as a community when should we use function types and where function interfaces instead.

Effective Kotlin

After you gave me an instance of "Effective Kotlin" at KotlinConf, five people stopped me to ask where they can grab their versions. So I can attest from first-hand experience that there is a demand for your book. Where should my readers go to find it?

Polish

Andrey Breslav made you smile during his keynote by saying that the focus was now to make Kotlin more POLISH. Can you tell the non-Polish among us what the Kotlin community looks like in Poland?

Well, probably it was totally accidental, but as a polish, I had to catch that word-game. About the community, there are many great conferences organized in Poland. I think it is a perfect place for conferences: in the middle of Europe, part of the EU, highly civilized and English speaking, and yet relatively cheap.

Although I am a bit disappointed about the Warsaw community. There are many Kotlin-related events in Krakow and Wroclaw, but not so many in Warsaw. I hope to change it, and so I support local communities and I started organizing a new conference we call Kotlin Day and Night. We are now talking with sponsors, but it seems that we will be able to organize the first edition in Oct 2020.

Underhyped projects

Do you have any favorite-but-not-well-known Kotlin project that deserves in your opinion more publicity?

In general, I think that in our community we have an effective flow of ideas.

One project I think is underestimated is MockK which is a powerful and multiplatform alternative to Mockito. It’s the only problem is a few sec startup time, but except for that, it is much more convenient and featured than any other mocking framework I ever used.

There are a few nice project examples like Igor’s Android-Showcase or Saket’s Press.

Contact

Where can people reach you if they want to know more?

For public questions, https://twitter.com/marcinmoskala is the best place. For private ones on conferences.

If you need technical help, I suggest Kotlin Slack public channels or Stack Overflow.

There are many experts there ready to help.

This post is also available on DEV.