DEV Community

Cover image for Pitch me on Go
Ben Halpern
Ben Halpern Subscriber

Posted on

Pitch me on Go

Part of a new series! Feel welcome to dip in and weigh in on a past question.

Let's say I've never used Golang before. Can anyone give the run down of what the language does and why you prefer it? Feel free to touch on drawbacks as well.

Oldest comments (38)

Collapse
 
wiseai profile image
Mahmoud Harmouch

In brief, GO is a blazingly fast, statically typed programming language that outperforms so many damn dynamically typed languages.

FYI: There is a go version of docker-compose called compose v2. Worth a try. You will never regret that.

Collapse
 
codewander profile image
Anon • Edited

Super fast pr reviews because there are very few choices to make. I don't love go, but that seems like it's strongest selling point relative to scala. It kind of reminds me of the goals of "basic English".

Collapse
 
highcenburg profile image
Vicente G. Reyes

What's the basis for learning Go in a day?

Collapse
 
wesen profile image
Manuel Odendahl

I like pointing people who already know programming to "Effective Go". If you have no experience with concurrency and threading, that will take some additional learning. Don't go in there just YOLOing channels and goroutines left and right.

My rules for goroutines:

  • know when, where and why a goroutine is created
  • for every goroutine, make sure it can properly be cancelled
  • for every goroutine, think and design how it would report errors
  • for every goroutine, know exactly when it finishes, and how its results are handled
  • use errgroup to start goroutines, and write actual goroutine bodies as Run(ctx *context.Context, args...) error
Collapse
 
codewander profile image
Anon

Coming from scala, clojure, elixir viewpoint, the golang ecosystem is huge and many vendors provide bindings. From a python, node view, golang feels a little smaller.

Collapse
 
aceix profile image
the_aceix

Man, u've bee sleeping in dough; niche background

Collapse
 
wesen profile image
Manuel Odendahl • Edited

Pros:

  • get shit done
  • very readable
  • lots of nice libraries
  • all libraries that do async work are easily integratable
  • easy cross compilation + static binaries
  • opinionated toolchain
  • easy to integrate code generation
  • go mod + workspaces finally make it nice
  • faster than most things out there, good enough for serious embedded work

Cons:

  • kind of user hostile (terse tool output)
  • dependency management was a shitshow for a long time (kind of solved)
  • people gloss over the fact that you can easily make big big concurrency booboo if you don't know what you are doing
  • very verbose (github copilot helps a lot)
Collapse
 
karanpratapsingh profile image
Karan Pratap Singh

It's very productive language with very powerful concurrency. I also released my course on it recently!

Collapse
 
peerreynders profile image
peerreynders
  • sorta functional but lacking

First time I've seen that as a euphemism for procedural.

Go FAQ: Why build concurrency on the ideas of CSP?:
"Experience with several earlier languages has shown that the CSP model fits well into a procedural language framework.".

It's a procedural language with a built in coordination model (for something functional you have go with something like Erlang or Elixir).

Collapse
 
iamschulz profile image
Daniel Schulz

Just look at the mascot.

 
peerreynders profile image
peerreynders

It is a very simple language

"It must be familiar, roughly C-like. Programmers working at Google are early in their careers and are most familiar with procedural languages, particularly from the C family. The need to get programmers productive quickly in a new language means that the language cannot be too radical."

Go at Google: Language Design in the Service of Software Engineering

In Rich Hickey's terms it tends more towards easy (familiar) rather than simple.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.