When I initially started Go, it felt so easy to pick up. Then I wrote a component in it and it felt overly verbose. Then I had to revisit the component and had to do some heavy refactoring/additional testing and realized that the language, to certain extent, didn't stand in the way. After all these iterations, I think Go is leaving an-even-bigger-adoption on the table for the want of following: 1. Functional operator…
1 and 2 are now possible to implement, since 1.18 - I'm using this and it does save quite a bit of boilerplate: github.com/life4/genesis I'd love to see less verbose error handling too, but Rust's ? IMHO is not the best way to go - it adds quite a bit of magic and makes debugging difficult, when a question mark at the end of a line "injects" an unexpected return statement.
Spf13 is leaving Google
141–150 of 179 posts
Re: Spf13 is leaving Google
#142When I initially started Go, it felt so easy to pick up. Then I wrote a component in it and it felt overly verbose. Then I had to revisit the component and had to do some heavy refactoring/additional testing and realized that the language, to certain extent, didn't stand in the way. After all these iterations, I think Go is leaving an-even-bigger-adoption on the table for the want of following: 1. Functional operator…
Where they actually trying to copy other's well-known-to-be mistakes?
Re: Spf13 is leaving Google
#143Earlier quoted context omitted.
But only because there's no `contains` function!
what `contains` what? you could write this in Go if m[key] { } the comma ok idiom simply lets you distinguish a "zero" value from a missing value.
Re: Spf13 is leaving Google
#144When I initially started Go, it felt so easy to pick up. Then I wrote a component in it and it felt overly verbose. Then I had to revisit the component and had to do some heavy refactoring/additional testing and realized that the language, to certain extent, didn't stand in the way. After all these iterations, I think Go is leaving an-even-bigger-adoption on the table for the want of following: 1. Functional operator…
I dont know why the Go designers put in implicit null and left out proper sum-types and pattern matching. Where they actually trying to copy other's well-known-to-be mistakes?
That said, there are other languages with proper sum-types and pattern matching, if that's what you need; I think it's a bad thing that some people advocate for every language to have every feature from every other language. Take Javascript; someone Decided that it should have classes, but the implementation has never been good (e.g. field access levels) and it's always felt bolted on. Take Scala, which borrowed every feature from every other language ever, and now you can't have two people work on one Scala codebase without them having endless discussions about which flavor or pattern to use.
Re: Spf13 is leaving Google
#145Earlier quoted context omitted.
But only because there's no `contains` function!
what `contains` what? you could write this in Go if m[key] { } the comma ok idiom simply lets you distinguish a "zero" value from a missing value.
Re: Spf13 is leaving Google
#146Earlier quoted context omitted.
So basically a Googler, nonetheless.
Have you found Googlers to be self-aggrandizing on average? That's not been my experience working there. (But might be different for "Googlers who talk a lot/are well-known publicly".)
Re: Spf13 is leaving Google
#147Earlier quoted context omitted.
>Add simple conveniences - e.g. "contains" to check if a key is present in a map. Why though? it doesn't even save you much space compared to standard use: if _, ok := m[key]; ok { } vs if contains(m, key) { } I'm not strictly against it, but it can open pandora's box of all kinds of weird sugar flavors.
I know zero go, despite having worked with it professionally for a short stint that I try and block out of my memory (not go's fault), anyway that first example looks like gibberish to me while the second is super clear.
Of course this is all guesswork based on similar stuff i've seen elsewhere, so i might be off, but i think despite not knowing the language it still looks readable if you know any other mainstream language (and exercise some guesswork/imagination :-P).
Re: Spf13 is leaving Google
#148Who cares, seriously?
First of all - https://news.ycombinator.com/newsguidelines.html
Read the guidelines. This is an unproductive useless comment which isn't encouraged in HN.
Also, others buddy! Others care. He didn't submit this. Others who follow his work did. I just knew this alias "spf13" until today. Not the person or his whereabouts. I run my website with Hugo. So while I didn't care before, NOW I DO! This is how you learn about new stuff. If you don't want, just move on from HN!
Why is this kind of unproductive comments cropping up again and again? Haven't these folks read HN guidelines? If you don't care, move on! Why comment anything at all?
Re: Spf13 is leaving Google
#149When I initially started Go, it felt so easy to pick up. Then I wrote a component in it and it felt overly verbose. Then I had to revisit the component and had to do some heavy refactoring/additional testing and realized that the language, to certain extent, didn't stand in the way. After all these iterations, I think Go is leaving an-even-bigger-adoption on the table for the want of following: 1. Functional operator…
> 1. Functional operators like map/filter/reduce - all of these would be optional but would save SO many lines of code. But at the cost of performance; Go is not (yet?) optimized for functional programming constructs, and its function syntax adds a LOT of mental overhead to reading the code; http://www.jerf.org/iri/post/2955 was a good post on that. Remember the Go proverb: clear is better than clever. In this case,…
For example the line
return Filter(string)(func(s string) bool { return len(s)
should contain no occurrence of 'bool' (it is implicit in the definition of a Filter) and at most one occurrence of 'string' (it is a filter over a string sequence if and only if the input of its defining predicate is a string).Is there any alternative technique for functional style in Go?