Live data from Hacker News

What makes you enjoy Go lang?

news.ycombinator.com

31–40 of 44 posts

Re: What makes you enjoy Go lang?

#31
--I like the tabs.

Tabs let everyone see the indent width they prefer. Some people get eye strain with indent width 2. This is why spaces are evil.

Using spaces for indent is like hard coding the color-theme of the editor into your code file. It's simply wrong.

Tabs are perfection.

--I like the tooling surrounding it. LSP server. code formatter gofmt. Build tools to X-compile for anything.

--I like the C-style error handling. Doing a check after every action with the potential for failure. Probably the biggest turn off for most people becuase errors bleed into the main flow of the program. Maybe for things like CRUD apps it's not ideal. But for really critical fundamental things error handling should be a first class part of the flow/logic, not just something that's chucked off, hidden away. Trade offs in all things though.

Re: What makes you enjoy Go lang?

#32
post #17

Earlier quoted context omitted.

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

Jackson is no where near as convenient as Go's marshaling system.

Re: What makes you enjoy Go lang?

#33
post #29
post #17

Earlier quoted context omitted.

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.

.NET has System.Text.Json. I wonder how does it compare to go's implementation

.NET is ok, but the classes you make serializable generally aren't how you'd write a normal class, which is what I mean by "ergonomic." As far as I know, you need your fields to be public for both reads and writes, and you need to write a separate constructor if you want to create the types programmatically. Go lets you serialize objects more-or-less how you'd write them without serialization, as does Kotlin.

Re: What makes you enjoy Go lang?

#35
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.

I am Ruby user myself, what made you pick Go instead of like Crystal?

Go is a boring technology that works extremely well.

Re: What makes you enjoy Go lang?

#36
It's a great relaxation language for hobby projects. After a day of cranking out tight functional style Typescript at $DAYJOB it's refreshing to work in a "stupid" language where the space to search for the most elegant solution is rather limited. You're just telling the computer what you want it to do in a very explicit and plain way.

Re: What makes you enjoy Go lang?

#37
Low cognitive load, both for developing and writing it. There's very little "debugging the language" instead of "debugging the program" compared to other languages, it's just too simple to do anything too clever.

Re: What makes you enjoy Go lang?

#39

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…

There’s a great “lo” package which implements these JS-like array and map functions using generics in Go. Coming back from a JS/TS job I’ve been really happy to find this.

Re: What makes you enjoy Go lang?

#40

--I like the tabs. Tabs let everyone see the indent width they prefer. Some people get eye strain with indent width 2. This is why spaces are evil. Using spaces for indent is like hard coding the color-theme of the editor into your code file. It's simply wrong. Tabs are perfection. --I like the tooling surrounding it. LSP server. code formatter gofmt. Build tools to X-compile for anything. --I like the C-style error…

I like the color analogy. Using spaces is like using a green chroma screen. Using tabs is like having an alpha channel, as long as everything supports the alpha channel it is the best.
Post reply on HN