Learn Go in 20 days
I looked at the log and it actually took less than 20 days, but the title says 16 days, which feels strange since it’s not a multiple of 10.
First of all, let’s talk about learning time in relation to the environment.
When I was at Dew University, I was deeply influenced by the idea of “mastering one language first”, which turned out to be a trap. By the time I graduated, I only had a basic understanding of C and I didn’t even excel at it (learning other languages expands your understanding of programming).
So you guys should be able to learn faster!!!
I’m tired after saying just a few words >﹏<, let’s quickly move on to the steps.
-
Apart from the fact that type declaration comes after the variable name, the syntax of Golang is quite similar to C. At least it’s not as annoying as Obj-C, and you can easily get used to the syntax sugar.
Then let’s talk about web programming. If you pay attention, it won’t take long to learn.
-
This is like a practical environment where you can test various usage scenarios.
Once you’ve become familiar with the first two steps, you’ll be able to write something on your own and play around with it.
For example, I created a web version of Zhihu Daily homepage. Click here to check it out.
The development process and source code can be found here.
Of course, Github is another skill you need to learn.
Framework - I used Martini
Framework is a different thing altogether. Even if you’ve mastered the language, you still need to spend time learning frameworks built on top of that language. Ruby, for example, has been completely overshadowed by Ruby on Rails.
So initially, I didn’t plan to use a framework. But as I kept writing, I realized that I had to implement things like routing on my own, so I started using one.
Performance has been discussed extensively online, so I won’t talk about it here.
However, the people aspect is the most important. From a programmer’s perspective, Golang is still very good. It’s a statically-typed language that, to some extent, allows you to write code like you would in a dynamically-typed language. Except for the pain of JSON conversion and the incessant checkerr (I’m really not criticizing it!!!)
Well, I used Ruby before coming to Golang and Ruby was so enjoyable that I felt quite uncomfortable after switching.
Translated by gpt-3.5-turbo