DEV Community

Ido Shamun
Ido Shamun

Posted on

Should I learn Go?

I have been a developer for around 10 years.
In the last few years I've been using especially Javascript and Scala for web development and data processing, I love functional programming.
There is a huge hype now around Go and the popularity is growing.
I am thinking giving it a "go" :P

Let me know what you think, pros/cons, anything...

Oldest comments (48)

Collapse
 
ben profile image
Ben Halpern

Go is definitely going to be a big deal for years to come.

I also feel like the Go ecosystem touches on much of the most cutting edge techniques in distributed systems, so I feel like learning it gets you closer to some really interesting things (which pay a lot!)

Gophercon also looks like one of the great software conferences.

I know some Go and have enjoyed the basic experience, but I can't speak too much to the actual language other than second-hand accounts. Haven't gotten that deep.

Collapse
 
idoshamun profile image
Ido Shamun

Could you give an example to cutting edge techniques? Like event sourcing and such?

Collapse
 
olddutchcap profile image
Onorio Catenacci • Edited

When you ask this sort of question, you're likely to get two types of responses:

Developers for whom Go is a pet language. They'll love it; they'll go on and on about how wonderful it is. Don't get me wrong, I'm sure all the sterling qualities they tell you about will be totally 100% true. Thing is they won't mention the sharp edges and/or the places where the language isn't so great.

The other responses you're likely to get are those who despise Go for whatever reason. They'll point out all the weaknesses of the language--"No interfaces? Are you f***ing joking?"--stuff of that sort. I don't think they'll give you much of a balanced and considered response either.

In short while I understand the desire to figure out if it's worth your time to invest in Go, I think posting the question here is probably the least good way to figure out if it's worth your time. Play with Exercism.io. Look at the number (and quality) of questions asked about the language on Stack Overflow. Try to write something beyond the typical "Hello World" with it and see how it feels.

I have found over the years that chasing the new hotness when it comes to programming language is really a fool's errand. No one knows what will prosper, what will become a footnote and what we all wish would die off already (VB6 anyone?) Learning new stuff is definitely great and I totally agree with you on that. But trying to decide what you should learn based on what's "the next big thing" is sort of foolish. I can't tell you what I'll be working on six months from now. It takes years for a language to develop enough of a following for there to be good jobs writing it. Therefore I think trying to predict what's worth learning based on future job prospects dictates that <sarcasm> we keep on with C# and Java </sarcasm> unless we're really willing to play the long game.

Just my humble opinions of course.

Collapse
 
idoshamun profile image
Ido Shamun

Actually I was looking for the extremists to show up. This way you learn the most about the best and worse of the language.

Collapse
 
rhymes profile image
rhymes • Edited

The language isn't going to change much from what it is now. They will add generics and improve error handling. They will finalize the packaging system. That's it. Don't expect it to change for many years.

Collapse
 
olddutchcap profile image
Onorio Catenacci

:) Then I suspect you're already getting what you wanted!

Collapse
 
idanarye profile image
Idan Arye

+1. One of Go's main selling point is being very easy to get into - so just get into it and form your own opinion!

Collapse
 
idoshamun profile image
Ido Shamun

What about the built-in concurrency support and ecosystem?

Collapse
 
alchermd profile image
John Alcher

Interesting. Can you give some example of Go's restrictive syntax compared to C?

Collapse
 
tojacob profile image
Jacob Samuel G.

I had Go on my roadmap, but I changed it to Rust after reading experiences and opinions. This is just a comment, of course, I can not talk more on either of them.

Collapse
 
quii profile image
Chris James • Edited

My situation was quite similar to you, I was born for this question.

Overall had about 8 years experience at the time, about 4 of which was Scala.

I really love(d) Scala, wonderfully expressive, so much to learn about category theory and generally how to write software in a very "sound" way.

But it's not without it's problems right? It's hard in a big team because it's a difficult language where there are about 10 ways to write something. A lot of bikeshedding will occur on teams when one side thinks you should use Akka, another play, etc etc. Plus the compilation times are quite slow and the tooling around it is difficult and awkward (sbt).

The project I was working on had a fairly extensive test suite, coupled with the compilation times I could be waiting 15 minutes for a full build.

Whilst playing foosball was fun I eventually started learning Go in between the builds. (yes, really!)

Go, for better or worse is almost the opposite of Scala

  • The tooling is extremely good. It's simple to build, test, format, document and benchmark software. Deployment is also very easy
  • The compilation times are very fast. Feedback loops are excellent
  • The standard library is simple and thoughtful. The Scala standard library is pretty good to be fair, but there are so many options for making a web server for instance. In Go it is all built in, you can get extremely far with the stdlib (including testing).
  • This is very beneficial coupled with the backward compatability guarantee because it means there are lots of high quality tutorials that will always be correct. No longer looking at old tutorials around Play! In addition no pain of lack of binary comaptability of libraries when upgrading language versions which i recall being extremely annoying when going from scala 2.8 to 2.10!
  • The language is very simple. There's a very small amount of keywords and constructs compared to Scala
  • Interface resolution is impliclit. You dont say "My Foo implements bar", if your foo has the correct methods it just does. This turns out to be quite nice.

