My Experience with Learning Golang

栏目: IT技术 · 发布时间: 4年前

内容简介:So you want to learn Golang?Great! Perhaps I could help you. When I learntI’d be joining Uber, I had some time to prepare for the tech stack ahead. One of the key things I had to get onboarded to quickly was coding in Golang.So I started searching for good

So you want to learn Golang?

Great! Perhaps I could help you. When I learntI’d be joining Uber, I had some time to prepare for the tech stack ahead. One of the key things I had to get onboarded to quickly was coding in Golang.

So I started searching for good courses around the web, which could help with getting me caught up with the language and its paradigms. Some were great, others were pretty bad. And the bad part is, it isn’t obvious at first glance.

Actually, some of the most promoted courses on Golang are some of the most useless ones. So learning Go can be quite frustrating due to the lack of good courses out there.

In this article, I will share what good, bad and ugly courses I’ve encountered in the bumpy ride of learning Go.

Learning The Basics

This section is for complete beginners to programming. Go to the next one if you are already a seasoned professional.

If you’re just getting started with programming, I actually think Golang is not the best choice for it at the moment. Partly, because some of its paradigms are the result of accumulated wisdom from programming languages preceding Go.

One would not be able to understand it’s philosophy and design choices if one hasn’t seen e.g. how Java/Python/C++ work.

Additionally, probably the bigger problem is that there aren’t any good “Introduction to Programming” courses in Golang that I know of. The emphasis is on good .

Sure, there are some quite often recommended:

An Introduction to Programming in GO

I haven’t gone through this book myself, but I am breezing through it now and what I see is a set of one-pagers for explaining things beginners quite struggle with – for loops, arrays, functions, etc.

This is probably a good way to learn Golang if you already know some other programming languages, but it would get you nowhere as a beginner.

How to Code: Learn Google’s Go (golang) Programming Language

This is probably one of the most recommended courses for beginners, when learning Golang. In my opinion, it is quite bad.

The author does a good job of explaining some of the concepts at a beginner’s level, but it’s far from perfect.

Additionally, the provided exercises to the course are simply rehashes of the syntax of the language, rather than real problems which would help you learn.

If that’s the first ever course you take on programming, you’d have a “feel good” feeling that you are doing good and get a big slap in the face when you get a real programming problem to solve.

The Verdict

These are the two courses for beginners I’m most familiar with. As you see, I find both of them bad for beginners.

There are probably more as Udemy’s library is full. If you think there are courses for beginners which are better than these, please recommend them in the comments below, I’m quite curious myself.

But my recommendation for total beginners is to start from somewhere else. Go learn Python first (for example) – here’s actually a pretty good course for it .

Learning the Basics With Prior Knowledge

If you are already familiar with another programming language and want to learn Golang for whatever reason, the best resources to get you started in this order are:

A Tour of Go

This is a fast-track to learn Go’s syntax in a day. It’s a great choice for someone like yourself. Go through it to get familiar with it and get started

Gophercises

Among all the resources on Golang out there, this is the one I adore the most. This is not a step-by-step course on how to code in Golang or build some project by typing the stuff you see the instructor type on the screen.

It’s a set of projects with concise requirements you have to implement yourself without any guidance. The only thing you get is a video walkthrough of the author doing the exercises himself.

This is the best way to learn any programming language, if you’re not a total beginner. Far too many tutorials and courses out there teach you programming with a set of training wheels along the whole way.

This is a course which removes those training wheels and shows you that you can ride the bike yourself!

There is a reason that the majority of courses are not like these – the easier your course is, the more people will watch it. It has to be a “feel good” experience for people to go through it.

But the harsh reality is that programming is not a “feel good” experience and the sooner you realise that the sooner you’ll become a professional developer.

If you’re interested in something similar, whether because you did all the Gophercises or because you’re learning something else, check out exercism.io .

Data Structures & Algorithms Resources

If you start going through DS & Algorithms by completing the exercises in Golang, you’d be killing two birds with one stone.

You’ll be learning/refreshing your algo-fu and you’d be learning Golang at the same time.

There are many good resources on this topic. If you’re only looking for good exercises (without supplemental lectures), here are some good options:

Those are resources for small, independent coding problems. Any one would do the trick, these are just suggestions.

Just avoid Hackerrank . It’s, surprisingly, a terrible resource for studying DS & Algorithms as most of the problems there are tailored for competitive programming, which is very different from what you need from this subject area for professional development .

Unless you’re a 12-year old whizz kid, looking to get into international olympiads, you’d just be wasting your time.

Alternatively, Advent of Code is a more complete experience as it encapsulates both general programming skills and algorithm knowledge/skills.

If you have to choose one resource among all of them, choose this one.

Getting Into Web Development

In most use-cases, Golang is used for creating web applications. Fortunately, there is a great course to get you into this field with the language:

Web Development with Go

This course is from the same author as the Gophercises course. It doesn’t take the same approach, though. It walks you through completing a sufficiently complex project from scratch.

Although it is a complete walkthrough, there are plenty of opportunities to get the driving wheel and attempt to implement any part of the project yourself before the author starts it. That’s the way I suggest you go through this course.

The worst thing to do is to just watch the course from start to finish. A slightly better option is to do that while coding along.

The best option is to see what you have to do in the upcoming part, attempt to do it yourself, and watch the author do it afterwards. In this manner, it will take you more time to complete the course, but trust me, you will learn a lot more.

Additionally, there is a supplemental book to the online course. My recommendation is to just read the book and ignore the videos altogether. It’s the same content, in a different medium. But you’d go through the material much faster.

Building Microservices with Go

Golang is mainly used for building microservices, not monolith web applications. And yet, there aren’t any great courses for this that I know of.

There are some which seem relevant, but not any I could definitely recommend. All of the ones I’ve linked don’t have enough students nor do they look complete enough.

The way I’ve been learning this subject area, unfortunately, is through my experience at Uber. But that experience and knowledge is not available to the general public.

I feel like this subject needs a proper course been made.

Fortunately, it seems the Gophercises author is having something underway. He is teasing for an upcoming course, called Advanced Web Development in Go.

If you’re interested in that, you can subscribe to his site and stay tuned.

Conclusion

So there you have it. Not quite what you expected, probably.

Unfortunately, I really think the current landscape of Go courses isn’t very bright in comparison to what’s out there for e.g. Javascript or Python.

Nevertheless, I hope that with this article, I’ve helped you avoid some of the roadblocks along the way and get to the final destination faster and more effectively.


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

运营有道:重新定义互联网运营

运营有道:重新定义互联网运营

李明轩 / 机械工业出版社 / 2017-7-31 / 69.00元

本书是前百度资深运营专家多年运营经验的总结,是作者运营千万级用户规模的大型互联网产品的实操经验复盘,是作者在“在行”上为近百位CEO和高管提供互联网运营咨询服务后对互联网运营需求的深入洞见。 本书的思想基础是“运营必须以用户为中心”,从产品、用户、市场3个维度对互联网运营重新进行了系统性的梳理:从道的层面解读并重新定义运营方法论,从术的层面围绕方法论提出行之有效的解决方法和实际案例。重点不在......一起来看看 《运营有道:重新定义互联网运营》 这本书的介绍吧!

RGB转16进制工具
RGB转16进制工具

RGB HEX 互转工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具