I applied to a position in a really nice company from Sillicon Valley, with an office in Berlin. In the job description I just paied attention to the fact that the person should know Python - the language I like most. 🤓
When the first email from the company arrived, I was very excited!
Hm… Where is Python?
To be honest, I felt frustrated at the first moment. After all, how could I get it right using a language that I don’t feel comfortable? Specially because those three languages were the same for me: I did a Hello World at least.
I couldn’t help my self, so I decided to ask on the internet, at last the people are always right, Vox populi, vox Dei.
Tweets in Brazilian Portuguese followed by an explanation:
At the beginning of the conversation I was unwilling. As a Pythonist, it seems easier to go with Ruby, since both languages are similar. After all, I’m afraid of JS (🤐) and as far as I remembered the Golang sintaxe was ugly (yes, this is a honest blog post).
So, let’s go to the qualifications: why not JS?
Sim, o background com certeza interfere. JS é multi paradigma, e atua tanto client-side quanto server-side … por isso o tempo seria maior— Yan Magalhães (@yaanmagale) 13 de outubro de 2017
Yan suggested Go and he summarized well the problem. JS is flexible and is everywhere. But I had no idea about which challenge I would face during the process. Thais almost read my mind and I crossed the name off the list.
Depende muito do background… Se for python eu diria Ruby, se for c go… Se for manicômio js— this Viana (@thaisviana) 13 de outubro de 2017
It depends from the background… If the background is Python, I would say Ruby, if is C, Go… If it is bughouse, JS.
At this stage, I was getting crazy: what will it be? An API? Algorithms?
Meanwhile, at the Hall of Justice, beyond the tweets tip, I asked recommendations for Rubist friends. After all, Python looks like Ruby, right?
Yes, that’s the problem.
Porque a linguagem é mais simples mesmo, tem menos irregularidades e pegadinhas.— Luciano Ramalho ☂ (@ramalhoorg) 13 de outubro de 2017
Because the language is more simple, has less irregularities and gotchas.
In the meantime, I realized that Ruby could trick me with a self-confidence that I couldn’t have. And it would be a disaster.
Should I stay or should I Go?
Finally I decided: I would go with Go.
Well, time to draw up a plan. The email arrived and I must answer. I would have 48 hours to study and to answer the challenge! I tried to come up with some ideas of what would be important to learn in a programming language:
- Create variables, control flow, interations
- Main libraries
- How to organize a project
Many details for a short time.
At that time I got a subscription on Alura (in pt-br) and they have a basic Go trainning. I found the project used during the trainning interesting: creating a website monitoring, like pingdon. Something like that would give me the change to learn the sintaxe basics and the http library.
I did some exercises on Exercism.io to pratice problems resolution and I even try to create some small project during the weekend but no luck; I didn’t have as much time as I want to.
But I dedicated plenty of time reading and I found nice stuff, like:
Avelino shared most part of this list, thanks man! 👍🏽
This talk, specially, it’s quite interesting. But how could I been thinking about Anti-Patterns since I have no Pattern in Go? Incredible as it may seem, I already had done mistakes in my few hours as a Go developer. But it was cool to being exposed to it to understand more about the language!
But… did I go to the bottom of all of it? Of course not
All those content have helped me along the road. I finally had started the challenge scared to death but at this point I wasn’t writing variables with snake_case. 😅 In the middle of all of this, I had a trip of 26 hours ahead of me. To keep coding offline, I bought an e-book Programando em Go (pt-br).
Go at first sight
Like moving from Portugues to Deutsch, there are many many things we found different when moving from a language to another. In Go, for instance:
- Compiling error in unused variables 👍🏽
- Variables without a value are, by default, “”, false, 0, 0.0 👍🏽
- There are just 25 keywords 👍🏽
- There is no try/catch 👍🏽
- Inheritance is different - try to build something like abstract classes might be awkard at the begining 🤔
- There is no while, only for 👍🏽
- You can create as many types as you want to 👍🏽
- Comments are highly recommended when you have public functions 👀
- Lot of code to do simple stuff like read and write files 🙄
- Bizarre, the way to format dates 💣
Well, I could list many things but I think these eye-catched me. As a beginner, I may be talking silly things - it’s part of the process.
Bonus: I used VSCode and I can say I was surprise how it helps me to learn. A lot of people are recommending it. The plugins for Go lang are quite mature and the IDE is fast.
So, this was the odissey of learning Go. About the challenge? I just submited and I could pratice everything I listed above. From the design perspective, I had surprises with Go. As far as I understood, the language is structured but it’s possible to use with OO.
Was interesting to remember things like memory allocation and at the same time exercise software design to use better the language features in my favour.
Despite the gut feeling, was really nice to learn something new. I’d like to thank all the tweets and tips. Now it’s just crossed fingers! 🤞🏽
See you soon!
comments powered by Disqus