22 An Interview with Marcin Moskala¶
Marcin Moskala is an experienced developer and Kotlin trainer. He is the founder of the Kt. Academy, an official JetBrains partner for teaching Kotlin, author of the books “Effective Kotlin” and “Android Development with Kotlin”, a speaker at many international conferences, and a programming library creator and contributor.
Marcin Moskala
Connect with Marcin¶
Twitter: @MarcinMoskala
Interview¶
How do you start your day off with a bang? Do you have any secret morning routines that set you up for success?¶
I generally have a morning routine, but it changes over time. I usually start my day with water and either a morning workout or a run. Then I eat my breakfast, and I take a shower.
I start my day with the most important task. Not the most urgent one, but the most important. It is generally a deep-work task—a task that requires a lot of concentration without any disruptions. This is why I don’t let anyone disturb me, and I don’t check email or any other communications.
If it is programming, I often work until evening. When it is a book writing or a presentation preparation, I am generally out of ideas after 3–5 hours, and then I switch to shallow tasks like emails or all the small things I need to do every day to maintain and develop Kt. Academy.
How do you stay highly productive for long periods?¶
I have quite an obsessive nature, and I need to force myself to remember about breaks and exercises. Otherwise, after a few weeks of obsessive work, I get totally out of energy, and I need a few days of absolute chillout. It is good to have some quiet time during the day. When you need a break, instead of some news or media, choose a walk or meditation. When you watch a short movie, you might think that it takes only a few minutes, but your brain still processes it for hours. It steals your concentration and tires your mind. If you have too little stimuli in your job, then it might be helpful though it is rarely an issue for programmers.
I recommend a few different books for when you are thinking about being more productive. Deep Work: Rules for Focused Success in a Distracted World by Cal Newport, for keeping yourself in a good state for work. Flow: The Psychology of Optimal Experience by Mihaly Csikszentmihalyi, which is about finding and enjoying the right state of mind when you work. And, finally, Getting Things Done: The Art of Stress-Free Productivity by David Allen for better task management.
You were working remotely for several years, and now you have settled in Poland. Do you think remote work and traveling has made you a better developer?¶
Working remotely for a long time is an important experience. When you work remotely, you need to show that you’ve done something every day, because otherwise, some people will suspect that you are slacking. They cannot see that you are working at something all day. So you end up doing more. On the other side, it generally takes less time because you don’t waste so much time for driving, meetings, lunches, coffee talks, etc. Using all this time to work more is a sure way towards burnout—everyone needs social interactions and breaks. Spending it on TV or games is extremely dangerous. The art is to use it wisely.
So I discovered that the two most effective ways to recharge are having a walk and a nap. Both are nearly unimaginable in a company, but very efficient when you work from home. Though you still have some extra time you don’t waste for driving, and you need socialization since you spend most days alone or with your loved ones. My solution was to get active in the programming community. I started writing articles and attending conferences. It was well-directed energy.
For people interested in being a nomad and working remotely, I’d tell them to try it! It is not as hard as it looks like. Plane tickets are cheap nowadays. For most countries, getting a visa is easy or not required at all. You can either find a remote job or just save some money. Both options are not a problem for programmers.
In drawing insight from outside sources, which do you prefer, podcasts or books?
I am an absolute bookworm, and there is no comparison. I like podcasts when I am running because I can deconcentrate at any point and, after that, quickly get back on track. This makes them perfect when you are doing something else like listening, like driving or household duties. Most podcasts forgive missing a few sentences, while books do not, because books generally build knowledge brick by brick. They require more concentration, but in return, they can dive much deeper into the subject. They can truly teach and change the reader’s understanding. Books are generally more demanding than other sources of information, but it pays off. There are concepts that I can’t imagine learning in any other way but by reading a book. This is why I recommend everyone spend at least 15 minutes every day reading a book.
What are the three (podcasts/books) that have had a lasting impact on how you do your work?
My work today is twofold. On one side, I am a programmer. On the other, I am teaching programming, speaking at conferences, and writing books. So I will give two answers.
About programming, I was strongly shaped by the absolute classic, Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin. I still believe that this book, together with the rest of the “Clean” trilogy, which includes Clean Code, Clean Programmer, and Clean Architecture is perfect for young developers. As a more advanced Java developer, I was strongly shaped by Effective Java by Joshua Bloch, one of the most important best-practices book for Java. And about the philosophy of being a good programmer, I was strongly influenced by The Passionate Programmer: Creating a Remarkable Career in Software Development (Pragmatic Life) by Chad Fowler.
About being a speaker and entrepreneur, there is a book that initially inspired me to start this journey: The 4-Hour Workweek by Tim Ferriss. It inspired me to travel and start my first business. Both turned out totally different than I expected, but they were both great journeys that changed me positively.
The main reasons for travel in the book were that you can learn a lot from other cultures and that in some countries your money is worth more because prices are lower. If you want to build a startup and you won’t earn money for some time, this can be a great advantage. I felt fascinated by this idea, but in the end, both statements turned out to be only partially true to me. It’s true that local food products like veggies and fruits are much cheaper in Asia, but to find high-quality food you need to pay similar prices to Warsaw, where I am from. We came across similar situations with a good standard flat.
During our travel, we discovered new things and learned how other cultures can be different—it takes you out of the box and makes you rethink your beliefs. I recommend this experience to everybody, but it also has some drawbacks. You cannot participate in a long-lasting stationary course so there are things you cannot develop during travel. Also, you cannot do your hobby if it involves some community or special equipment.
In the end, long travel turned out to be a great adventure for me, but not the way to live. I recommend everyone experience it, see both the bright side and the drawbacks, and then make your own decision on what suits you the most.
Another really important book to me is The Lean Startup: How Today’s Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses by Eric Ries. It is often known as “the Bible for startups,” and it changed my thinking about how to do business. I recommend it to anyone starting any project. And the last book that helped me in the chaotic world of business and self-employment was Antifragile: Things That Gain from Disorder by Nassim Nicholas Taleb. It helped me understand chaos; it’s a different work and we aren’t used to it. It is not that bad. It just has its own rules, problems, and strengths. But, this is a topic for another interview.
“The hard way is an excellent way to learn essential lessons. There are many mistakes you have to experience or, otherwise, you will never fully understand what to do and how to avoid them.”
Beyond the insights from these books, what is something you wish someone had told you back when you started software development that you had to learn the hard way instead?
I believe that the hard way is an excellent way to learn essential lessons. There are many mistakes you have to experience or, otherwise, you will never fully understand what to do and how to avoid them. I made a lot of mistakes, and those experiences are my most valuable assets.
An example of a hard mistake was my first business. There is no better school of humility then truly believing in something and spending all your time and energy on it, and then seeing how it slowly fails. I started questioning all my beliefs, and it made me much more rational in the long term.
Your career is focused on teaching and providing training to folks around the world. You are a JetBrains certified trainer, founder of Kt. Academy and a frequent workshop instructor. What are the mistakes that people keep making when trying to acquire and apply new knowledge? How can this be fixed?
I believe that our community managed to create really good ways to gain knowledge. I suggest using these solutions, and remembering a few things. The social aspect is crucial in learning. Discussions between programmers are a useful way to share knowledge and news from the industry. I’ve also noticed that conferences are much more efficient than learning alone in the home.
If you want to migrate to a new technology with your whole team, workshops are much better than everyone learning separately.
Moreover, there are tons of useful materials for each technology—courses, books, meetups, webinars. Many of them are free. Choose those that fit you best and use them. Articles are perfect for staying up-to-date, but they never go deep enough. To go deeper, it is better to choose books, workshops, or courses. Practical courses or katas are important to practice real skills. Doing a bigger project by yourself in a newly learned technology is another important skill that should be practiced. If you want to learn something and stay truly up-to-date, do not rely on just a single kind of knowledge, but instead use them all.
And, of course, practice, practice, practice. Whenever I learn a new language or technology, I do a small project to practice my new skills. It can be anything. I enjoy making applications for workout management, but I sometimes also do games, news, or to-do lists.
As an expert in education, what are some lesser-known sources of information you rely on for learning?
In our industry, information flows very fast, and so good sources of information are generally well-known. To summarize the ones that I believe are the most influential: an RSS feed with the best blogs in your discipline is excellent as this is something we develop through time. Books, of course. Reddit, forums, Facebook groups, Twitter, feeds on Slack, or other social channels are a great community source. Stack Overflow and Quora, as well as other online resources like online courses from websites like Coursera, Udacity or edX. As I mentioned, conferences, meetups, and workshops—especially ones that get you out of your bubble. And, finally, documentation, katas, example projects on GitHub.
One way of learning I actively use, and that is not well-known is a spaced repetition applied for learning programming. I use a program called Anki. It has a significant base of free decks created by the community, of which many are about programming. They generally teach about nomenclature, functions, or technology characteristic behaviors. Though there are also some funny decks that show programming using small challenges, this technique is known as the Anki method. I have used Anki for over six years, and, according to my statistics, I used it on over 70% of days. After this time, I can recommend it as an excellent way to learn.
In terms of a knowledge base, you are an established expert in Kotlin. In what ways do you think Kotlin is shaking up the industry?
A characteristic of Kotlin is that it is not trying to be original. Just the opposite—it uses well-established solutions in the best way known to the industry. It is well-designed. The two features that are genuinely shaking the industry are Kotlin Coroutines and Multiplatform development capabilities.
The idea of coroutines is pretty old, but it took a long time to implement it properly. They did a fine job, but their solution has some limitations. Kotlin pushed it way forward. Kotlin Coroutines are an ultimate solution for concurrency, which gets more and more important with more and more cores in our processors. The Kotlin Coroutines library gives us a powerful concurrency model, but the real revolution is built-in support that can be used to reproduce any other concurrency model known in other popular languages. This gives huge freedom to library creators, and I hope that it will help us finally establish a concurrency model that is intuitive, safe, and readable.
Another huge advantage of Kotlin is that it allows multi-platform development, meaning that it can be compiled to JVM bytecode, JavaScript or native code. Therefore, we can have a full-stack project all in Kotlin, with, for instance, Spring on the backend and React on the frontend. We can also have a common module written in Kotlin that is used both on Android and by Swift on iOS. We can extract common logic or even network or database operations; there are common libraries for that. It also provides great power for library creators because they can implement a library in Kotlin once, and distribute it in a way so that it can be used not only in Kotlin, but also on all JVM languages (Java, Scala, Groovy), JavaScript languages (JavaScript, CoffeeScript, TypeScript) and even in native languages (Objective-C, Swift, C, C++, Python, Go etc.).
What do you think are the best ways to learn Kotlin, if you are coming from a different language background?
For an individual, I would recommend a combination of books and Kotlin Koans. Then migrate your project to Kotlin or just create a new project in Kotlin. There are also free online courses available on Coursera, made by the Kotlin team, and on Udacity, made by Google. When you need your team to move to Kotlin, workshops are very efficient. This is why I devoted myself to conducting them. I often stay in touch with companies, and I was always informed that after a three-day workshop the whole team moved to Kotlin, and they are happy with this transition.
How do you manage to be a prolific contributor to the community?
I believe that everyone needs to find their place. I did many different things including library development, community discussions and event organization. All those activities are very important, but in the end, I discovered that I feel best in teaching. This is something I truly enjoy. I believe the key is to find what you enjoy and are good at, and just do it as much as possible.
What do you consider as the biggest failure in your career? What did you learn from that failure?
I started a company selling a brain supplement. It was called Nootro, and the product was a bit similar to Nootrobox, now known as HVMN. The product was good, but we knew nothing about selling in the supplements industry. In the end the company failed. Now, I am happy about that. This failure was the best business lesson in my life. There is nothing so much eye opening as truly believing in something and seeing how your vision brutally crashes with reality.
Marcin’s Recommendations¶
- The Lean Startup: How Today’s Entrepreneurs Use Continuous Innovation to Create Radically Successful Businesses | Eric Ries
- Clean Code: A Handbook of Agile Software Craftsmanship | Robert C. Martin
- Antifragile: Things That Gain from Disorder | Nassim Nicholas Taleb