Categories
productivity Uncategorized

2019 in a review and plan for 2020

At the beginning of this year, I started by writing a blog post about my goals for 2019. Looking at it now I realized how ambitious I was and how much time it would require to do all the things from the list. Something else I noticed is how little I changed my daily system to achieve those goals. I can confidently say that setting goals is not an optimal way of achieving something. That is why I am trying a different tactic this year. I will work on setting a new daily system instead of focusing on my goals for 2020. Of course, I will set some goals for 2020, but those goals will be of lesser importance than my daily workflow.

Goals vs Systems

So what is the big deal with systems? As with everything, boiling a thing down to its core elements can reveal quite a bit about the original thing. Setting goals is problematic in two fundamental ways:

  1. Goals are future-oriented and they are missing the crucial fast feedback loop
  2. Goals tell little on how to achieve them

So, to fix those two main issues the focus should be on systems instead of goals. This is one of those things that remains unnoticed until someone points it out. Everyone has a system that they follow in their daily life. The question is, is that the daily system set up in such a way that can help you achieve your goals? Most probably not, because goals require doing new things and that in turn requires acquiring new habits. Allocating time into a daily schedule is a crucial step in implementing the right system.

So, systems provide a solution to two major flows of setting goals outlined above. Firstly, systems are something that can be exercised daily, and the feedback loop is immediate. It’s as simple as asking a question, did I do 30 minutes of deep work on my new project today or not? If not, then I did not make any progress! The actual goal I am trying to achieve is hanging in the air. This feedback loop occurs every day and it’s a simple reminder that the actual goal I am perusing is not getting done any time soon. Another benefit of systems is that when we define a system to follow, we inherently have to come up with a plan on what behaviors will help in achieving that particular goal. For example, let’s say my goal in 2020 is to have a 10k mailing list. The goal itself does not mean anything unless we create a system around it to accomplish that. One such system is to set a time to write for 30 minutes, daily. That, in turn, requires changes to daily workflow. One could allocate that time right after work (and in doing that utilize a technique called habit stacking). Every day that those 30 minutes are skipped will be a reminder that the goal of 10k subscribers was just a wish on a piece of paper.

So, instead of plans for 2020, I will focus on systems and how to create a better system for myself. Currently, my system looks like this

  1. Wake up early, do some reading get inspired for the day
  2. Work 9 – 5
  3. Write a couple of paragraphs for my blog from 5 – 5:30
  4. Go home and rest

That’s it. That is my aim for 2020, a simple system to follow daily!

Categories
blog kotlin productivity

Force yourself to use Kotlin standard library!

Java world vs Kotlin world

One of the main stumbling blocks I encountered when I tried to use Kotlin is how can start writing Kotlin code using Kotlin idioms, instead of just writing Java code with Kotlin syntax. To explain what I mean let’s imagine we want to filter a list of links, and extract only links that contain “.com” domain. That can be done in java with this:
https://gist.github.com/abdurahmanadilovic/2b97a1391e32f746bd60f45d8a95cfa5
This example repeats itself in Java code all the time, but with Kotlin now, there is no need to write code like this ever again.

Filter

In Kotlin there is a generic extension function that can do this for us, it is called, filter. To rewrite this example in Kotlin, it would look something similar to this:
https://gist.github.com/abdurahmanadilovic/b180f506d9851486cba288cfdffea5e7
How beautiful is that? And Kotlin has lots of these extension functions that will simplify our life when doing common operations on collections in our code.

Map and forEach

What if you need to transform a list of type String, into a list of TextViews, and append all those text views on a root view, how would you do it in Java?
https://gist.github.com/abdurahmanadilovic/f61eed70684d16df3560150e7941a1f6
Now, compare that to this Kotlin code that does the same thing:
https://gist.github.com/abdurahmanadilovic/e2e1ecd0ee2c69f8c96ea0ae2915c1c2
Here .map was used for transforming a list of Strings into a new list of TextViews, and you can access each String with it keyword. Then forEach was used to iterate over the text view list and append each to the root view. But we can simplify this even more.

Chaining

