> Java initializes variables to their zero values
I know, but that's not what I'm referring to here. I'm referring to someone writing:
type A struct {
A int
B int
}
a := A {A: 1, B: 2}
then modifying `A` by adding another field `C int`
The code continues to compile, with `C` being initialized to 0, which can be incorrect.
In Java or C#, you'd add a third value to the constructor, resulting in a compile time error for all constructor invocations.
As I said, I've seen this issue come up in production resulting in bugs.