Aug 6, 2017

Parenting software engineer

It was a cold day for spring when my wife gave birth to a beautiful baby girl, Sarah. Despite the snowy weather, Sarah was sleeping peacefully in her mother’s arms. Being overwhelmed with grateful feelings after watching the faces of a newborn and her mother, I realized a passion to create something and send it out to the world was evolving inside me. Giving birth is definitely the most beautiful and creative act that weaves a rich tapestry of life. I as a male software engineer wanted a closer experience to this. That was the moment I decided to start a new project.

I named this project Sarah. This project would not only be a good memento of my daughter’s birth but also be a good memory of our growth: both my daughter’s and mine. There is no doubt that the software industry is among one of the most rapidly growing industries, and therefore the environment surrounding an engineer also changes rapidly. This fact frightens me all the time. Once I stop improving myself and adapting to the changes, I will easily be left behind. I need to grow as much as my daughter does. However, many parents complained that having kids gave them less time to work on what they wanted to, and there was nothing they could do about it. This was a reasonable complaint I was not going to agree with. Having a daughter must be something that enriches my life; not something that burdens me. If there is someone to blame, that should be me. Working on a new project that focuses on a new area of interest should help me improve as a software engineer.

For this project, I chose a customizable chatbot framework as a theme. It was 2015 and creating chatbots was becoming a new trend. From a technical perspective, creating a chatbot framework involves skills such as follows:

  1. having a better design to clearly separate abstraction from the implementation layer
  2. having a better understanding of multiple communication protocols depending on what chat service to adapt.

They captured me as promising challenges that bring me to the next higher level.

I started implementing Sarah with Python 3.5. At that time, the official announcement of the PEP 484 release was around the corner and PyCharm was working on adapting the type hinting feature. While learning Python, I found a package named abc that could be used to define abstract base classes. I thought a combination of type hinting and abc could provide well-structured architecture. The decorator was also a good solution to minimize the plugin function’s specification by wrapping its core logic with actual messaging logic. However, it became obvious that I took type hinting too seriously. Instead of passing around an arbitrary dictionary as a function argument, I preferred to define a designated class to represent a particular object and pass its instance. I even implemented a base class called ValueObject to provide immutable objects. Passing those objects among public interfaces could be a good idea in terms of unambiguity, but I did the same to private methods. At this time Python’s flexibility was lost and my code became an inferior Java.

A few months later I redesigned this project and started implementing it with Golang. I found learning Golang was a joyful experience. The previous Python codebase not only gave me a better understanding of the whole picture but also presented some hidden requirements that I missed last time. To fulfill the requirements, I added another layer called Runner at the bottom. An adapter focuses on connecting to a designated chat service; Runner focuses on coordinating and supervising other components. Thanks to this newly added component, the other components’ implementations became simpler and more focused. As described in its repository, Sarah is now composed of fine-grained components and interfaces, which make it is easier to replace pre-defined default behavior with customized implementation.

As of July 4th, 2017, Sarah is no longer pre-alpha and is now listed on awesome-go. While I am proud of what I have achieved, I must admit that this is not the end of our journey. Throughout all time, working on Sarah was not just coding. As a matter of fact coding in private time was the last thing I could do as a parent. That frustrated me from time to time. But I also knew we were going to have less and less time to spend together as my daughter would grow up; She would make friends in school, spend time with them, make a boyfriend, go to college, and eventually leave home. Having this project told me an important lesson that our time is always limited and we need to have a continuing effort to spend it wisely. I will continue to work on Sarah, but I am sure the actual Sarah, my daughter, always has higher priority. I am her father. I always am.

[EDIT] FYI, this project’s design philosophy, detailed specs, and my learned knowledge will be introduced in the following blog posts. Until then its GitHub repository should help.