Aug 6, 2017

Parenting software engineer

It was a cold day for spring that my wife gave birth to a beautiful baby girl, Sarah. Despite the snowy weather, Sarah was sleeping peacefully in her mother's arm. Being overwhelmed with grateful feeling after watching the faces of a newborn and her mother, I realized a passion to give birth to something was evolving in me. Giving birth is the most beautiful and creative act only allowed for females that weaves a rich tapestry of life, so I as a male software engineer wanted 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. Once a software engineer stops growing as one, he can easily be left behind from this rapidly growing industry. This fact frightened me all the time. I needed to grow as much as my daughter did. However many parents complained that having kids gave them less time to work on what they want to and there was nothing they could do about. This was a reasonable complaint I was not going to agree. Having a daughter must be something enriches my life; not something burdens me. If there is someone to blame, that should be me. Not my daughter. Working on a new project that focuses on a new area of interest should help me grow as a software engineer.

For this project, I chose customizable chatbot framework as a theme. It was 2015 and creating chatbot was becoming a new trend. In technical perspective, creating chatbot framework involves skills such as follows:
  1. having better design to clearly separate abstraction from implementation layer
  2. having better understanding about 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 PEP 484 release was around the corner and PyCharm was working on adapting this type hinting feature. While learning Python, I found a package named abc that could be used to define abstract base class. I thought a combination of type hinting and abc could provide well structured architecture. Decorator was also a good solution to minimize plugins function's specification by wrapping its core logic with actual messaging logic. However it became obvious that I took type hinting too serious. Instead of passing around arbitrary dictionary as function argument, I preferred to define designated class that represents 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 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, it also presented some hidden requirements that I missed last time. To fulfill the requirements, I added another layer called Runner at the bottom. Adapter focuses on connecting to 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 on 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 on 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 grew 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 on following blog posts. Until then its github repository should help.