←back to thread

Go is still not good

(blog.habets.se)
644 points ustad | 1 comments | | HN request time: 0s | source
Show context
SkepticalWhale ◴[] No.44985889[source]
Go has its fair share of flaws but I still think it hits a sweet spot that no other server side language provides.

It’s faster than Node or Python, with a better type system than either. It’s got a much easier learning curve than Rust. It has a good stdlib and tooling. Simple syntax with usually only one way to do things. Error handling has its problems but I still prefer it over Node, where a catch clause might receive just about anything as an “error”.

Am I missing a language that does this too or more? I’m not a Go fanatic at all, mostly written Node for backends in my career, but I’ve been exploring Go lately.

replies(10): >>44985997 #>>44986010 #>>44986136 #>>44986517 #>>44986991 #>>44987075 #>>44987252 #>>44987361 #>>44987973 #>>44992564 #
tomjen3 ◴[] No.44987361[source]
I have a deep hatred of Go for all the things it doesn't have, including a usable type system (if I cannot write SomeClass<T where T extends HorsePlay> or similiar, the type system is not usable for me).

For NodeJS development, you would typically write it in Typescript - which has a very good type system.

Personally I have also written serverside C# code, which is a very nice experience these days. C# is a big language these days though.

replies(1): >>45029198 #
1. bccdee ◴[] No.45029198[source]
FYI, newer versions of Go do support the following

  type HorsePlay interface {
   Neigh()
  }
  
  type SomeClass[T HorsePlay] struct {
   players []T
  }
  
  func (sc SomeClass[T]) NeighAll() {
   for _, p := range sc.players {
    p.Neigh()
   }
  }
  
  type Horse struct{}
  
  func (h Horse) Neigh() {
   fmt.Println("neigh!")
  }
  
  func main() {
   sc := SomeClass[Horse]{players: []Horse{{}, {}, {}}}
   sc.NeighAll()
  }