DEV Community

loading...
Cover image for GOlang discussion πŸ€”

GOlang discussion πŸ€”

eichgi profile image Hiram ・1 min read

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? πŸ‘Œ

Discussion (8)

pic
Editor guide
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 Author

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 Author

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
pjotre86 profile image
pjotre86

Coming from Java:
Love the type inference and the multiple return values.
Miss the collection and stream api very much, though. Go feels very basic and rudimentary in that field.

Collapse
eichgi profile image
Hiram Author

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