Earlier quoted context omitted.
Are the complaints about lack of generics really a minority thing? Writing separate functions to sort different types just strikes me as ridiculous. EDIT: My original tone was a bit nasty in retrospect. Did a little research and while I still am on the generics side, the current situation seems at least workable for a good number of use cases.
But you don't need to do that. It's a bit clunkier than generics, but it's usable: https://golang.org/pkg/sort/
Eight years of Go
31–40 of 291 posts
Re: Eight years of Go
#32Earlier quoted context omitted.
Novice here. Why is having no exceptions a good thing, in your opinion?
For exceptional, unforeseen situations you do have exceptions, aka "panic". For signaling error conditions that the caller has to expect and handle, you have the `result, err = func(...)` idiom, and a compiler that would warn you if you forget to use the value of `err`. If Rob Pike's opinion on this is not enough, here's Martin Fowler saying essentially the same thing: https://martinfowler.com/articles/replaceThrowWi…
That said, it does not argue against exceptions. So, I am not sure what your argument is.
Re: Eight years of Go
#33For me Go is amazing, is my first language where I don't need a virtual machine or interpreter to compile to machine code, C++ is OK but not for day to day web. Changing something then having to wait 40 seconds for java to recompile drive me crazy, also same for tests. Yes would love to have a package system, but is coming.
Java has some flaws, but slow compilation is not one of them. Incremental compilers are available and pretty much eliminate pauses.
Re: Eight years of Go
#34Earlier quoted context omitted.
how often do you sort? most of the time you would do a database ORDER BY instead.
I...I can't even believe you just said that. Go really does have a unique core audience.
This is how you can sort slices of arbitrary types in Go:
https://play.golang.org/p/VHJW9lVY9b
I’m not sure about you, but it feels very reasonable to me. It’s not anywhere near the top of my list of pains that I feel when working with Go everyday.
Re: Eight years of Go
#35Go is an example of how to be extremely successful by catering to the needs of the project's core audience (well-rounded stdlib, extremely fast GC, short build times, trivial deployment, etc) while paying much less attention to the vocal minority's complaints (generics, package system, etc).
Are the complaints about lack of generics really a minority thing? Writing separate functions to sort different types just strikes me as ridiculous. EDIT: My original tone was a bit nasty in retrospect. Did a little research and while I still am on the generics side, the current situation seems at least workable for a good number of use cases.
Re: Eight years of Go
#36Things I love about go: 1. Probably the best ecosystem out there. 2. Go routines 3. (Enabled by (2) actually) `defer` 4. That I can add interfaces implementations to structs I don’t own 5. No exceptions. Actually (5) is one of the few things I don’t like about Haskell. If Go had ADTs and generics it would easily be my favorite language. Edit: and of course the channels. Edit2: yeah, i have no idea why i connected (2)…
#5 is not a positive thing.
Re: Eight years of Go
#37Earlier quoted context omitted.
how often do you sort? most of the time you would do a database ORDER BY instead.
I...I can't even believe you just said that. Go really does have a unique core audience.
Re: Eight years of Go
#38Go is an example of how to be extremely successful by catering to the needs of the project's core audience (well-rounded stdlib, extremely fast GC, short build times, trivial deployment, etc) while paying much less attention to the vocal minority's complaints (generics, package system, etc).
Re: Eight years of Go
#39I find myself wondering how important the "fun facts" are in this fascinating thread about Go: https://twitter.com/pasiphae_goals/status/923820615022399488
Some of those things are true and annoying, while others are exaggerations, and the rest are just wrong. That thread is poor taste.
> Fact #38: go is supposedly a garbage collected language, but it has not once deleted itself nor any of my code.
pretty hilarious.
Re: Eight years of Go
#40Things I love about go: 1. Probably the best ecosystem out there. 2. Go routines 3. (Enabled by (2) actually) `defer` 4. That I can add interfaces implementations to structs I don’t own 5. No exceptions. Actually (5) is one of the few things I don’t like about Haskell. If Go had ADTs and generics it would easily be my favorite language. Edit: and of course the channels. Edit2: yeah, i have no idea why i connected (2)…
Lack of exceptions is the main reason I won't use it.
With exceptions you most often just let them trickle up the call chain, which is the same thing you often do with err, just return it.
And the returning the err works much better when doing async. Cross thread exceptions are a PITA and you are basically back to just returning an error obj.