June 8, 2018

How I became a golang programmer

Tldr: by casualty

Well that's it, I was programming in python for 4 years, in a great team when there was a project to try to port one of our services in go. A friend and I started the port effort.

In parallel there was other team doing the same but in Scala. And it was kind of a competition.

The mistakes

I wanted to port all the functionality. For a POC I think is not good to implement all the features. Because you have like a month to finish your port, and you are trying to implement 5 years changes.

Worse I took function by function and I tried to implement them in go. Today I know that I should focus only in produce a  "minimum viable product". Then extend it when needed.

The struggle

 It's difficult to switch your mind from a dynamic typed language like Python to other that is strong typed. The project was programmed in the language, which means that was using a lot of specific features it.

My approach to learn

I didn't really dedicate time to learn the language, I thought that I would just program and ask google how to do stuff but in go. Go by example was very cool resource but incomplete (now I think is complete, but at that time not)

That was a bad idea. Because my mind was so oriented to Python, that I didn't realize like in a spoken language sometimes there is not a direct translation.

The balance

After some time, I started to forget Python and my mind just switch to solutions with the tools that go have. I improved my fluidity. (I did the advent of code 2017 in go, that helped a lot). In other words the old advice is true. There is nothing better than practice, practice and practice.

And then when you kind of start to be intermediate in go, your old experience "kick in" and you start to think "hey I can do that in go with this" That experience was amazing.

Like a fractal

For me golang is like a fractal that looks very simple when you look it from far away. But oh boy! each time I have an interest I can dig in and I can't see the bottom. It is like a fractal each time you zoom in there is more content.

The past week I was interested to learn templates and go generates and wow, is just very cool what you can do with that. And I felt that I only saw the tip of the iceberg.

Go won

Well that was relative at the end, the go project was finished in a fraction of the time of the Scala team. (They were using play framework and during the time of the project a new version appears that change everything, the team wanted to jump in to the new changes. Sometimes the features stability of go is underestimated).

But

Scala was faster due the implementation of couchbase lib, I think with more time we could improve the performance. But the experiment end there.

The team continue working in python and I moved to other company as a go developer.

No comments: