Sergey Maskalik

Sergey Maskalik's blog

In the pursuit of mastery

In his book, Atomic Habits, author James Clear tells a story about a struggling British cycling team that for over a hundred years won only one gold Olympic medal and did not win a single Tour de France, cycling’s biggest race . After the team hired a new performance director, he brought with him a new philosophy, referred to as “the aggregation of marginal gains,” which focused on tiny improvements in every thing that you do. Together with his team, the new director introduced over a hundred small improvements, including redesigning a bicycle seat, testing different fabrics for air dynamics, and rubbing alcohol on the tires to make them grip better. He even brought in a surgeon to teach riders how to wash their hands better so they would not get sick.

All these minor improvements had an incredible impact. Within five years after the new performance director took over, the team won 60% of the gold medals for the cycling events at the 2008 Olympic Games in Beijing.

If we apply the same philosophy to the software engineering teams, what type of tiny improvements could have a big impact in the long run? Here are a few that I think can be a good start.

Incremental Refactoring

By creating a good habit of leaving the code base better than it was before, chances are that our projects would be easier to maintain in the long run. Besides making the code more expressive, easier to read and modify, engineers can also add missing unit tests, cleaning up legacy comments, or format code. I think the trick is to have a balance and sprinkle improvements a little bit over time. Nobody wants to review a huge refactoring for correctness when it’s unrelated to the task assigned. As a bonus if you could separate refactoring in a separate pull request, your reviewers will thank you. Finally, if you are looking to learn more about refactoring, I highly recommend the book, Refactoring: Improving the Design of Existing Code.

Small Bug Fixes Without Tickets

Not every bug fix needs to go through a process of writing up a ticket, getting it estimated, prioritized and planned. If the bug fix is small enough and the engineer has the context around it, it is worth fixing it along with the primary task. The cost of the bug fix at that moment will be significantly lower and will not require a context switch for another engineer or yourself a few months later. Finally, customers will appreciate quick fixes if it affects them.

Document Root Cause Analysis for Major Incidents

Every failure is a great opportunity to learn from mistakes. Before we can do that, we must first gather all available information about the incident, ask five whys, and create an action plan on how it can be prevented in the future. It’s also valuable to share this information with the stakeholders and team, because they might have a different perspective and offer valuable insights that might not be obvious to the author. In addition to improving processes, documenting incidents is also valuable for tracking purposes; it helps to determine if the team is improving over the long term.

Reviewing Logs After Deployments

Reviewing error logs after each deployment can help identify issues caused by newly released code and get them resolved right away. It’s much cheaper to fix bugs when the context is fresh in the author’s mind. And it could help to save a lot of time and frustration for customers, support and the engineering team. Some bugs could require a data back-fill or other escalation, and if left unchecked, can create a lot of unnecessary work.

Quick Responses to Questions and Requests

When researchers compiled a huge database of the digital habits of teams at Microsoft, they found that the clearest warning sign of an ineffective manager was being slow to answer emails. Responding in a timely manner shows that you are conscientious — organized, dependable and hardworking. And that matters. In a comprehensive analysis of people in hundreds of occupations, conscientiousness was the single best personality predictor of job performance. - Adam Grant No, You Can’t Ignore Email. It’s Rude.

According to Adam Grant, an organizational psychologist, quick responses are the best predictor of job performance. Because our customers and peers are our top priority, it makes sense to try to get a little bit quicker at responding to emails or messages. I can vouch for this myself. I certainly appreciate when someone on my team reviews my code review request right away; it prevents me from switching off to a different task and allows me to get more stuff done.

README Files

Putting together a README file for projects will save time when someone else, or yourself in the future, has to get started on the project. You can find suggestions on how to make good README files here. Small investments into better documentation will pay off in the future.

Do Not Stop Here

This was not meant to be an exhaustive list, just a starting sample of things that may or may not work for your projects. Most important are not the improvements by themselves, but the willingness to adopt a philosophy of continuous aggregation of improvements that will make a difference in the long run.

This is my first attempt at reviewing my yearly progress. Inspired by James Clear’s yearly reviews, and similar to a sprint retrospective in Scrum methodology, it’s an opportunity to look back and see what things worked that I should continue doing or where I can improve. In addition, because I have a hard time remembering things I did in prior years, having a point of reference will be valuable for my future self.

The idea is to answer the following three simple questions:

  1. What went well this year?
  2. What didn’t go so well this year?
  3. What did I learn?

What went well this year?

Reading. Last year stumbled upon a great book on reading itself, How to Read a Book. Prior to reading it, my reading was at the elementary level. With the new knowledge acquired from this book and with practice, hopefully I can progress into analytical reading and beyond. Finally, this book also inspired me to look into books with topics outside of my current interest and difficulty and provided techniques on how to approach hard subjects.

