Live data from Hacker News

Eight years of Go

blog.golang.org

31–40 of 291 posts

Re: Eight years of Go

#31
post #22

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/

I did a little research after I posted my original comment and came across that. It does seem usable even if it's not what I'd prefer

Re: Eight years of Go

#32
post #14
post #4

Earlier 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…

I’ve read the first article. It was eye opening, cause I am writing a bot right now and using exceptions to control input flow. Made me think about my design.

That said, it does not argue against exceptions. So, I am not sure what your argument is.

Re: Eight years of Go

#33
post #12

For 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.

I did worked with spring boot and intelijava, and I timed for a decent size project it was over 40 seconds, but I believe a lot of it was Intelijava compiling, anyway, in go is instant.

Re: Eight years of Go

#34
post #15

Earlier 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 not endorsement of the parent post; I don’t agree with it either.)

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

#35
post #7

Go 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.

My concern is less about writing a bunch of separate functions, but rather the way this hampers the abstractions that are available to you everywhere in the language. You don't have map or fold! And that's only the very tip of the iceberg.

Re: Eight years of Go

#36
post #26
post #2

Things 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.

Depends IMHO. I love exceptions in Python, find them a bit ugly in Java and hate them in Haskell.

Re: Eight years of Go

#37
post #15

Earlier 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.

care to enlighten me? if you have an index you could get the sort for free, also you never pull all results, so why would you pull all, just to sort, on the web I would love to work more in ram, but since you assume a server will crash, you need to save the actual state in the db.

Re: Eight years of Go

#38
post #7

Go 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).

Complaints about generics aren't coming from a minority group. It's a majority now.

Re: Eight years of Go

#39
post #10

I 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.

Yeah, they are (and the author admits as much) but I found

> 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

#40
post #2

Things 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.

I thought this as for a long time. Then I used go for awhile and I think I like the go way better. It solves the issues I had with execptionless languages without all the noise.

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.

Post reply on HN