One of the main benefits of using built-in collection extension functions is chaining. We can now combine map with forEach:
https://gist.github.com/abdurahmanadilovic/53cc609074f78dc207dd2866ada5e5ae
But why stop there, lets chain from the beginning:
https://gist.github.com/abdurahmanadilovic/4c0a2fea3ed076a522f7cf8ae67dbfde
Now that is much simpler and easier to understand than the Java equivalent.

GroupBy and Any

GroupBy can be used to create hash maps, with the return value from the lambda as a key, and the object itself as the value.
Any is also interesting, if you apply it to the list you must supply a lambda that returns a boolean which then checks if that lambda returns true for any items in the list.

Think standard library

Every time you write a Kotlin code, ask yourself is this Java style of coding, or is there a better way to do this in Kotlin? And most probably there is, every time you do some operation on lists, think how can this be done with Kotlin standard library. For a list of all things related to collections explore this link. You can find documentation for map, forEach, filter and lots of other functions that can be applied to collections.

Conclusion

Mastering Kotlin will take some time, but the important thing is to always be on the lookout for ways to write code that utilizes Kotlin language features to the maximum.

Categories
blog productivity psychology

Don't trust yourself, trust your daily routine!

The power of environment

Most of our daily decisions are automatic, and most people do not even realize that. The brain is a very efficient machine, everything becomes a habit after a while, meaning that who you are today is mostly habits and a small part of it is your active thinking. If you do not believe me, go back through your day and try to find at least three events where you stopped, thought about what are you doing, or you questioned your decision, then did that thing.
So why do we ignore our habits when we want to change and reach our maximum potential?
Do you check your phone every 5 minutes while you work? Do you check your emails every 10 minutes while you work? If you do something without thinking about it, that is a habit you built over some time, and if you stack multiple bad habits on a daily basis it may be the biggest cause of your low productivity and stress. You know you have to improve your work, but you simply can’t, you end up on the same level you were a month ago, or you descend few levels.
If you do not feel any progress in quality of your work from month to month, it is time for you to seriously reconsider changing your current work environment.

Environment by design

As with anything in life, you can passively receive things, and wait for someone to shape you, your life, or you can be proactive, a habit worth acquiring, and shape your environment so you can shape yourself the way you want to be.
I used to catch myself sometimes spending few hours on browsing facebook and youtube without realizing it and I don’t know how I got to that point at all! I do not remember the point where I decided to open facebook or youtube, so how did I end up wasting the last few hours on pointless entertainment?
I realized I need to proactively block my access to those sites, so I edited my hosts file and redirected facebook and youtube to 127.0.0.1. So every time I want to open facebook or youtube, I have to open hosts file, remove the redirect command, close the file, restart all browsers and access facebook and youtube. And that process cannot be automatic, I need to do that intentionally, and that was enough for me to prevent that habit of opening facebook and youtube without even thinking about it.
The next thing I did was to leave my phone in the other room, so I don’t even see the notifications when they pop up, I am free to focus on my work.
I did leave facebook or youtube available on my old laptop, so when I want to watch youtube or open facebook, I would take the laptop and access those sites, but that would be on my own terms when I am satisfied with the work I did, and I want to take a longer break.

Prevention beats cure

You can not trust yourself, your brain is on autopilot most of the time, don’t count on your brain ignoring phone notifications, don’t count on not opening youtube or facebook, you are driven by habits, facebook and youtube specifically exploit that by creating the dopamine loop that forces you to go back to those sites and engage with them frequently.

How we spend our days is, of course, how we spend our lives.

The quote above is from Annie Dillard, and there is a great article on brain pickings about her book The writing life, a great piece of worldly wisdom.
In summary, place systems that produce environments that nudge you towards high focus and productivity, and you will be more consistent with your work quality, otherwise, you are just responding to outside stimuli.
 

  • Environment has a stronger impact on your productivity than you think
  • The only way to make sure you are focused is to eliminate the possibility of a distraction (leave your phone in the other room, block sites)
  • Purposely create environments for your self that nudge you towards productivity (turn of wifi on your phone, leave a book on your living room desk, sell your TV)
  • How I constrain my internet usage
  • If you feel like you need to relax, don’t open youtube, take a walk or go talk to someone
  • Avoid instant gratification to get used to low dopamine input and to increase your ability to focus, deep work
  • Be aware of your decisions when you perform your work, question everything to produce quality work