On a different note, I picked an excellent tip from one of the interviews with Derek Sivers on how to retain information. In order to remember ideas from the books that he reads, he takes his notes and publishes them on his website. This gives him the ability to access his notes from anywhere. Finally, he has a habit of reviewing his notes for a random book every morning. After struggling with remembering information from books for a long time, I’m eager to try his approach and have already published a few book notes myself.

This year I read: The Three-Body Problem, Joyful Wisdom: Embracing Change and Finding Freedom, Awareness, Stillness Is the Key, A Guide to the Good Life, Atomic Habits, C++ Crash Course, How to Read a Book.

Overall it wasn’t a stellar year in terms of volume, but rather it’s my approach to reading, improving depth and retention that I am most excited about.

Traveling. I had a great time in Hawaii on the island of Maui with my wife and daughter. It was great to spend a couple of weeks at the beach and swim in the warm waters. One of the highlights was when we took a side trip to the Big Island and went snorkeling in the crystal clear waters with beautiful fish and corals. My wife and I were amazed to see my daughter, almost two years old, fearlessly jumping into the water from the boat and swimming in the deep water with her floating device.

Exercise. Besides having many bouts of back spasms and getting sick more than usual, I was able to come back to my workout routine and be more or less consistent. When we traveled I wasn’t able to exercise and actually experienced craving, which was very encouraging.

Workouts per month in 2019

Month Workouts
January 8
February 16
March 19
April 12 (sick)
May 2 (travel)
June 4 (sick)
July 7
August 13
September 8 (back)
October 12
November 3 (sick)
December 7 (sick)
Total 111

What didn’t go so well this year?

Health. I was sick more than usual this year. Perhaps my immune system is not strong enough, so when my daughter gets sick there is no way I can avoid the germs. Also my sleep has been a bit broken because I tend to wake up many times. I have been experimenting with different things. The latest sleep improvement approach I’m trying at the moment is to keep the temperature down using a sleep system, which hopefully can help me stay asleep. This past year was also stressful at work, so that could have also contributed.

In addition, I’ve been plagued with multiple instances of back spasms. I found a promising book, Pain Free, that I’m in the process of implementing. Finally, Peter Attia M.D. has a set of videos on proper movement, which I’m also planning to practice this year.

Writing. I didn’t publish a single blog post last year. I urgently need to improve my written communication and strongly believe that the only way to do it is through practice. This year’s main goal is to build a writing habit (Q1), and then scale up my writing slowly to two articles per week.

Products. While I’m very fortunate to work at a great company and enjoy what I do, the downside of it is that I don’t build equity, and at the end of the day, I don’t own anything that I build. These past two years, I was solely focused on my day job, so this year I want to change that. I want to start out small and build a small mobile application for fun and to get into a habit of working on side projects.

What did I learn?

Focusing on systems rather than goals. Goals are great but they alone don’t help if you don’t have a system on how to implement them. I think that was my biggest failure point in the past. I would focus on pure willpower and motivation, work extra hard on a new goal, and then eventually burn out and stop. I think designing a system where I can focus on building a habit first, slowly, one day at a time, and then eventually scaling out effort should help me be consistent over the long term. Finally, the most important point of the system is to make it easier to work even when you are not motivated, or you don’t feel like it.

This also somewhat aligns with what I learned from Stoic’s teachings. You want to set internal goals, or goals that you can achieve, rather than external goals, something that is outside of your control. For example, building a successful business is an external goal because there are a lot of things that are outside of your control, and if you set a goal like that you most likely set yourself up for disappointment or frustration. On the other hand, setting aside thirty minutes a day and working on something to the best of your ability is something that is totally up to you and is achievable.

Writing things down is important. If I want to retain ideas from books, I have to write them down and review them periodically. It is a shame that this year I bought a book and could not tell if I had read it before or not. It had only been four years since I bought it. I think I can get an exponential amount of benefit if I can retain this information, otherwise I’m only getting a small amount of benefit. The same goes for podcasts and audio-books. I enjoy consuming the content, and there are many great insights, but all those wash away very fast if I don’t write down the ideas and action steps.

Financial independence. One way to achieve financial independence is to save 25x of your yearly expenses. The choices we make in regards to our lifestyle get us either further or closer to independence. A closet full of clothes would definitely give you something new and exciting to wear every day, but it may cost you six months of your life. That luxury car may cost you years of sitting in the office at a desk and doing something that you don’t enjoy. Every purchase we make is trade. We trade our time, a non-renewable resource, for things that we don’t need. For myself, I would rather spend this time on something that I can enjoy, like spending more time with my family or working on things that interest me.