So what's it like for a Scala developer writing Go?

You'll love the feedback loops, but you'll hate writing loops. There's no generics (yet, but they are planned) so you have to write a lot of code you wouldn't have to in Scala.

The ability to build abstractions is far lower than Scala. So you'll end up writing what you'll consider boilerplate. Still you'll end up writing a lot less than you think because the standard library is excellent. Compared to the baggage around the JDK and whatever libraries you choose to bring in the overall cognitive load is a lot lower

Have a look at this todo server code

This is something I hacked together last week. Yes there are for loops. But that is all the code that is needed. You can build that one file and deploy it and you have your web server. No dependencies. All very standard Go that you can find tutorials on how to write it. I didn't have to think at all.

For me, learning Go made me re-evaluate what's important about a programming language. Syntax and expressiveness like in Scala are nice traits and have their uses but a language's ecosystem has a much bigger impact on your ability to just ship stuff. To this day I still have more experience writing Scala than Go but if I was making a product for myself I would pick Go in a heartbeat because it just makes producing robust, fast and simple to maintain software easy

Collapse
 
idoshamun profile image
Ido Shamun

I read somewhere that Go developers "just get the shit done".
By reading your comment I can understand that this is actually the reality.
Sounds like that we are very much a like experience wise and I am totally familiar with what you describe.

Thanks!

Collapse
 
rhymes profile image
rhymes

great answer!

Collapse
 
quii profile image
Chris James

Go is a worse version of C, made for people who don't want to go the extra step to achieve the same goal in C

It isn't and that's a very diengenous comment.

Go is a type-safe (unlike C) general purpose language with a garbage collector which for 99% of problems out there are very useful. For sure if you dont want GC use C or Rust.

 
quii profile image
Chris James

Well, that's news to me :)

Is it really any good?

Man all that memory management I did all those years ago was all for naught.

Still Go is a million times easier to write than C and will be easily performant enough for most tasks a developer would want to do.

Collapse
 
mortoray profile image
edA‑qa mort‑ora‑y

If you've not learned a system level language before, like C or C++, then learning Go is probably a good idea. I have no idea what the language is like, but I'm assuming it exposes concepts you've not yet been exposed to. Even if you end up not using Go, learning new concepts will help you in whatever direction you go.

Don't pick it for hype though. Pick it for learning. And don't hesitate to drop it if isn't helping you in some way.

Collapse
 
idoshamun profile image
Ido Shamun

I have been a C++ programmer for a few years so I know what system level language is like and the whole concept, I actually I like it.

I am not choosing Go because of the hype, I am trying to figure out if there is something behind this hype. The one thing that really caught my eyes is the amazing performance of Go due to the fact it's a system level language.

Collapse
 
derek profile image
derek • Edited

I believe a lot of the hype is sadly due to it's "concurrency" model which is now a buzzword which also ends up getting conflated with another buzzword "parallelism".

Go is definitely a SOLID language (pun intended), but it does have it's warts:

  • 📦management
  • 🚫generics (yet?)
  • too many ways to declare a var
  • etc, etc

I do think...

There are 2 types of programming languages: one nobody uses and the other everybody complains about - somebody?

Personally, I really enjoy writing Go (for work and play) and being apart of it's community (for work and play).

Collapse
 
rhymes profile image
rhymes

Don't pick it for hype though. Pick it for learning. And don't hesitate to drop it if isn't helping you in some way.

That's what I did, I steered clear of it for a long time because of the hype, now I'm still unsure if I like it because I like it or if I like it because I'm learning something different from the day to day. I'll get to the answer eventually

Collapse
 
bgadrian profile image
Adrian B.G.

Yes, especially if you care about the engineering problems that Go try to solve in the Cloud.

Also it only has around 15 keywords, extremely simple to learn. While you were reading this article comments you could have learn 40% of Go.

Most haters will pinpoint superficial reasons, but once you understand why Go is this way you will appreciate its simplicity and see that there is no other way to solve them.
Most design decisions will enforce the devs to build a robust, easy to maintain codebase.

Who compares Go to C has no idea what he is talking about, I haven't see any C support for lambda functions, but I saw projects that had 80000LOC of C for a database connection transformed to 20LOC of Go. Most probably you will not see fridges and microwave software written in Go either.

Also based on your previous language experience you will appreciate the builtin tools and the new package management system, which compared to JS nightmare are a bliss.