Live data from Hacker News

New case studies about Google’s use of Go

opensource.googleblog.com

261–269 of 269 posts

Re: New case studies about Google’s use of Go

#261
post #254

Earlier quoted context omitted.

> so changing the visibility of a variable or function now results in a huge diff if it's used in many places) You can create an exported version of the function (calling into the unexported one), no diff except the new function. But also just updating all the callsights is usually not a huge issue, especially if you are using an IDE such as GoLand.

> You can create an exported version of the function These are the kinds of hacks that show that golang wasn't really designed for "programming in the large", despite their claims. I've used goland, and the actual renaming is generally fine (it means it works correctly when needed). However, that doesn't mean that there isn't a lot of friction

I don't agree with the term "hack" here. Different is not "hack".

I maintain some very large codebases. This has never been an issue.

If one decides to export a function, the only callers of that function will be from within the package it was defined in already. Even within a package, how many call sites will there actually be and do they need to use the exported version of the function?

I'm not saying it's good, or bad, just that in my (fairly extensive) experience it has not been a problem. I do recognize that some people may have problems with it, though.

Re: New case studies about Google’s use of Go

#262
post #254

Earlier quoted context omitted.

> You can create an exported version of the function These are the kinds of hacks that show that golang wasn't really designed for "programming in the large", despite their claims. I've used goland, and the actual renaming is generally fine (it means it works correctly when needed). However, that doesn't mean that there isn't a lot of friction

I don't agree with the term "hack" here. Different is not "hack". I maintain some very large codebases. This has never been an issue. If one decides to export a function, the only callers of that function will be from within the package it was defined in already. Even within a package, how many call sites will there actually be and do they need to use the exported version of the function? I'm not saying it's good, or…

My experience has been otherwise, it's been extremely friction-inducing and I had to go out of my way to split up diffs into smaller ones in order to make it clear what was going on. A language like Java or C# would have just had a single line difference (`-private +public`) and be done.

Re: New case studies about Google’s use of Go

#263
post #219

Earlier quoted context omitted.

I think some people feel productive when they write out a big loop, but to me it’s wasted effort. I want to write col.filter(_.isReady).map(convertToX).any(_.color == BLUE) and generate whatever fused loops make that work. I don’t want to write and review loop boilerplate by hand for the same reason that I don’t want to customize the stack frame layout when I call a function.

This style makes developer forget the underlying costs though. It feels productive but it is harder to understand what work computer will do. Go is designed to be imperative, so is a complementary language.

That's true and we should embrace it. Higher-level languages should empower us. We should use profilers to measure actual bottlenecks when necessary, not make every potential bottleneck more painful to write and read forever.

Re: New case studies about Google’s use of Go

#264
post #257

Earlier quoted context omitted.

If IsReady, ConvertToX, and GetColor can return errors then this isn't that far off. But then you're not making an apples to apples comparison. You would have to extend your functional example so that it also handles errors. Unless it already does, and I am missing something.

What I wrote should be pretty close to valid Scala, which handles exceptions. I can imagine wanting to skip an isReady failure, which looks like col.filter(c => Try(c.isReady).getOrElse(false)) .map(convertToX).any(_.color == BLUE)

I see. Then in part the comparison is showing off exception handling, not FP.

Rust is a good example of functional lang without exceptions (panics aside).

In Rust there are many cases where I could use FP but opt not to because it can make error handling more awkward. For example to collect the result of a map operation to a vector, and if there is an error along the way you want to abort the entire operation. In functional this means collecting to a Result>. Not sure if I'm just tired today but I can think of how to do it in 5 seconds with a loop. I suspect functional solution would be uglier.

Re: New case studies about Google’s use of Go

#265
post #264

Earlier quoted context omitted.

What I wrote should be pretty close to valid Scala, which handles exceptions. I can imagine wanting to skip an isReady failure, which looks like col.filter(c => Try(c.isReady).getOrElse(false)) .map(convertToX).any(_.color == BLUE)

I see. Then in part the comparison is showing off exception handling, not FP. Rust is a good example of functional lang without exceptions (panics aside). In Rust there are many cases where I could use FP but opt not to because it can make error handling more awkward. For example to collect the result of a map operation to a vector, and if there is an error along the way you want to abort the entire operation. In fun…

Rust’s collect will do this for you. It’s even an example in the documentation.

Re: New case studies about Google’s use of Go

#266
post #264

Earlier quoted context omitted.

I see. Then in part the comparison is showing off exception handling, not FP. Rust is a good example of functional lang without exceptions (panics aside). In Rust there are many cases where I could use FP but opt not to because it can make error handling more awkward. For example to collect the result of a map operation to a vector, and if there is an error along the way you want to abort the entire operation. In fun…

Rust’s collect will do this for you. It’s even an example in the documentation.

Thanks! I learned something new.:)

https://doc.rust-lang.org/stable/rust-by-example/error/iter_...

This is easy to miss if you are mainly reading reference docs. I probably read the getting started guide at a time before there was a section on it.

My other comment in this thread comes to mind https://news.ycombinator.com/item?id=24300057

Re: New case studies about Google’s use of Go

#267
post #266

Earlier quoted context omitted.

Rust’s collect will do this for you. It’s even an example in the documentation.

Thanks! I learned something new.:) https://doc.rust-lang.org/stable/rust-by-example/error/iter_... This is easy to miss if you are mainly reading reference docs. I probably read the getting started guide at a time before there was a section on it. My other comment in this thread comes to mind https://news.ycombinator.com/item?id=24300057

I was thinking of the final example in https://doc.rust-lang.org/stable/std/iter/trait.Iterator.htm... , glad we have it in both places!

I don’t personally really agree with what you’ve said, but that’s fine. Different people perceive things differently.

Re: New case studies about Google’s use of Go

#268
post #266

Earlier quoted context omitted.

Thanks! I learned something new.:) https://doc.rust-lang.org/stable/rust-by-example/error/iter_... This is easy to miss if you are mainly reading reference docs. I probably read the getting started guide at a time before there was a section on it. My other comment in this thread comes to mind https://news.ycombinator.com/item?id=24300057

I was thinking of the final example in https://doc.rust-lang.org/stable/std/iter/trait.Iterator.htm... , glad we have it in both places! I don’t personally really agree with what you’ve said, but that’s fine. Different people perceive things differently.

No problems. There are enough dimensions involved in what makes a language good that Im pretty sure I could rationalize why any language is better than another, measured along only one of them.

Robustness. Speed. Simplicity. Easiness. Conciseness. Writability. Readability.

Hard to tell which are independent vs correlated, let alone how they factor into productivity. And productivity is also a function of the kind of problem you work on.

Re: New case studies about Google’s use of Go

#269
post #74

You can see more very exciting case studies of companies using Go here, didn't know until now Twitch or Facebook (and even Target!) uses Go a lot. https://go.dev/solutions/#case-studies

All backend systems at save a few minor exceptions are written in Go :)

This comment was about Twitch :'( I guess you guys thought I was talking about something else
Post reply on HN