If you read my last post, you know I’m studying Go now, and I’d like to share how I’m doing that. When I start learning a new language, generally I do 3 things:
- I read a good book
- I try to immerse in the language world
- And, naturally, I write some code
The “Programando em Go” book was my choice, I like the “Casa do Código” publisher, they have an interesting philosophy, and I decided to support them. I’m in the middle of the book and loving it (thanks Caio Filipini!) it was the right choice. But, if you don’t speak Portuguese, you can find great books in English.
The language world
I’m a podcast addict, so I’ve decided to check some content about Go. I already listened to a lot of episodes from this list https://github.com/golang/go/wiki/Podcasts#podcast-episodes.
But this is just how I discover things. There are Facebook groups, mailing lists, and many other alternatives if you’re not a podcast person ;-)
Let’s write code!
Finally, we don’t need to finish the book to start practicing!
I’ve decided to write simple games in Go. I found this fascinating website https://gameswithgo.org, where Jack Mott teaches how to write 2D-games by using Go. I could write my own pong game by watching this video:
A vital attitude when you’re writing code in a new language is to continually ask to yourself if you’re doing things in the right way. I always think things like these: - Am I declaring constants correctly? - Am I following naming conventions? - Should I call this method like this?.
I always think twice before writing code, even when I was following Jack Mott video, I frequently paused it and searched about things all he was talking. Thus this 1h video took me 5h, but it was much more elucidative.
Here’s my pong game: https://github.com/karreiro/pong-go :D
I hope you’ve enjoyed these tips, and please share in the comments section below your techniques for learning new programming languages too!