Live data from Hacker News

Why you should use Go

mortenvistisen.com

51–60 of 75 posts

Re: Why you should use Go

#51

Earlier quoted context omitted.

Wouldn’t you just use sort.Slice? Doesn’t go having such type specific functions mean you don’t have to? Feels like that makes your codebase _less_ complex since the core logic is handled by the language stdlib, not code written and maintained by your team.

Sorting using generics is faster and more ergonomic. That's why they are adding generic based sort to the standard library. https://pkg.go.dev/golang.org/x/exp/slices#Sort Sort on its own is maybe not the best example because it's relatively easy to work around, but those workarounds quickly break down. Write me a function that returns the keys of a map in order without using generics... I'm not exactly sure what you…

But go isn’t a language without generics, so I don’t understand the criticism

Re: Why you should use Go

#52

Earlier quoted context omitted.

Sorting using generics is faster and more ergonomic. That's why they are adding generic based sort to the standard library. https://pkg.go.dev/golang.org/x/exp/slices#Sort Sort on its own is maybe not the best example because it's relatively easy to work around, but those workarounds quickly break down. Write me a function that returns the keys of a map in order without using generics... I'm not exactly sure what you…

But go isn’t a language without generics, so I don’t understand the criticism

Well you were quoting a part that said "in a language without generics" and were questioning why that was bad, so that's what they responded to. But that used to be Go, and it got a lot of pushback when generics were introduced. It illustrates an issue people have where obviously good language features are rejected by a loud minority for seemingly no good reason.

Re: Why you should use Go

#53

Earlier quoted context omitted.

Minimalism is the biggest selling point, if you are comparing it to C#. If you don't see a lot of people using it, maybe you're looking in the wrong place? I work with platforms, and Go is everywhere.

What do you mean by platforms?

Platform engineering. Think toolchains, devops, cloud, infrastructure...

Re: Why you should use Go

#54

Earlier quoted context omitted.

I can't code review every one of 150 devs under me. I can't depend on heroes saving the day. Heroes go do their own thing eventually.

if you think you need to code review for 150 people or your code base will get out of control then it sounds like there’s bigger problems going on

No, I don't think so - because I chose tools like Golang that do the job for me.

Re: Why you should use Go

#55
post #30

The author here, thanks for posting this. I can see a lot of people not agreeing with Go, that’s fine, I still love writing it everyday. Taking choices away from you in terms of language features enables you to focus on the problem you’re solving. That makes it a great choice to me.

Thanks for writing this up.

> Taking choices away from you in terms of language features enables you to focus on the problem you’re solving.

As someone that worked with Kotlin for a couple of years, I can agree with this. I actually enjoyed the language but there were so many, I'd say, obscure things or multiple ways you could do the same thing that I'd feel lost sometimes. As someone once said - Kotlin is easy to write, but somewhat hard to read. In the end I just wanted to solve problems and ship my product and I felt the language was getting in my way a lot of the times.

Anyway, in the end I guess it's about personal feeling and conformity with the language of choice.

Re: Why you should use Go

#56
post #55
post #30

The author here, thanks for posting this. I can see a lot of people not agreeing with Go, that’s fine, I still love writing it everyday. Taking choices away from you in terms of language features enables you to focus on the problem you’re solving. That makes it a great choice to me.

Thanks for writing this up. > Taking choices away from you in terms of language features enables you to focus on the problem you’re solving. As someone that worked with Kotlin for a couple of years, I can agree with this. I actually enjoyed the language but there were so many, I'd say, obscure things or multiple ways you could do the same thing that I'd feel lost sometimes. As someone once said - Kotlin is easy to wr…

Yeah, personal feelings towards a language are a big factor.

I once did a short gig with a start-up that used Kotlin and the CTO was very enthusiastic about Kotlin. He showed all the things you could do in the languages like adding behavior to an integer that would be applied throughout the program. He was excited and I was a little horrified haha. But huge companies have been built using Kotlin so who am I to judge?

I'm in the same boat as you, I want to solve problems and build products.

Re: Why you should use Go

#57

Earlier quoted context omitted.

> But, it is verbose and generally takes longer time to write and understand compared to Go. I respectfully disagree, and I don't think I'm alone in that. I would be willing to bet that the majority of people who have used both languages professionally would agree with me. Reading or writing N lines of Go is easier and faster than reading or writing N lines of Rust, true. But you have to repeat yourself so much in Go…

I agree with you. Go saves a lot of time by having an amazing standard library and tooling... but the tedious writing out of the loops man! I don't even mind `if err != nil` - that's just proper error handling, but writing out loops and maps by hand like a cave man... I can't go back to that.

Haha that's fair! I do miss Rust semantics with .map(), .filter() and chaining them together.

Re: Why you should use Go

#58

Earlier quoted context omitted.

Sorting using generics is faster and more ergonomic. That's why they are adding generic based sort to the standard library. https://pkg.go.dev/golang.org/x/exp/slices#Sort Sort on its own is maybe not the best example because it's relatively easy to work around, but those workarounds quickly break down. Write me a function that returns the keys of a map in order without using generics... I'm not exactly sure what you…

But go isn’t a language without generics, so I don’t understand the criticism

You were specifically asking about generics. If you wanted me to give an example of the usefulness of some other feature that Go refuses to add, I would.

Yes, Go finally added generics (years too late). But the fact that so many people were opposed to them for so long illuminates something about Go culture that is still relevant.

Re: Why you should use Go

#59

This horse has been long flogged to death. My list: Mostly fits in my head, gc, not horribly slow, boring concurrency, low effort cross-compilation, good distribution story. It's contentious but I like the "low abstraction ceiling". Go punishes people who want to turn everything into a framework or abstraction and rewards people who just knuckle down and write the code that solves the actual problem instance. Is it t…

Go is terrible for writing frameworks, because time and time again it picks "simple". Look at generics, people inside google were practically begging Pike to consider adding them, as it would make Go code a lot more flexible, but he held out for years.

It's "simple" if you're just gluing other people's code together, and don't get me wrong, having a single portable artifact + run time is amazing, but as someone who's built a KV store engine with Go, you hit the rough edges very quickly.

Re: Why you should use Go

#60

I can’t stand go. It is painful and annoying to write compared to almost any modern language. Yes it’s simple, and makes it easy to write concurrent programs using one particular style of concurrency, which are about the only good things anyone can say about it. The proponents of go seem to have an almost cult-like devotion to simplicity. They think adding any facility for abstraction makes a language into a complica…

I guess I'm part of that cult as I value simplicity greatly. Heck I was even against generics and iterators, though the former has grown on me a bit. One question I ask in earnest, why do people not just use another language rather than try to get features jammed into Go? There are so many good ones out there now, it feels like a person can choose something to their own liking. If it's being forced at work, I guess t…

You value simplicity because all of the complicated and painful code (mostly as a fault of Go's shortcomings) have been abstracted away from you.
Post reply on HN