Earlier quoted context omitted.
What basic properties no longer hold?
Uninitialized variables are zero. Composite literals may omit fields, and they'll be zero. Map accesses for nonexistent keys return zero values. Channel receives from closed channels return zero values. make returns zero-valued slices. Comma-ok style type assertions return zero values. Slices are fat pointers where the zero value avoids an allocation for data.
Russ Cox is stepping down as the Go tech lead
391–396 of 396 posts
Re: Russ Cox is stepping down as the Go tech lead
#392Earlier quoted context omitted.
Uninitialized variables are zero. Composite literals may omit fields, and they'll be zero. Map accesses for nonexistent keys return zero values. Channel receives from closed channels return zero values. make returns zero-valued slices. Comma-ok style type assertions return zero values. Slices are fat pointers where the zero value avoids an allocation for data.
That would still hold. Those things just wouldn’t be typed as non-nullable.
Re: Russ Cox is stepping down as the Go tech lead
#393Earlier quoted context omitted.
That would still hold. Those things just wouldn’t be typed as non-nullable.
Now you're creating a flavor of types that cannot be used in many places. Or worse, a flavor of types that when added to a struct breaks existing uses. That'd be a major change.
Yeah, that’s the entire point. Type safety.
Re: Russ Cox is stepping down as the Go tech lead
#394Earlier quoted context omitted.
Now you're creating a flavor of types that cannot be used in many places. Or worse, a flavor of types that when added to a struct breaks existing uses. That'd be a major change.
> Now you're creating a flavor of types that cannot be used in many places. Yeah, that’s the entire point. Type safety.
You'd have to start by constructing replacements for all those mechanisms, then migrate all Go source code in the world over to the new APIs, just to enable Go to have types without zero values.
Re: Russ Cox is stepping down as the Go tech lead
#395Earlier quoted context omitted.
Well written list of what made Go better language during last years. I'd add iterators, the recent big thing from Russ.
Iterators and generics go against the original goals of Go - simplicity and productivity. They complicated Go language specification too much without giving back significant benefits. Iterators and generics also encourage writing unnecessarily complicated code, which makes Go less pleasant to work with. I tried explaining this at https://itnext.io/go-evolves-in-the-wrong-direction-7dfda8a1...
But what can we do against of this? This what I think: - stuck to use Go 1.16 - fork Go 1.16 and continue develop lang from there - learn OCaml... - give up and consume what these people decide to add to lang next and everytime feel disgust
Re: Russ Cox is stepping down as the Go tech lead
#396Earlier quoted context omitted.
Go provides generic types since v1.0 - maps, slices and channels. Go also provides generic functions and operators for working with these types - append, copy, clear, delete. This allows writing clear and efficient code. There is close to zero practical need in user-defined generic types and generic functions. Go 1.18 opened Pandora box of unnecessary complexity of Go specification and Go type system because of gener…
tell me, how often do you find yourself writing `interface{}`?