DEV Community

Cover image for GOlang discussion πŸ€”
Hiram
Hiram

Posted on

GOlang discussion πŸ€”

Hi folks!

I am doing a Go bootcamp and I would like to know your thoughts about working with Go compared to other languages like Javascript, PHP or (insert your preferred language).

It was easy or hard for you to make the leap to Go? What you think it's great in Go and what stuff do you miss from other languages? What is your recommendation for Go rookies?

Thanks every1 for your opinions!

p.d. which is the best guide or course besides officials docs do you recommend? πŸ‘Œ

Top comments (8)

Collapse
 
foresthoffman profile image
Forest Hoffman

I have years of experience with all of the above, and Go is by far my favorite! :D

I like the slow progression of updates to the language (relative to JavaScript, every other language's ecosystem is slow lol), so new and deprecated features are easier to get used to.

Having worked extensively with both front-end and back-end, I personally prefer working on back-end services that handle the business logic. And, that is completely subjective! I find it enjoyable, which makes me enjoy using Go more, because Go is best suited for building back-end web services.

I enjoy how fast it is relative to Node or PHP, and relative to how long it takes to write Go code.

The official docs are better than most other languages mostly because the language is very restrictive in the way it is formatted. There are some design choices that you can make, but ultimately, one person's Go code is going to look like the next, otherwise it won't compile or run. go fmt is your friend!

The error reporting is pretty fantastic.

The debugging is also pretty fantastic relative to un-compileable interpreted languages like JavaScript or PHP.

I'm the kind of learner that needs to do in order to retain knowledge. So, I usually learn best by having a challenge presented and then attempt to solve it. I think Go By Example has some good content for beginners.

Other than that, you can find pretty much anything you want out of Go by googling "golang [thing]".

Also, who doesn't go "aww" when looking at these little gophers?! Look at em!

Artwork of cute cartoon gophers working on a computer

Collapse
 
eichgi profile image
Hiram

Ufff great stuff man! Thanks for the links, I'll check them out.

Collapse
 
rsa profile image
Ranieri Althoff • Edited

Go ranks as bad as PHP and slightly worse than Java. That's the worst position on my personal rank.

I miss virtually anything that makes a language productive:

  • generics (no, interface{} is not generics, it's just garbage)
  • error handling (also no, that crap is NOT error handling)
  • even the most basic utility functions (nothing for ints in math? wtf)
  • you can't assign a fixed-length array to a dynamic-length one
  • namespaces. the "package" thing is terrible
  • there are no constants. const is a compile time value, not a runtime constant.

Also, it's all buggy/incomplete:

  • fmt.Print and fmt.Println differ in how they concatenate args
  • log.Print and log.Println BOTH break line at the end - the difference is concatenating args, like above
  • there's special syntax to handle maps and lists that is not available anywhere else in the language
  • converting between primitive types and between structs is a completely different syntax
  • sync package has a thread-safe map (nice), but does not have a list (why?)
  • there are 2 pieces of code to handle URL punycodes (yes, it's repeated), but NONE are exported - you need an external package for a piece of code that is already in the standard library

All things considered, it's just waste of sanity. Just use Python or JS, and when you need the speed, use C++ or Rust.

Collapse
 
eichgi profile image
Hiram

Awesome, this is also the kind of comments that helps to learn. Despite what you dislike, would you use it anyway because of the good performance?

Collapse
 
rsa profile image
Ranieri Althoff

No, if I needed good performance I would use C++, no garbage-collected language would be proper in this field. If I need a massive level of concurrency, I would probably use Javascript (with Node) or Elixir.

Maybe there are some edge cases where they aren't as performant as Go, but productivity wins by a lot here.

Collapse
 
syxaxis profile image
George Johnson

Coming from a systems admin background, I'm not a fulltime dev, I found I disliked scripted and runtime supported langugages like Powershell and Python respectively. While I really like coding in Java quite a while back, again the need to lug around a runtime was the worst part, plsu every the Sec team utterly hates Java and its runtimes! I found Go about a year ago, took to it immediately.

My shop is moving off old legacy Sun SPARC kit, I work on automation across Windows, Linux and cloud microservices, so having a language ready made to run across the board is a big win in ramping up quickly. Already coded several production utils and tools with it, it's "good enough" for my needs.

Go is far from perfect, leaves a lot to be desired but it's extremely easy to learn, very quick to code in, tons of libraries/modules out there but the lang's built in funcs have most of what I need out of the box. To repeat I'm not a fulltime dev, primarily a db\system admin who codes, so the simplicity and ease of Go is "good enough" for what I need.

I tried Rust but I feel like you need to have really solid understanding dev principles in order to really work with Rust, I don't have the low level core dev skills needed to cut it with Rust, so I stuck with Go. I tried Python but I found it way to "sloppy", most of the number crunchers in the data team at my shop use Python, and even though me and my workmate aren't coders we seem to spend way too much time telling the data-crunchers how to recode their awful Python tools, that put me right off Python forever!

Collapse
 
altiano profile image
Altiano Gerung

API simplicity and just lightweight.

Collapse
 
eichgi profile image
Hiram

I thought the same, once I go deeper I'll look for collection helpers...