Live data from Hacker News

What makes you enjoy Go lang?

news.ycombinator.com

11–20 of 44 posts

Re: What makes you enjoy Go lang?

#11
Things I love about it:

- gofmt. The fact that it comes with an opinionated formatter means I don't waste time with bikeshedding.

- Simplicity. I love how Go just gets out of my way and lets me do my work. I also don't need to worry about crazy abstractions and deep levels of inheritance.

- I usually don't need to worry about performance bottlenecks. Go is pretty fast.

- Typed. Over time I ended up hating languages like Python and JavaScript because of the lack of typing. Typed languages let me catch a large amount of errors at compile-time, and it also serves as documentation.

- Go-routines are a very elegant way to deal with concurrency.

- The standard library has a great selection of tools like JSON parsing that are usually not native in other languages.

- Dependency management is pretty good. Not the best, but definitely better than languages like C++.

- Single binaries. You can compile a Go application into a single binary and have it as the entry point of a container. The result are very small containers that start up very quickly.

Thing I don't like about it:

- Error handling got better over time, but it's still annoying to find out if an error is of a specific type in legacy code.

- It would be nice to have more built-ins for lists, such as .includes(), .filter(), .map(), etc.

- Nil pointers. It would be great if there was a way to ensure points will never be nil.

I was really skeptical about it at first, but it quickly became my favourite language.

Re: What makes you enjoy Go lang?

#13
I like being able to unmarshal a json response into a typed struct. That gives me the ability to get intellisense in my IDE. Then I don't have to guess what the json response shape looks like. It also helps me prevent issues with trying to access invalid keys in the json response. This really helps when dealing with an external API.

Re: What makes you enjoy Go lang?

#14

Things I love about it: - gofmt. The fact that it comes with an opinionated formatter means I don't waste time with bikeshedding. - Simplicity. I love how Go just gets out of my way and lets me do my work. I also don't need to worry about crazy abstractions and deep levels of inheritance. - I usually don't need to worry about performance bottlenecks. Go is pretty fast. - Typed. Over time I ended up hating languages l…

Some good points are presented. Interestingly, Vlang (https://vlang.io/) has the .filter(), .map(), etc... and addresses Nil/Null (relegating it to unsafe). Error handling is done differently (with many liking that style), but this point tends towards a programmer's preferences.

Re: What makes you enjoy Go lang?

#15
post #8

Coming from Ruby: it is fast, and compiled, but still very easy to use. Lacking fancy features and having types and structs is a bonus when it comes to reading other people's code. When you come back to a program that is 5 years old there's very little bit-rot and it recompiles easily. In this regard, the tendency to have everything built in Go (avoiding external OS dependencies) is a plus.

One more: the ability for one application to have different versions of libraries imported by different modules. This makes maintenance and upkeep easier, especially after years have passed.

Re: What makes you enjoy Go lang?

#16

I like being able to unmarshal a json response into a typed struct. That gives me the ability to get intellisense in my IDE. Then I don't have to guess what the json response shape looks like. It also helps me prevent issues with trying to access invalid keys in the json response. This really helps when dealing with an external API.

This is similar to other types languages no ?

Re: What makes you enjoy Go lang?

#17
post #16

I like being able to unmarshal a json response into a typed struct. That gives me the ability to get intellisense in my IDE. Then I don't have to guess what the json response shape looks like. It also helps me prevent issues with trying to access invalid keys in the json response. This really helps when dealing with an external API.

This is similar to other types languages no ?

Kotlin is the only statically typed language that has the same ergonomics as Go (that I know of), and even then you need an external dependency.

Re: What makes you enjoy Go lang?

#18

Things I love about it: - gofmt. The fact that it comes with an opinionated formatter means I don't waste time with bikeshedding. - Simplicity. I love how Go just gets out of my way and lets me do my work. I also don't need to worry about crazy abstractions and deep levels of inheritance. - I usually don't need to worry about performance bottlenecks. Go is pretty fast. - Typed. Over time I ended up hating languages l…

I would want to add to the above list:

- I love golang's build toolchain. Cross-compilation is just an environment variable.

- I love its go:embed functionality, as it removes the necessity of crappy squashfs based solutions, and allows embedding all assets e.g. a webserver/website needs.

What I both like and dislike:

- Marshalling. It can be a joy to use marshalling when you are in control of the data structures, but it also can be PITA when you have to parse external JSON data structures that do not conform to the same types.

- Something like parsing an arbitrary package.json, where fields can be e.g. a string, an array of objects or a single object is real pain to do in golang because it requires to use the reflections API.

- Having to use signal channels to synchronize threads/routines. Sometimes it's just easier to use a for true loop than using a signal channel, because a signal channel isn't compatible with the program architecture. It would be nice if there was a cleaner way to spawn channels via goroutines (e.g. channel = append(channel, go func...?)

Re: What makes you enjoy Go lang?

#19
post #17
post #16

Earlier quoted context omitted.

This is similar to other types languages no ?

Kotlin is the only statically typed language that has the same ergonomics as Go (that I know of), and even then you need an external dependency.

Java can do the same with a library like Gson or Jackson

Re: What makes you enjoy Go lang?

#20

Things I love about it: - gofmt. The fact that it comes with an opinionated formatter means I don't waste time with bikeshedding. - Simplicity. I love how Go just gets out of my way and lets me do my work. I also don't need to worry about crazy abstractions and deep levels of inheritance. - I usually don't need to worry about performance bottlenecks. Go is pretty fast. - Typed. Over time I ended up hating languages l…

All of this. Another thing I love is its test tooling and test conventions. Go makes it very intuitive, efficient, and (for me) fun to write tests early and often. _Not_ testing feels like a waste of really great tooling shipped right with the language.
Post reply on HN