Re:New case studies about Google’s use of Go
by kevinmgranger on Thursday August 27, 2020 @04:48PM
(#24298472)
map/filter and sum types are not about "fun", they're about correctness and expressiveness.
map/filter and their equivalent loops are both perfectly readable, but the latter involves more boilerplate.
Re:New case studies about Google’s use of Go
by somethingwitty1 on Thursday August 27, 2020 @06:48PM
(#24299532)
And I'd disagree. Numerous engineers of differing skill levels (what I deal with day to day), struggle significantly when map/filter are added into the mix. And we may say "get better engineers", but we don't have that ability. We have to write code that is maintainable for the engineers we have and can get (and the ones coming in the future).
Re:New case studies about Google’s use of Go
by Guthur on Thursday August 27, 2020 @08:27PM
(#24300233)
Come on, map and filter difficult? That's hyperbole of the highest order.
Re:New case studies about Google’s use of Go
by ecnahc515 on Thursday August 27, 2020 @11:10PM
(#24301008)
Not really. They require a basic understanding of higher order functions and often heavily use closures. Those moderately advanced concepts. It’s also sometimes harder to write efficiently to avoid multiple iterations over the same collection. I think many many people are way more comfortable with loops than people are with map/filter.
Re:New case studies about Google’s use of Go
by hrez on Thursday August 27, 2020 @04:58PM
(#24298592)
I'd settle for comprehensions. It already has generic for/range so why not. That would cover a lot of boilerplate annoyances.
Re:New case studies about Google’s use of Go
by piazz on Thursday August 27, 2020 @05:00PM
(#24298616)
Correctness isn't about fun, although fun is definitely a side effect. I agree Go is easier to read if you're primarily familiar with C style imperative programming, but once you've strayed from that a bit, a PR in Typescript is no more difficult to review than one in Go. The big benefit of languages with more expressive type systems is the confidence you get that your code will work as expected if it compiles - I felt this in Swift more than in TS, and very little in Go.
Re:New case studies about Google’s use of Go
by nvarsj on Thursday August 27, 2020 @05:15PM
(#24298762)
I love go but the OP is completely right. Lack of basic collection functions is incredibly aggravating and slows down productivity substantially. At least it's not as bad as Java.
Re:New case studies about Google’s use of Go
by vips7L on Thursday August 27, 2020 @06:06PM
(#24299218)
I'm not sure how you can have that opinion of Java when Go is basically Java pre-generics. Especially in the context of collection functions. Java's stream API is simply amazing.
Re:New case studies about Google’s use of Go
by nvarsj on Friday August 28, 2020 @05:28AM
(#24302978)
Yeah sorry, the Java collections API is pretty great. I meant in terms of raw boilerplate the language requires you to type to get anything done. This is definitely improving, and you can use things like Project Lombok to generate a lot of it.
Re:New case studies about Google’s use of Go
by DaiPlusPlus on Thursday August 27, 2020 @06:15PM
(#24299287)
Java's photocopy of .NET's Linq in the form of "Streams" is usable.
https://www.youtube.com/watch?v=rFejpH_tAHM
https://www.youtube.com/watch?v=2y0pmRJNkLA