DEV Community

Discussion on: Golang for Experienced Developers

Collapse
 
bastianrob profile image
Robin

I'll add another

  1. Only primitive type constants
  2. Lack of default constructor for struct
  3. Weird interface{}
Collapse
 
leob profile image
leob • Edited

Yeah it's funny how cobbled together the language seems, and how poor the type system is, but it's still hugely popular because people get stuff done with it - you can't really argue with that ...

The above 3 points are valid concerns, but for me it's the lack of Generics that sticks out like a sore thumb.

(one big reason why Go is so popular are the intuitive and incredibly useful Go Routines - another reason is its well-conceived and well-executed Standard Lib)

Thread Thread
 
bastianrob profile image
Robin

TBH I've had my share of probelm with absence of generic in go too.

Oftentimes find myself cooy pasting another part of my code with same functionality but different type.

But go is simply too simple and too opinionated. Everybody's codestyle are roughly the same and it's super easy to pick up on go projects codebase than, say, JavaScript.

Thread Thread
 
leob profile image
leob • Edited

Exactly! You end up copy/pasting and rewriting loops endlessly, because there are no Generics.

I think it's a good thing that Go is simple, that's the philosophy of the language and they should stick to it. I've also looked at Rust, and it's brilliant but it is HARD.

But, they should REALLY consider adding generics to Go ... if they're allowed to add one and only one thing to the language, generics it should be.

Thread Thread
 
livesamarthgupta profile image
Samarth Gupta

I guess generics are on their way in Go. Check freecodecamp.org/news/generics-in-...

Thread Thread
 
leob profile image
leob

Yeah I heard they were working on it, great to see that it's coming!