Sleep. Quality sleep is super important for many aspects of our wellbeing, including recovery, cognitive performance, and immune function. I’ve been tracking my sleep over the past year with an Oura ring device and it made me aware of the following things that impact my sleep:

  • Alcohol. This one is pretty obvious, but I didn’t realize that having a few drinks before bed elevates your heart rate for the entire night, similar to a light walk. Having your heart work overtime through the night when it should be resting is probably not doing a lot of good. It also negatively impacts very important deep and REM sleep.

  • Big dinner or dinner with lots of carbohydrates within three hours of bedtime. Having pasta for dinner will keep my heart rate elevated for the first half of the night, affect my deep sleep and cause me to wake up in the middle of the night.

  • Caffeine in the afternoon or evening. This affects heart rate variability and REM sleep.

  • Late screen time. This affects deep sleep and overall quality of sleep. When I was younger I used to play a lot of video games late into the night; little did I know that this was really bad for my health and athletic performance.

  • Sporadic bed time. Going to sleep later than usual will significantly decrease sleep quality by reducing deep sleep.

  • Movement. Consistent exercise will decrease the resting heart rate and improve overall quality of sleep. This is pretty obvious but good feedback.

The bottom line. I learned a lot of good things last year which will hopefully help me to grow in the future. This year, I’m planning to implement what I’ve learned and make it a year of building new good habits.

Thanks for reading and happy new year!

Atomic Habits

I really enjoyed this book, and I would highly recommend it to anyone who is trying to work on something that requires a lot of effort. By establishing tiny, incremental improvements in our lives, the benefits will accumulate and grow, like a financial investment. Eventually the investment will reach a critical point, and you will see a massive change. The author, James Clear has an interesting solution on how to form a habit, you want to make a daily task super easy. For example, if you are trying to be a more consistent writer, your initial goal would be just sitting down to write for two minutes every day until you’ve established a habit. Only after you’ve made it your habit to write a little bit daily, can you progress to increase the difficulty of the task..

The entire book is full of many other great techniques and stories. After implementing the author’s suggestions in my own life over the last month, I can already tell that they work better than pure motivation. There were many days when I didn’t feel like performing the task at all, but by just telling myself that it’s super easy and it would take just a few minutes, I was able to complete it. I’m looking forward to continuing to work on building my habits, and if my writing habit works, I will report on the progress.

A Guide to the Good Life: The Ancient Art of Stoic Joy

This book was highly recommended by Tim Ferriss on his podcast, and it quickly became one of my favorites. Stoic philosophy provides ancient wisdom that is still relevant today. It explains that without a coherent philosophy of life, humans are more likely to default to pleasure maximization and distractions that will lead to squandering time, or worse, pursuing something that would not fulfill us in the end. Because Stoic philosophy is based on logic, a lot of it makes sense and does not require you to believe in something abstract or intangible.

Stoics believed that the key to happiness is to prevent ourselves from taking for granted things that we already have. Because a lot of human unhappiness comes from a desire to have more, if we practice appreciation for all the things we worked so hard to get, we can trade desire for enjoyment. In addition to being grateful, another technique would be to imagine losing the things that we already have. This would also make us appreciate our existing situation and not take things, relationships or our health for granted.

Another great piece of wisdom that I really enjoyed was the importance of setting achievable goals. Achievable goals mean, if I play a tennis match, winning the match would be outside of my control, and therefore would not be an achievable goal. Why? Because I cannot control my opponent or the environment; for example how good of a player she is, or if the sun is in my face. Rather than focusing on winning the match, my goal should be to play at the best of my ability, whichis something I could certainly achieve. By setting achievable goals, we prevent ourselves from getting disappointed and as a consequence discouraged and frustrated. In Stoic philosophy achievable goals are also called internal goals, versus external goals something that I don’t have control over.

I hope you enjoy this book as much as I did and that your life will be more joyful and fulfilling.

C++ Crash Course

After more than a decade of working with managed, high level languages, I needed to work on a cross platform project written in C++. I quickly discovered that it was hard to find a good reference on modern C++ without it being too overly complex or having to learn previous versions first. This book filled the gap that I had, and I would highly recommend it to any experienced programmer picking up C++ for the first time.

Flour Water Salt Yeast: The Fundamentals of Artisan Bread and Pizza

I give this book honorable mention because after reading it, I was able to consistently bake great tasting and looking bread. I love my carbs and a lot of times bread bought from the store does not satisfy me. If you’ve never baked bread, it is a great exercise where you can step out of your comfort zone and practice your beginner’s mind. It was also fun learning about the fundamentals of bread baking, with its different flower types, fermentation, and hydration.

bread picture