4 ms·
> It's much more difficult to read since you have to know the position of elements of the struct At least the Go editor I use (GoLand by JetBrains, one of the
by throwaway34241 7y ago
> It's much more difficult to read since you have to know the position of elements of the struct
At least the Go editor I use (GoLand by JetBrains, one of the more popular ones) will display the names of all the fields in positional initializers inline with the code (just as they would be in a named initializer), so it's pretty much the same readability-wise. There's a special color for these automatic labels that indicates they aren't actually part of the document.
> in the case you add and remove a field of the same type, it's entirely possible the program will compile fine
True although I think it's easier to work around this (by fixing the compile errors from removing the old field before adding the new one).